/* BHS CRM styles. Colors and type match the approved design canvas. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root, [data-theme="light"] {
  --page: #E6EFF8; --surface: #FFFFFF; --surface-2: #F0F5FB; --chip: #E3EBF5; --seg: #D6E3F1;
  --text: #14213D; --text-2: #3A4458; --text-3: #5B6478;
  --border: #CBD7E5; --border-strong: #B5C4D6; --divider: #E1E9F2;
  --navy: #0F4C81; --navy-text: #D6E6F5; --accent: #0F6CB6; --accent-soft: #E5F2FB; --accent-border: #9CC8EA; --accent-text: #0B5A96;
  --warn-soft: #FBE8D6; --warn-text: #9A4412; --ok-soft: #DDEFEC; --ok-text: #1C5A54; --danger: #B42318; --danger-soft: #FDECEA;
  --link: #1E4E8C; --toast: #14213D; --shadow: rgba(20,33,61,0.07); --logo-plate: transparent;
  --tag-r-bg: #E1EAF7; --tag-r-fg: #1E4E8C; --tag-c-bg: #FBE8D6; --tag-c-fg: #8A4210; --tag-p-bg: #DDEFEC; --tag-p-fg: #1C5A54;
  color-scheme: light;
}
[data-theme="dark"] {
  --page: #0F141B; --surface: #1B1C1F; --surface-2: #222327; --chip: #2A2C30; --seg: #232428;
  --text: #E7E7EA; --text-2: #B9BBC1; --text-3: #9A9DA4;
  --border: #2C2E33; --border-strong: #3A3D43; --divider: #26282C;
  --navy: #0F4C81; --navy-text: #D6E6F5; --accent: #2F86CC; --accent-soft: #25292F; --accent-border: #3D4652; --accent-text: #A9C8EA;
  --warn-soft: #33261C; --warn-text: #EDAA6A; --ok-soft: #1D2E2B; --ok-text: #8FD1C3; --danger: #F08A7E; --danger-soft: #3A1F1C;
  --link: #A9C8EA; --toast: #2E3036; --shadow: rgba(0,0,0,0.4); --logo-plate: #E8E9EC;
  --tag-r-bg: #242A34; --tag-r-fg: #AEC6EA; --tag-c-bg: #33261C; --tag-c-fg: #EDB383; --tag-p-bg: #1D2E2B; --tag-p-fg: #8FD1C3;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* keep hidden things hidden, even buttons and flex boxes */
html, body { margin: 0; }
body {
  min-height: 100vh; background: var(--page); color: var(--text);
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif; font-size: 15px; line-height: 1.45;
}
a { color: var(--link); }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Top bar */
.topbar {
  background: var(--surface); border-bottom: 4px solid #0F6CB6; padding: 8px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; min-height: 68px;
}
.topbar .logo { display: flex; align-items: center; padding: 4px 8px; border-radius: 10px; background: var(--logo-plate); }
.topbar .logo img { height: 36px; width: auto; display: block; }
.topbar nav { display: flex; gap: 2px; overflow-x: auto; }
.topbar nav a { color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; padding: 12px 10px; border-radius: 6px; white-space: nowrap; }
.topbar nav a[aria-current="page"] { color: var(--accent-text); font-weight: 700; background: var(--accent-soft); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.who { font-size: 14px; font-weight: 600; color: var(--text-2); }
@media (max-width: 760px) { .topbar nav { order: 3; flex: 1 1 100%; } }

/* Buttons and inputs */
.btn {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-small { min-height: 38px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 44px; padding: 0; }
.input, select.input, textarea.input {
  min-height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 12px;
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface); width: 100%;
}
textarea.input { padding: 10px 12px; min-height: 90px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.error-text { color: var(--danger); font-size: 13px; font-weight: 600; }

/* Page layout */
.page { width: 100%; max-width: 1440px; margin: 0 auto; padding: 22px 24px 64px; display: flex; flex-direction: column; gap: 16px; }
.band {
  background: var(--navy); color: #FFFFFF; border-radius: 16px; padding: 20px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; box-shadow: 0 4px 14px rgba(15,76,129,0.18);
}
.band h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.band p { margin: 2px 0 0; color: var(--navy-text); font-size: 15px; }
.band .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.band .btn { background: #FFFFFF; border-color: #FFFFFF; color: var(--navy); }
.band .btn.btn-report { background: #F2B33D; border-color: #F2B33D; color: #14213D; }
.band .btn.btn-report:hover { filter: brightness(1.06); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px var(--shadow); }
.muted { color: var(--text-3); }

/* Views (All leads / Rate watch / ...) */
.views { display: flex; gap: 4px; padding: 4px; background: var(--seg); border-radius: 12px; align-self: flex-start; flex-wrap: wrap; }
.views button {
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.views button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px var(--shadow); }
.views .count { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--text-2); }
.views .count.alert { background: #B4531C; color: #FFFFFF; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1 1 260px; }

/* Leads table */
.table-wrap { overflow: auto; max-height: 72vh; position: relative; } /* relative: keeps hidden screen-reader labels inside the scroll area */
table.leads { width: 100%; min-width: 1060px; border-collapse: collapse; font-size: 14px; }
table.leads th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-size: 12px; font-weight: 700;
  color: var(--text-2); padding: 0 12px; height: 44px; border-bottom: 1px solid var(--border);
}
table.leads td { padding: 8px 12px; border-top: 1px solid var(--divider); vertical-align: middle; }
table.leads tbody tr:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount { font-size: 16px; font-weight: 700; }
.lead-name { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--chip); color: var(--text-2); white-space: nowrap; }
.tag-review { background: #B4531C; color: #FFFFFF; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding-left: 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); }
.status-pill.is-new { background: var(--warn-soft); border-color: var(--warn-text); }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-pill select { min-height: 38px; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); padding: 0 8px 0 0; cursor: pointer; }
.empty { padding: 48px 16px; text-align: center; color: var(--text-2); }
.empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--chip), var(--surface-2), var(--chip)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pager .info { font-size: 13px; color: var(--text-2); }
.pager .btns { margin-left: auto; display: flex; gap: 6px; }

/* Lead record */
.record { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.record aside { flex: 1 1 300px; max-width: 380px; overflow: hidden; }
.record main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.profile-top { background: var(--accent-soft); border-bottom: 1px solid var(--accent-border); padding: 22px 20px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; }
.profile-top h1 { margin: 4px 0 0; font-size: 24px; }
.profile-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.money-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--divider); }
.money-pair .k { font-size: 12px; font-weight: 600; color: var(--text-3); }
.money-pair .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.money-pair .v.none { font-size: 15px; font-weight: 500; color: var(--text-3); padding-top: 6px; }
.facts { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.crumbbar { background: var(--navy); color: #FFFFFF; padding: 8px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.crumbbar a { color: #CFE3F7; text-decoration: none; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.crumbbar .sep { color: #9FC3E6; }
.crumbbar .meta { margin-left: auto; font-size: 13px; color: var(--navy-text); }
.crumbbar label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--navy-text); }
.section { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.section h2 { margin: 0; font-size: 16px; font-weight: 700; }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 20px; margin: 0; }
.dl dt { font-size: 12px; font-weight: 600; color: var(--text-3); }
.dl dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.dl dd.none { color: var(--text-3); font-weight: 500; }
.notice { padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.notice-warn { background: var(--warn-soft); color: var(--warn-text); }
.notice-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.deleted-box { display: flex; flex-direction: column; gap: 6px; }
.deleted-box span { font-weight: 500; color: var(--text); }
.deleted-box .btn { align-self: flex-start; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
[data-theme="dark"] .btn-danger { color: #1B1C1F; }
.btn-danger:hover { background: var(--danger); filter: brightness(1.08); }
.danger-link { color: var(--danger); padding-left: 0; padding-right: 0; }
.delete-zone { border-top: 1px solid var(--divider); padding-top: 10px; }
.delete-confirm p { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.restore-btn { min-height: 30px; }
.notice-ok { background: var(--ok-soft); color: var(--ok-text); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; }
.timeline .rail .pt { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; border: 3px solid var(--surface); flex: none; }
.timeline .rail .ln { flex: 1; width: 2px; background: var(--border); }
.timeline li:last-child .ln { display: none; }
.timeline .body { padding-bottom: 16px; display: flex; flex-direction: column; gap: 2px; }
.timeline .body strong { font-size: 15px; }
.timeline .body span { font-size: 13px; color: var(--text-2); }
.note { border: 1px solid var(--divider); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.note .by { font-size: 12px; color: var(--text-3); }
.note p { margin: 4px 0 0; white-space: pre-wrap; }
pre.raw { margin: 0; padding: 14px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.5; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 10px; }

/* Settings */
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.copy-row .label { flex: 0 0 140px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.copy-row code { flex: 1 1 280px; min-width: 0; min-height: 40px; display: flex; align-items: center; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-family: ui-monospace, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat .k { font-size: 12px; font-weight: 600; color: var(--text-3); }
.stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--text-2); }
.result { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.result-created { background: var(--ok-soft); color: var(--ok-text); }
.result-duplicate { background: var(--chip); color: var(--text-2); }
.result-review, .result-error { background: var(--warn-soft); color: var(--warn-text); }
.result-received { background: var(--chip); color: var(--text-2); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: var(--toast); color: #FFFFFF; border-radius: 10px; padding: 10px 18px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 40;
}

/* Sign-in */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 100%; max-width: 400px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.login img { height: 48px; width: auto; align-self: center; }
.login h1 { margin: 0; font-size: 22px; text-align: center; }
.login { max-width: 440px; }
.step { display: flex; flex-direction: column; gap: 14px; }
.step[hidden] { display: none; }
.step-intro { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.5; }
.steps-list { margin: 0; padding-left: 20px; font-size: 14px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-box img { width: 220px; height: 220px; border-radius: 10px; background: #FFFFFF; padding: 6px; border: 1px solid var(--border); }
.qr-box summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--link); min-height: 44px; display: flex; align-items: center; }
.secret { display: block; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-family: ui-monospace, Menlo, monospace; font-size: 14px; letter-spacing: 0.05em; overflow-wrap: anywhere; text-align: center; }
.code-input { font-family: ui-monospace, Menlo, monospace; font-size: 20px; letter-spacing: 0.15em; text-align: center; }
.codes { margin: 0; padding: 12px 12px 12px 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; background: var(--surface-2); border-radius: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 15px; }
.btn-link { background: transparent; border-color: transparent; color: var(--link); font-weight: 600; }
.btn-link:hover { background: var(--surface-2); }

/* Tasks (task color: purple) */
:root, [data-theme="light"] { --task: #5B4BA0; --task-soft: #ECE9F7; }
[data-theme="dark"] { --task: #A99BE6; --task-soft: #26233A; }
.nav-count { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--task-soft); color: var(--task); font-size: 12px; font-weight: 700; text-align: center; }
.nav-count.alert { background: #B4531C; color: #FFFFFF; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--divider); }
.task:first-child { border-top: 0; }
.task-check { flex: none; width: 44px; height: 44px; margin: -6px 0 -6px -6px; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.task-check span { width: 24px; height: 24px; border: 2px solid var(--task); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-weight: 700; font-size: 15px; }
.task-check[aria-pressed="true"] span { background: var(--task); }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-title { font-size: 15px; overflow-wrap: anywhere; }
.task.is-done .task-title { text-decoration: line-through; color: var(--text-3); font-weight: 500; }
.task-notes { font-size: 13px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.task-meta { font-size: 13px; color: var(--text-3); }
.due-overdue { color: var(--danger); font-weight: 700; }
.due-today { color: var(--task); font-weight: 700; }
.task-actions { display: flex; gap: 2px; flex: none; }
.task-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--divider); }
.task-form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.task-form-row .field { flex: 1 1 180px; }
.task-form .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; }
.task-editing { list-style: none; padding: 10px 0; }
.toast-action { margin-left: 8px; min-height: 32px; padding: 0 12px; border: 1px solid rgba(255,255,255,0.6); border-radius: 8px; background: transparent; color: #FFFFFF; font: inherit; font-weight: 700; cursor: pointer; }
.task-list .empty { list-style: none; }

/* Dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px var(--shadow);
  padding: 14px 16px; min-height: 44px; display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none;
}
.tile:hover { border-color: var(--accent-border); background: var(--surface-2); color: var(--text); }
.tile .k { font-size: 13px; font-weight: 600; color: var(--text-2); }
.tile .v { font-size: 30px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--text-3); }
.tile.is-alert { border-left: 5px solid #B4531C; }
.tile.is-alert .s { color: var(--warn-text); font-weight: 700; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head a { font-size: 14px; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.dash-list, .status-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dash-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--divider); }
.dash-list li:first-child, .status-bars li:first-child { border-top: 0; }
.dash-list .main { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; }
.dash-list .main .lead-name { min-height: 32px; }
.dash-list .main .tag { align-self: flex-start; }
.dash-list .main .muted { font-size: 13px; }
.dash-list .side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dash-list .est { font-size: 12px; font-weight: 500; }
.status-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.status-label .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-bars li { border-top: 1px solid var(--divider); }
.status-bars a { display: grid; grid-template-columns: minmax(110px, 9em) 1fr 3em; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; border-radius: 8px; padding: 0 4px; }
.status-bars a:hover { background: var(--surface-2); }
.status-bars .label { font-size: 14px; font-weight: 600; }
.status-bars .bar { height: 12px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.status-bars .bar span { display: block; height: 100%; border-radius: 999px; }
.status-bars .n { font-size: 15px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.dash-grid .empty { padding: 28px 12px; list-style: none; }

/* Resources */
.res-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.res-folders { flex: 1 1 220px; max-width: 300px; padding: 8px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.res-folders ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.res-folders button { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.res-folders button:hover { background: var(--surface-2); }
.res-folders button[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.res-folders .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-folders .count { font-size: 12px; color: var(--text-3); }
.res-main { flex: 999 1 420px; min-width: 0; }
.res-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.res-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.res { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--divider); }
.res:first-child { border-top: 0; }
.res-icon { flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--divider); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-2); }
.res-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.res-title { font-weight: 700; font-size: 15px; text-decoration: none; overflow-wrap: anywhere; min-height: 24px; }
.res-title:hover { text-decoration: underline; }
.res-meta { font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.res-notes { font-size: 13px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.star { font-size: 18px; color: #B07A00; }
.folder-picks { border: 1px solid var(--divider); border-radius: 10px; padding: 10px 14px; margin: 0; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.folder-picks legend { font-size: 13px; font-weight: 700; color: var(--text-2); padding: 0 4px; }
@media (max-width: 760px) { .res-folders { max-width: none; position: static; max-height: 260px; } }

/* Collapsible cards on the lead record */
details.collapsible > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-height: 44px; align-content: center; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::before { content: '\25B8'; color: var(--text-3); font-size: 14px; }
details.collapsible[open] > summary::before { content: '\25BE'; }
details.collapsible > summary h2 { display: inline; }
details.collapsible > summary .muted { font-size: 13px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 14px; }
.edit-form { display: flex; flex-direction: column; gap: 14px; }
.edit-form fieldset { border: 1px solid var(--divider); border-radius: 12px; padding: 10px 14px 14px; margin: 0; }
.edit-form legend { font-size: 13px; font-weight: 700; color: var(--text-2); padding: 0 4px; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.reread-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.partner-leads ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }

/* Templates */
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl-preview { border: 1px solid var(--divider); border-radius: 12px; background: var(--surface-2); padding: 14px; display: flex; flex-direction: column; gap: 8px; align-self: start; }
.tpl-preview h3 { margin: 0; font-size: 13px; color: var(--text-2); }
.preview-subject { font-weight: 700; }
.preview-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }

/* Loans */
.stage-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.stage-chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.stage-chip .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.stage-chip .name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-2); }
.stage-chip .n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stage-inline { min-height: 38px; font-size: 13px; padding: 0 8px; width: auto; }

/* Calendar (appointment teal, task purple, loan date gold) */
:root, [data-theme="light"] { --cal: #1B7F86; --cal-soft: #DDF1F2; --loan: #8A6100; --loan-soft: #FBF0D6; }
[data-theme="dark"] { --cal: #7FD3D8; --cal-soft: #1C3133; --loan: #F0C46A; --loan-soft: #352B17; }
.cal-legend { margin: -6px 0 0; display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.cal-legend .ev { display: inline-block; width: auto; }
.cal { padding: 0; overflow: hidden; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day { border-left: 1px solid var(--divider); padding: 8px; min-height: 260px; display: flex; flex-direction: column; gap: 6px; }
.cal-day:first-child { border-left: 0; }
.cal-day.is-today { background: var(--accent-soft); }
.cal-day-head { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-day-head strong { font-size: 18px; color: var(--text); }
.cal-items { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cal-free { font-size: 12px; }
.cal-add { align-self: flex-start; padding-left: 0; }
.ev { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid; border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 12px; line-height: 1.3; text-decoration: none; cursor: pointer; overflow-wrap: anywhere; color: var(--text); }
.ev b { font-weight: 700; }
.ev-appt { background: var(--cal-soft); border-color: var(--cal); }
.ev-task { background: var(--task-soft); border-color: var(--task); }
.ev-task.done { opacity: 0.6; text-decoration: line-through; }
.ev-loan { background: var(--loan-soft); border-color: var(--loan); }
.who-tag { font-size: 11px; color: var(--text-3); }
.cal-month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--text-2); }
.cal-month-head span { padding: 6px 8px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { border-top: 1px solid var(--divider); border-left: 1px solid var(--divider); min-height: 108px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell:nth-child(7n+1) { border-left: 0; }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-date { color: var(--text-3); }
.cal-cell.is-today { background: var(--accent-soft); }
.cal-date { align-self: flex-start; min-width: 32px; min-height: 32px; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--text); border-radius: 8px; cursor: pointer; }
.cal-date:hover { background: var(--surface-2); }
.cal-more { border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 600; color: var(--link); text-align: left; cursor: pointer; padding: 2px 4px; }
@media (max-width: 900px) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-day { border-left: 0; border-top: 1px solid var(--divider); min-height: 0; }
  .cal-cell { min-height: 64px; }
  .cal-cell .ev { display: none; }
  .cal-cell .cal-more { display: none; }
}

.split-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .split-2 { grid-template-columns: 1fr; } }
.sub-h { margin: 0; font-size: 14px; color: var(--text-2); }
.confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--warn-text); }

/* Action buttons (call green, email orange, text blue, task purple, calendar teal, note gold) */
:root, [data-theme="light"] {
  --act-note: #9A6A00; --act-note-bg: #FBF0D6; --act-task: #5B4BA0; --act-task-bg: #ECE9F7; --act-calendar: #1B7F86; --act-calendar-bg: #DDF1F2;
  --act-email: #C2610C; --act-email-bg: #FCEBDD; --act-call: #1C7A43; --act-call-bg: #DDF2E5; --act-text: #0F6CB6; --act-text-bg: #E1EEFA;
}
[data-theme="dark"] {
  --act-note: #F0C46A; --act-note-bg: #352B17; --act-task: #A99BE6; --act-task-bg: #26233A; --act-calendar: #7FD3D8; --act-calendar-bg: #1C3133;
  --act-email: #F2A867; --act-email-bg: #3A2617; --act-call: #7FD9A2; --act-call-bg: #193325; --act-text: #8CC4F2; --act-text-bg: #172B3D;
}
.act-row { display: inline-flex; gap: 4px; }
.act { width: 36px; height: 36px; border: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.act:hover { filter: brightness(0.95); box-shadow: inset 0 0 0 2px currentColor; }
.act-note { background: var(--act-note-bg); color: var(--act-note); }
.act-task { background: var(--act-task-bg); color: var(--act-task); }
.act-calendar { background: var(--act-calendar-bg); color: var(--act-calendar); }
.act-email { background: var(--act-email-bg); color: var(--act-email); }
.act-call { background: var(--act-call-bg); color: var(--act-call); }
.act-text { background: var(--act-text-bg); color: var(--act-text); }
@media (pointer: coarse) { .act { width: 44px; height: 44px; } }
.btn-call { background: var(--act-call); border-color: var(--act-call); color: #FFFFFF; font-size: 16px; }
[data-theme="dark"] .btn-call { color: #0F141B; }
.call-outcome { border: 1px solid var(--divider); border-radius: 10px; padding: 6px 12px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
.call-outcome legend { font-size: 13px; font-weight: 700; color: var(--text-2); padding: 0 4px; }
.call-outcome .check { min-height: 40px; }

/* Lead record: big action buttons under the name, tabs */
.big-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; width: 100%; max-width: 260px; margin-top: 6px; }
.topbar nav { scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.big-act { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 0; }
.big-act .act { width: 44px; height: 44px; border-radius: 10px; pointer-events: none; }
.big-act .act svg { width: 22px; height: 22px; }
.lead-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--surface); border-radius: 14px 14px 0 0; padding: 0 8px; }
.lead-tabs button { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); padding: 0 12px; min-height: 48px; border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer; }
.lead-tabs button[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.lead-tabs button:hover { color: var(--text); }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.aside-notes { border-top: 1px solid var(--divider); padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.aside-notes h2 { margin: 0; font-size: 15px; }

/* Conversation */
.convo-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.convo-head h2 { margin: 0; }
.convo-acts { display: flex; gap: 8px; }
.pill-btn { min-height: 40px; padding: 0 16px; border-radius: 10px; border: 0; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.pb-text { background: var(--act-text-bg); color: var(--act-text); }
.pb-email { background: var(--act-email-bg); color: var(--act-email); }
.pb-call { background: var(--act-call-bg); color: var(--act-call); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.chip-text .dot { background: var(--act-text); } .chip-call .dot { background: var(--act-call); } .chip-email .dot { background: var(--act-email); } .chip-all .dot { background: var(--task); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.convo-day { margin: 14px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: 10px; }
.convo-day::after { content: ''; flex: 1; height: 1px; background: var(--divider); }
.convo-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.convo-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 8px 0; position: relative; }
.convo-item:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 46px; bottom: -6px; width: 2px; background: var(--divider); }
.convo-icon { width: 36px !important; height: 36px !important; border-radius: 50% !important; }
.convo-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.convo-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.convo-ch { font-weight: 700; }
.ci-text .convo-ch { color: var(--act-text); } .ci-call .convo-ch { color: var(--act-call); } .ci-email .convo-ch { color: var(--act-email); }
.convo-time { margin-left: auto; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.convo-meta { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.convo-bubble { max-width: 640px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.convo-bubble.is-in { background: var(--act-text-bg); }
.convo-by { font-size: 12px; color: var(--text-3); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; }
.convo-link { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px;
  background: var(--task-soft); color: var(--task); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.convo-link span:last-child { font-weight: 600; font-size: 13px; }
select.is-optout { border-color: var(--danger); color: var(--danger); font-weight: 600; }

/* Left-column Notes / Checklist tabs */
.aside-tabs { display: flex; border-bottom: 1px solid var(--border); margin: -4px 0 4px; }
.aside-tabs button { flex: 1; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); min-height: 44px; border-bottom: 3px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.aside-tabs button[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.aside-tabs .count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--chip); color: var(--text-2); }
.aside-tabs .count:empty { display: none; }
.check-progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); }
.check-progress .bar { flex: 1; height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.check-progress .bar span { display: block; height: 100%; background: var(--task); border-radius: 4px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.check-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; border-bottom: 1px solid var(--divider); }
.check-item .check { flex: 1 1 160px; font-weight: 500; color: var(--text); min-height: 40px; }
.check-item.is-done .check span { text-decoration: line-through; color: var(--text-3); }
.check-by { font-size: 11px; color: var(--text-3); }
.check-rm { font-size: 12px; }
.check-add { display: flex; gap: 6px; }
.check-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }

/* Reports (one series per chart, accent bars, labels always in text colors) */
.rep-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; }
.rep-grid > section { min-width: 0; }
.rep-wide { grid-column: 1 / -1; }
.rep-note { margin: -6px 0 0; font-size: 13px; }
.vbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; height: 220px; padding-top: 18px; }
.vcol { display: flex; flex-direction: column; align-items: stretch; height: 100%; min-width: 0; }
.vtrack { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border); }
.vbar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; position: relative; outline-offset: 2px; }
.vbar.zero { height: 0 !important; }
.vval { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 2px; font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; }
.vlab { font-size: 11px; color: var(--text-3); text-align: center; padding-top: 4px; }
.hchart { display: flex; flex-direction: column; gap: 8px; }
.hrow { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; border-radius: 6px; position: relative; }
.hlab { color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htrack { height: 14px; background: var(--chip); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hval { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; gap: 6px; align-items: baseline; }
.hval small { font-weight: 500; color: var(--text-3); font-size: 12px; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; z-index: 6; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--toast); color: #FFFFFF; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.hrow[data-tip]:hover::after, .hrow[data-tip]:focus-visible::after { left: auto; right: 0; transform: none; }
.rep-table summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--link); min-height: 36px; display: flex; align-items: center; }
@media (max-width: 500px) { .rep-grid { grid-template-columns: 1fr; } .vlab { font-size: 10px; } }

/* Top bar: grouped menu, search, alerts */
.topbar nav { overflow: visible; flex-wrap: wrap; }
.nav-group { position: relative; }
.nav-drop { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--text-2); padding: 12px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; min-height: 44px; }
.nav-drop.is-current { color: var(--accent-text); font-weight: 700; background: var(--accent-soft); }
.nav-drop:hover { color: var(--text); }
.nav-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 24px var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.nav-menu[hidden] { display: none; }
.topbar nav .nav-menu a { padding: 10px 12px; border-radius: 6px; }
.topbar nav .nav-menu a:hover { background: var(--surface-2); }
.topbar .right { flex-wrap: wrap; justify-content: flex-end; }
.gsearch { position: relative; width: 240px; }
.gsearch .input { min-height: 38px; }
.gs-results { position: absolute; top: calc(100% + 4px); right: 0; width: min(420px, calc(100vw - 32px)); z-index: 45; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 28px var(--shadow); padding: 6px; max-height: 70vh; overflow-y: auto; }
.gs-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); min-height: 44px; }
.gs-results a:hover, .gs-results a[aria-selected="true"] { background: var(--accent-soft); }
.gs-type { flex: none; width: 62px; font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.gs-main { display: flex; flex-direction: column; min-width: 0; }
.gs-main span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-empty { margin: 0; padding: 12px; font-size: 13px; color: var(--text-2); }
.bell-wrap { position: relative; }
.bell { position: relative; width: 44px; padding: 0; }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #B4531C; color: #FFFFFF; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bell-count[hidden] { display: none; }
.bell-panel { position: absolute; top: calc(100% + 6px); right: 0; width: min(380px, calc(100vw - 32px)); z-index: 45; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 28px var(--shadow); padding: 8px; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; border-bottom: 1px solid var(--divider); font-size: 14px; }
.bell-head .link-btn { font-size: 12px; }
#bell-list { list-style: none; margin: 0; padding: 4px 0 0; max-height: 60vh; overflow-y: auto; }
.alert-item a { display: flex; gap: 10px; padding: 8px; border-radius: 8px; text-decoration: none; color: var(--text); }
.alert-item a:hover { background: var(--surface-2); }
.alert-item a > span:last-child { display: flex; flex-direction: column; font-size: 13px; }
.alert-item a > span:last-child span { font-size: 12px; color: var(--text-3); }
.alert-item.is-seen { opacity: 0.6; }
.alert-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; background: var(--accent-soft); color: var(--accent-text); }
.lv-warn .alert-mark { background: var(--warn-soft); color: var(--warn-text); }
@media (max-width: 760px) { .gsearch { width: 100%; order: 10; flex: 1 1 100%; } }

/* Leads toolbar pop-ups (Columns, Saved views) and inline assign */
.tool-pop { position: relative; }
.pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 24px var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pop[hidden] { display: none; }
.pop ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.pop .check { min-height: 36px; }
.assign-inline { min-height: 36px; width: auto; min-width: 104px; font-size: 13px; padding: 0 8px; }
/* Leads list: compact rows, everything on one line (Andrew, Oct 26, 2026) */
#leads-table td, #leads-table th { padding-left: 8px; padding-right: 8px; }
#leads-table td { padding-top: 6px; padding-bottom: 6px; white-space: nowrap; }
#leads-table .act-row { gap: 3px; }
#leads-table .act { width: 30px; height: 30px; border-radius: 7px; }
#leads-table .act svg { width: 16px; height: 16px; }
@media (pointer: coarse) { #leads-table .act { width: 34px; height: 34px; } }
#leads-table .status-pill { padding-left: 9px; gap: 5px; }
#leads-table .status-pill select { min-height: 30px; width: 116px; font-size: 13px; text-overflow: ellipsis; }
#leads-table .lead-name { white-space: nowrap; min-height: 30px; display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; line-height: 30px; }
#leads-table td .tag { font-size: 11px; padding: 2px 7px; vertical-align: 1px; }
#leads-table td[data-col="email"] { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
#leads-table .amount { font-size: 15px; }
#leads-table .assign-inline { min-height: 30px; min-width: 96px; border-radius: 8px; }
#leads-table .when-ago { font-size: 12px; margin-left: 6px; }

.dupe-box { display: flex; flex-direction: column; gap: 8px; }
.dupe-row { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.dupe-row a { color: inherit; font-weight: 700; }

/* Select several leads */
.sel-col { width: 44px; text-align: center; }
.sel { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
table.leads tbody tr.is-selected { background: var(--accent-soft); }
.bulk-bar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px;
  border-radius: 12px; background: var(--navy); color: #FFFFFF; box-shadow: 0 6px 18px rgba(15,76,129,0.25); }
.bulk-bar .field { color: #D6E6F5; font-size: 13px; }
.bulk-bar .btn-link { color: #FFFFFF; }
.bulk-bar .btn-link:hover { background: rgba(255,255,255,0.12); }

/* Quick actions side panel */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 35, 0.35); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0,0,0,0.18); z-index: 31; display: flex; flex-direction: column; overflow: hidden; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--navy); color: #FFFFFF; }
.drawer-head h2 { flex: 1; margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.drawer-head .btn { background: #FFFFFF; border-color: #FFFFFF; color: var(--navy); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 12px; }
.qa-contact { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.qa-sub { margin: -6px 0 0; font-size: 13px; }
.qa-tabs { align-self: stretch; }
.qa-tabs button { flex: 1; justify-content: center; }
.qa-h { margin: 6px 0 0; font-size: 14px; color: var(--text-2); }
.qa-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qa-activity li { display: flex; flex-direction: column; font-size: 14px; border-left: 3px solid var(--border); padding-left: 10px; }
.qa-activity li span { font-size: 12px; color: var(--text-3); }
body.drawer-open { overflow: hidden; }
/* Panel slides in from the right and back out; the backdrop fades. */
.drawer { animation: drawer-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.drawer.is-closing { animation: drawer-out 200ms ease-in both; }
.drawer-backdrop { animation: fade-in 200ms ease both; }
.drawer-backdrop.is-closing { animation: fade-out 200ms ease both; }
.drawer-body { animation: fade-in 180ms ease both; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawer-out { from { transform: none; } to { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Gentle loading: lists fade up when their data replaces the loading bars (BHS.fill). */
.reveal > * { animation: rise-in 260ms ease both; }
.reveal > *:nth-child(2) { animation-delay: 20ms; } .reveal > *:nth-child(3) { animation-delay: 40ms; }
.reveal > *:nth-child(4) { animation-delay: 60ms; } .reveal > *:nth-child(5) { animation-delay: 80ms; }
.reveal > *:nth-child(n+6) { animation-delay: 100ms; }
@keyframes rise-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Fade between pages (Chrome, Edge, Safari; other browsers switch instantly). The top bar stays put. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: ease; }
  .topbar { view-transition-name: topbar; }
  ::view-transition-group(topbar), ::view-transition-old(topbar), ::view-transition-new(topbar) { animation-duration: 0s; }
}

/* Settings sub-menu */
.subnav { display: flex; gap: 4px; padding: 4px; background: var(--seg); border-radius: 12px; align-self: flex-start; flex-wrap: wrap; }
.subnav a { min-height: 40px; padding: 0 14px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; display: flex; align-items: center; }
.subnav a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px var(--shadow); }

/* Your account */
.row-list { display: flex; flex-direction: column; }
.row-list > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--divider); }
.row-list > div:first-child { border-top: 0; padding-top: 0; }
.row-list .main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-list .main strong { font-size: 15px; }
.row-list .main span { font-size: 13px; color: var(--text-2); }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok-text); }
.pill-warn { background: var(--warn-soft); color: var(--warn-text); }
.pill-plain { background: var(--chip); color: var(--text-2); }
.inline-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--divider); max-width: 480px; }
.inline-form[hidden] { display: none; }
.inline-form .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 180px; }

/* ---------- Call next (Oct 26, 2026) ---------- */
.band-views { background: rgba(255,255,255,0.14); }
.band-views button { color: #FFFFFF; }
.band-views button[aria-pressed="true"] { color: var(--navy); }
.queue-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .queue-grid { grid-template-columns: 1fr; } }
.queue-side { display: flex; flex-direction: column; gap: 16px; }
.call-card { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; border-top: 5px solid var(--act-call); }
.call-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.q-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--text-2); white-space: nowrap; }
.q-chip.new { background: var(--warn-soft); color: var(--warn-text); }
.q-chip.cb { background: var(--accent-soft); color: var(--accent-text); }
.call-wait.is-new { color: var(--warn-text); }
.call-local.warn { color: var(--danger); }
.call-name { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.call-name a { color: inherit; text-decoration: none; }
.call-name a:hover { text-decoration: underline; }
.call-facts { margin: -8px 0 0; color: var(--text-2); font-size: 15px; }
.call-dial { min-height: 56px; font-size: 19px; align-self: flex-start; padding: 0 26px; border-radius: 12px; }
.call-last { margin: 0; font-size: 14px; color: var(--text-2); }
.outcomes { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.outcomes legend { font-size: 14px; font-weight: 700; margin-bottom: 8px; padding: 0; }
.outcomes legend .muted { font-weight: 500; }
.outcome { text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 72px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s; }
.outcome:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.outcome:active { transform: scale(0.99); }
.outcome[disabled] { opacity: .55; cursor: wait; }
.o-label { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.o-next { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.outcome-talked { border-left: 5px solid var(--act-call); }
.outcome-voicemail, .outcome-noanswer { border-left: 5px solid #A86E12; }
.outcome-wrong { border-left: 5px solid var(--text-3); }
kbd { font: inherit; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.call-extra { display: grid; grid-template-columns: 1fr 140px; gap: 10px; }
@media (max-width: 600px) { .outcomes, .call-extra { grid-template-columns: 1fr; } }
.callback-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cb-label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.callback-row .chip { min-height: 36px; }
.cb-pick { padding: 0 6px; }
.cb-pick input { border: 0; background: transparent; font: inherit; color: var(--text); min-height: 34px; }
.cb-set { font-size: 13px; font-weight: 700; color: var(--accent-text); }
.call-foot { display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--divider); padding-top: 12px; }
.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.q-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; text-align: left; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--divider); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.q-row:hover { border-color: var(--accent); background: var(--surface-2); }
.q-name { font-weight: 700; font-size: 14px; }
.q-when { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); }
.q-warn { color: var(--danger); font-weight: 600; }
.q-empty { font-size: 13px; padding: 4px 2px; }
.q-fin { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-top: 1px solid var(--divider); }
.q-fin:first-child { border-top: 0; }
.q-fin > div:first-child { display: flex; flex-direction: column; }
.q-done { text-align: center; padding: 40px 10px; }
.q-done h2 { margin: 8px 0 4px; }
.q-done-mark { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: var(--ok-soft); color: var(--ok-text); font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.plan-box h2 { margin: 0; font-size: 16px; }
.plan-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.plan-steps strong { margin-right: 4px; }
.call-next-line { margin: 0; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--text); }
.tile-calls .v { color: var(--act-call); }

/* ---------- Rate indices on the Dashboard ---------- */
.rates-frame { border-radius: 10px; border: 1px solid var(--divider); background: #FFFFFF; overflow: hidden; }
.rates-frame iframe { display: block; border: 0; width: 100%; height: 462px; }

/* ---------- Refinance radar ---------- */
.radar-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.radar-form .field { flex: 1 1 170px; }
.input-affix { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); overflow: hidden; }
.input-affix:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.input-affix .input { border: 0; min-width: 0; flex: 1; outline: none; }
.input-affix > span { padding: 0 10px; color: var(--text-3); font-size: 13px; font-weight: 600; white-space: nowrap; }
.radar-table { min-width: 900px; }
.radar-table td { white-space: nowrap; }
.save { color: var(--ok-text); font-size: 15px; }

/* ---------- Past clients ---------- */
.clients-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .clients-grid { grid-template-columns: 1fr; } }
.touch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.touch { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--divider); flex-wrap: wrap; }
.touch:first-child { border-top: 0; }
.touch-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--act-calendar-bg); flex: none; }
.touch-icon.birthday { background: var(--act-note-bg); }
.touch-main { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.touch.is-late .touch-icon { box-shadow: inset 0 0 0 2px var(--danger); }
.clients-table { min-width: 1000px; }
.bday { width: 100px; min-height: 36px; }
.input.is-invalid { border-color: var(--danger); }

/* ---------- Campaigns (Oct 26, 2026) ---------- */
.notice-info { background: var(--accent-soft); color: var(--text); font-weight: 500; border: 1px solid var(--accent-border); margin: 0; }
.count-pill { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #B4531C; color: #FFFFFF; vertical-align: 2px; }
.count-pill[hidden] { display: none; }
.ch-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ch-text { background: var(--act-text-bg); color: var(--act-text); }
.ch-email { background: var(--act-email-bg); color: var(--act-email); }
.st-chip { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--chip); color: var(--text-2); }
.st-active { background: var(--ok-soft); color: var(--ok-text); }
.st-paused { background: var(--warn-soft); color: var(--warn-text); }
.st-stopped { background: var(--chip); color: var(--text-3); }
.st-finished { background: var(--accent-soft); color: var(--accent-text); }
.starter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.starter { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.starter p { margin: 0; font-size: 14px; flex: 1; }
.starter .btn { align-self: flex-start; }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.camp-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.camp-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.camp-card p { margin: 0; font-size: 13px; }
.camp-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 16px; }
.camp-len { font-size: 13px; font-weight: 600; color: var(--text-2); }
.camp-people { font-size: 12px; color: var(--text-3); }
.outbox { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ob-item { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ob-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.ob-head .muted { font-size: 12px; }
.ob-to, .ob-subject { font-size: 13px; font-weight: 600; color: var(--text-2); }
.ob-body { margin: 0; white-space: pre-wrap; font: inherit; font-size: 14px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; max-height: 220px; overflow: auto; }
.back-link { font-size: 14px; font-weight: 600; align-self: flex-start; }
.camp-head { gap: 10px; }
.camp-name-row { display: flex; gap: 10px; align-items: center; }
.camp-name { font-size: 20px; font-weight: 700; flex: 1; }
.camp-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.camp-status-text { margin: 0; font-size: 14px; font-weight: 600; flex: 1 1 300px; }
.st-text-active { color: var(--ok-text); } .st-text-paused { color: var(--warn-text); } .st-text-draft { color: var(--text-2); }
.builder-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .builder-grid { grid-template-columns: 1fr; } }
.builder-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 12px; }
@media (max-width: 980px) { .builder-side { position: static; } }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step-card { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.step-rail { display: flex; flex-direction: column; align-items: center; }
.step-rail::after { content: ''; flex: 1; width: 2px; background: var(--divider); margin-top: 4px; }
.step-card:last-child .step-rail::after { display: none; }
.step-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; flex: none; }
.step-dot.ch-text { background: var(--act-text); } .step-dot.ch-email { background: var(--act-email); }
.step-main { padding-bottom: 16px; min-width: 0; }
.step-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.step-top .btn-link { margin-left: auto; min-height: 32px; }
.step-subject { font-weight: 700; font-size: 14px; margin-top: 4px; }
.step-body { margin: 4px 0 0; font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.step-card.is-editing .step-main { border: 1px solid var(--accent-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--surface); }
.step-form { display: flex; flex-direction: column; gap: 10px; }
.step-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.seg-field { border: 0; padding: 0; margin: 0; }
.seg-field legend { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; padding: 0; }
.seg-radio { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg-radio:has(input:checked) { background: var(--surface); box-shadow: 0 1px 3px var(--shadow); }
.step-when { margin: 0; font-size: 13px; font-weight: 700; color: var(--accent-text); }
.fill-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fill-chip { min-height: 30px; padding: 0 10px; font-size: 12px; }
.step-preview pre { margin: 4px 0; white-space: pre-wrap; font: inherit; font-size: 14px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.what-box h2 { margin: 0; font-size: 17px; }
.what-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.what-steps li::marker { font-weight: 700; color: var(--text-3); }
.what-h { margin: 6px 0 0; font-size: 14px; color: var(--text-2); }
.what-stops, .what-rules { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.stop-edit summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--link); min-height: 32px; display: flex; align-items: center; }
.stop-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.stop-checks .check { min-height: 34px; font-size: 13px; }
.prev-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.prev-card { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--divider); padding-top: 10px; }
.prev-sends { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.prev-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.prev-skip { font-size: 13px; font-weight: 600; color: var(--warn-text); }
.prev-sends .is-skip .prev-when strong { text-decoration: line-through; color: var(--text-3); }
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.person { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--divider); }
.person:first-child { border-top: 0; }
.person-line { display: block; font-size: 13px; margin-top: 2px; }
.danger-row { display: flex; justify-content: flex-end; }
.lead-camp { display: flex; flex-direction: column; gap: 6px; }
.lead-camp-item { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.lead-camp-sends { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.lead-camp-sends .is-sent { color: var(--ok-text); } .lead-camp-sends .is-skip { color: var(--text-3); text-decoration: line-through; }
.bulk-confirm { margin-top: -6px; }

/* ---------- Phone layout and Home Screen app (Oct 26, 2026) ---------- */
.ok-text { color: var(--ok-text); }
.tabbar, .more-sheet { display: none; }
@media (max-width: 700px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .topbar { padding: 8px 14px; gap: 8px; min-height: 0; }
  .topbar .logo img { height: 30px; }
  .topbar nav[aria-label="Main"], #theme-btn, #signout-btn, .topbar .who { display: none !important; }
  .topbar .right { flex: 1; flex-wrap: nowrap; }
  .gsearch { order: 0; width: auto; flex: 1 1 auto; }
  .page { padding: 14px 12px 32px; gap: 12px; }
  .band { padding: 16px; border-radius: 14px; }
  .band h1 { font-size: 22px; }
  .band p { font-size: 14px; }
  .band .actions { margin-left: 0; width: 100%; }
  .section { padding: 14px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--border);
    padding: 4px 4px env(safe-area-inset-bottom); box-shadow: 0 -2px 12px var(--shadow); }
  .tabbar a, .tabbar button { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative;
    color: var(--text-3); text-decoration: none; font: inherit; font-size: 11px; font-weight: 600; background: none; border: 0; cursor: pointer; border-radius: 10px; }
  .tabbar [aria-current="page"], .tabbar [aria-expanded="true"] { color: var(--accent-text); }
  .tabbar [aria-current="page"] svg { stroke-width: 2.3; }
  .tab-count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #B4531C; color: #FFFFFF;
    font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
  .more-sheet { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(10, 20, 35, 0.35); animation: fade-in 160ms ease both; }
  .more-sheet[hidden] { display: none; }
  .more-inner { position: absolute; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 18px 18px 0 0;
    padding: 16px 14px; box-shadow: 0 -8px 24px rgba(0,0,0,0.18); animation: sheet-up 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  @keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .more-grid a { min-height: 48px; display: flex; align-items: center; padding: 0 14px; border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
  .more-grid a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
  .more-actions { display: flex; gap: 8px; margin-top: 12px; }
  .more-actions .btn { flex: 1; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }

  /* Leads list: each lead is a card instead of a wide row. */
  .table-wrap:has(#leads-table) { max-height: none; overflow: visible; }
  #leads-table { min-width: 0; }
  #leads-table thead { display: none; }
  #leads-table tbody { display: flex; flex-direction: column; gap: 8px; }
  #leads-table tbody tr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "sel name amount" "sel status received" "sel phone phone" "acts acts acts";
    gap: 4px 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--divider); border-radius: 12px; background: var(--surface); }
  #leads-table tbody td { padding: 0 !important; border: 0; }
  #leads-table td:nth-child(1) { grid-area: sel; align-self: start; padding-top: 6px !important; }
  #leads-table td:nth-child(2) { grid-area: acts; padding-top: 6px !important; }
  #leads-table td:nth-child(3) { grid-area: status; }
  #leads-table td:nth-child(4) { grid-area: name; }
  #leads-table td[data-col="phone"] { grid-area: phone; }
  #leads-table td[data-col="amount"] { grid-area: amount; }
  #leads-table td[data-col="received"] { grid-area: received; text-align: right; font-size: 13px; }
  #leads-table td[data-col="email"], #leads-table td[data-col="type"], #leads-table td[data-col="working"], #leads-table td[data-col="source"] { display: none !important; }
  #leads-table .lead-name { max-width: 100%; font-size: 16px; }
  #leads-table .act-row { display: flex; justify-content: space-between; gap: 6px; }
  #leads-table .act { width: auto; flex: 1; height: 40px; }
  #leads-table tbody tr td[colspan] { grid-column: 1 / -1; }
  .toolbar { gap: 8px; }
  .views { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .views button { white-space: nowrap; }
  .bulk-bar { top: auto; bottom: calc(72px + env(safe-area-inset-bottom)); position: sticky; }
  .call-name { font-size: 24px; }
  .call-dial { align-self: stretch; }
}
/* Installed app: a little room at the top for the status bar. */
html.is-app .topbar { padding-top: max(8px, env(safe-area-inset-top)); }
@media (max-width: 700px) { #leads-table tbody tr td:nth-child(n+5):not([data-col]):not([colspan]) { display: none; } }
@media (max-width: 700px) { .toolbar label:has(> select) { flex: 1 1 40%; min-width: 0; } .toolbar label:has(> select) select { width: 100%; } .toolbar .tool-pop { display: none; } .toolbar .check { min-height: 36px; font-size: 13px; } .views[aria-label="Whose leads"] { margin-left: 0 !important; } }

/* ---------- Quick actions command bar (Ctrl+K), both styles ---------- */
.cmdk { position: fixed; inset: 0; z-index: 80; background: rgba(10, 14, 22, 0.32); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade-in 120ms ease both; }
.cmdk[hidden] { display: none; }
.cmdk-box { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.25); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; animation: rise-in 160ms ease both; }
.cmdk-input { border: 0; border-bottom: 1px solid var(--divider); padding: 16px 18px; font: inherit; font-size: 16px; color: var(--text); background: transparent; outline: none; }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 10px 4px; }
.cmdk-row { width: 100%; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.cmdk-row[aria-selected="true"], .cmdk-row:hover { background: var(--surface-2); }
.cmdk-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.cmdk-empty { padding: 18px; margin: 0; color: var(--text-3); font-size: 14px; }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--divider); font-size: 12px; color: var(--text-3); }
.cmdk-foot kbd { margin-right: 2px; }

/* ---------- Fox style (Andrew): sidebar, neutral grays, Inter ---------- */
html[data-style="fox"] {
  --page: #FFFFFF; --surface: #FFFFFF; --surface-2: #F6F6F7; --chip: #EFEFF1; --seg: #F1F1F3;
  --border: #E7E7EA; --border-strong: #D9D9DE; --divider: #F0F0F2; --shadow: rgba(0,0,0,0.05);
  --text: #18181B; --text-2: #52525B; --text-3: #71717A; --navy: #18181B; --navy-text: #A1A1AA;
  --accent: #2563EB; --accent-soft: #EEF3FE; --accent-border: #BFD2FA; --accent-text: #1D4ED8; --link: #1D4ED8;
  --side: #FAFAFA; --side-hover: #EFEFF1; --side-active: #E9E9EC;
}
html[data-style="fox"][data-theme="dark"] {
  --page: #0F0F11; --surface: #151517; --surface-2: #1C1C1F; --chip: #232327; --seg: #1C1C1F;
  --border: #29292E; --border-strong: #34343A; --divider: #212125; --shadow: rgba(0,0,0,0.4);
  --text: #EDEDEF; --text-2: #A1A1AA; --text-3: #8B8B94; --navy: #232327; --navy-text: #A1A1AA;
  --accent: #5B8DEF; --accent-soft: #1A2338; --accent-border: #2E4472; --accent-text: #8FB2F5; --link: #8FB2F5;
  --side: #111113; --side-hover: #1C1C1F; --side-active: #232327;
}
html[data-style="fox"] body { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; letter-spacing: -0.006em; background: var(--page); }
html[data-style="fox"] .btn { border-radius: 8px; font-weight: 500; box-shadow: 0 1px 1px var(--shadow); }
html[data-style="fox"] .btn-primary { background: var(--text); border-color: var(--text); color: var(--surface); }
html[data-style="fox"] .btn-primary:hover { filter: none; opacity: .88; }
html[data-style="fox"] .card { border-radius: 12px; box-shadow: none; }
html[data-style="fox"] .input { border-radius: 8px; }
/* Page headers: plain, not a navy band. */
html[data-style="fox"] .band { background: transparent; color: var(--text); box-shadow: none; border-radius: 0; padding: 4px 0 16px; border-bottom: 1px solid var(--divider); }
html[data-style="fox"] .band h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
html[data-style="fox"] .band p { color: var(--text-3); font-size: 14px; }
html[data-style="fox"] .band .btn, html[data-style="fox"] .band .btn.btn-report { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
html[data-style="fox"] .band-views { background: var(--seg); }
html[data-style="fox"] .band-views button { color: var(--text-2); }
html[data-style="fox"] .band-views button[aria-pressed="true"] { color: var(--text); }
html[data-style="fox"] .drawer-head .btn { background: transparent; border-color: rgba(255,255,255,0.3); color: #FFFFFF; }
html[data-style="fox"] .call-card { border-top-width: 3px; }

/* The sidebar (wide screens only; phones keep the bottom tabs). */
.fox-side { display: none; }
@media (min-width: 900px) {
  html.has-side .topbar { display: none; }
  html.has-side body { padding-left: 276px; }
  html.has-side.side-collapsed body { padding-left: 64px; }
  .fox-side { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: 276px; z-index: 40; background: var(--side);
    border-right: 1px solid var(--border); padding: 10px 10px 12px; gap: 8px; overflow-y: auto; overflow-x: hidden; view-transition-name: sidebar; }
  html.side-collapsed .fox-side { width: 64px; }
  /* Collapsed: labels fade out and section titles and search fold away, so the slide stays smooth. */
  html.side-collapsed .fox-side .fs-label, html.side-collapsed .fs-chev, html.side-collapsed .fs-muted, html.side-collapsed .fs-kbd { opacity: 0; pointer-events: none; }
  .fs-head, .fs-search { max-height: 48px; }
  html.side-collapsed .fs-head, html.side-collapsed .fs-search { max-height: 0; min-height: 0; opacity: 0; overflow: hidden; pointer-events: none; }
  html.side-collapsed .fs-section { margin-top: 6px; }
  /* The slide itself (only after the page has loaded, so a collapsed sidebar doesn't animate on every page). */
  html.side-anim .fox-side { transition: width 260ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  html.side-anim.has-side body { transition: padding-left 260ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  html.side-anim .fs-label, html.side-anim .fs-chev, html.side-anim .fs-muted, html.side-anim .fs-kbd { transition: opacity 140ms ease; }
  html.side-anim:not(.side-collapsed) .fs-label, html.side-anim:not(.side-collapsed) .fs-chev, html.side-anim:not(.side-collapsed) .fs-muted, html.side-anim:not(.side-collapsed) .fs-kbd { transition-delay: 110ms; }
  html.side-anim .fs-head, html.side-anim .fs-search { transition: max-height 260ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 160ms ease, margin 260ms ease; }
  html.side-anim .fs-section { transition: margin-top 260ms ease; }
  html.side-collapsed .fs-gbody[hidden] { display: block !important; }
  html.side-collapsed .fs-top { flex-direction: column; }
}
::view-transition-group(sidebar), ::view-transition-old(sidebar), ::view-transition-new(sidebar) { animation-duration: 0s; }
.fs-top { display: flex; align-items: center; gap: 4px; position: relative; }
.fs-ws { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.fs-ws img { border-radius: 7px; flex: none; }
.fs-ws .fs-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-ws:hover, .fs-collapse:hover { background: var(--side-hover); }
.fs-collapse { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; }
.fs-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px var(--shadow); padding: 5px; display: flex; flex-direction: column; }
.fs-menu[hidden] { display: none; }
.fs-menu a, .fs-menu button { min-height: 36px; display: flex; align-items: center; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; text-align: left; }
.fs-menu a:hover, .fs-menu button:hover { background: var(--surface-2); }
.fs-row { display: flex; gap: 6px; }
.fs-qa { flex: 1; display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: 0 1px 1px var(--shadow); }
.fs-qa kbd { margin-left: auto; }
.fs-qa:hover { background: var(--surface-2); }
.fs-search .gsearch { width: 100%; }
.fs-search .gsearch .input { min-height: 36px; font-size: 13px; background: var(--surface); }
.fs-search .gs-results { width: 420px; }
.fs-nav { display: flex; flex-direction: column; gap: 1px; }
.fs-item { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500;
  border: 0; background: none; font-family: inherit; cursor: pointer; width: 100%; text-align: left; position: relative; box-shadow: none; }
.fs-item:hover { background: var(--side-hover); }
.fs-item[aria-current="page"] { background: var(--side-active); font-weight: 600; }
.fs-ic { flex: none; color: var(--text-2); }
.fs-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-muted { color: var(--text-3); font-weight: 400; margin-left: 4px; }
.fs-item .tab-count { position: static; margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #E8590C; color: #FFFFFF; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
html.side-collapsed .fs-item .tab-count { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.fs-box { width: 18px; height: 18px; border-radius: 5px; color: #FFFFFF; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.fs-chev { flex: none; color: var(--text-3); transition: transform .15s; }
.fs-gbtn[aria-expanded="false"] .fs-chev, .fs-head[aria-expanded="false"] .fs-chev { transform: rotate(-90deg); }
.fs-sub .fs-gbody { margin-left: 18px; padding-left: 8px; border-left: 1px solid var(--border); }
html.side-collapsed .fs-sub .fs-gbody { margin-left: 0; padding-left: 0; border-left: 0; }
.fs-section { margin-top: 10px; }
.fs-head { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 8px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.fs-head:hover { color: var(--text); }
.fs-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--divider); }
/* Notifications row (the alerts bell, in the sidebar). */
.fs-nav .bell-wrap { position: relative; }
.fs-nav .bell.fs-item { width: 100%; height: auto; min-height: 34px; justify-content: flex-start; padding: 0 10px; border: 0; background: none; }
.fs-nav .bell.fs-item:hover { background: var(--side-hover); }
.fs-nav .bell.fs-item svg { color: var(--text-2); }
.fs-nav .bell-count { position: static; margin-left: auto; }
html.side-collapsed .fs-nav .bell-count { position: absolute; top: 2px; right: 4px; }
.fs-nav .bell-panel { position: fixed; top: 60px; left: 286px; right: auto; }
html.side-collapsed .fs-nav .bell-panel { left: 74px; }
.style-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.style-opt { border: 2px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; background: var(--surface); font: inherit; color: var(--text); text-align: left; }
.style-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.style-opt strong { font-size: 15px; }
.style-opt span { font-size: 13px; color: var(--text-2); }
.style-thumb { height: 64px; border-radius: 8px; border: 1px solid var(--border); display: flex; overflow: hidden; }
.style-thumb.classic { flex-direction: column; } .style-thumb.classic i:first-child { height: 14px; background: #FFFFFF; border-bottom: 3px solid #0F6CB6; } .style-thumb.classic i:last-child { flex: 1; background: #E6EFF8; position: relative; }
.style-thumb.classic i:last-child::after { content: ''; position: absolute; left: 8px; right: 8px; top: 8px; height: 14px; border-radius: 4px; background: #0F4C81; }
.style-thumb.fox i:first-child { width: 30%; background: #F4F4F5; border-right: 1px solid #E4E4E7; } .style-thumb.fox i:last-child { flex: 1; background: #FFFFFF; position: relative; }
.style-thumb.fox i:last-child::after { content: ''; position: absolute; left: 8px; width: 50%; top: 10px; height: 6px; border-radius: 3px; background: #18181B; }

.fs-kbd { margin-left: auto; flex: none; }

.fs-qa { text-align: left; }
.fs-collapse { width: 32px; height: 32px; }
/* Fox: a slimmer Leads table so it fits next to the sidebar. */
@media (min-width: 900px) {
  html.has-side #leads-table .act { width: 26px; height: 26px; }
  html.has-side #leads-table .act svg { width: 14px; height: 14px; }
  html.has-side #leads-table .status-pill select { width: 104px; }
  html.has-side #leads-table .lead-name { max-width: 160px; }
  html.has-side #leads-table td[data-col="email"] { max-width: 170px; }
  html.has-side #leads-table td[data-col="type"] .tag { max-width: 130px; display: inline-block; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
  html.has-side #leads-table .assign-inline { min-width: 88px; }
}.fs-ws { gap: 7px; padding: 4px 6px; letter-spacing: -0.01em; }

/* Fox collapsed fixes: keep the logo, and open the company menu at full width beside the rail. */
html.side-collapsed .fs-ws { flex: none; justify-content: center; padding: 4px; }
html.side-collapsed .fs-ws .fs-label, html.side-collapsed .fs-ws .fs-chev { display: none; }
.fs-menu { position: fixed; top: 54px; left: 10px; right: auto; width: 256px; z-index: 60; }
html.side-collapsed .fs-menu { top: 10px; left: 72px; width: 220px; }

/* Campaign builder: flowchart view of the steps (both styles; colors come from the theme variables). */
.step-view-seg { margin-left: auto; }
.flow-lead { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.flow-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 16px; align-items: stretch; }
.flow-line { display: flex; flex-direction: column; min-width: 0; }
.flow-node { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.flow-node:hover { border-color: var(--accent); box-shadow: 0 1px 4px var(--shadow); }
button.flow-node:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.flow-node.is-cap { cursor: default; background: var(--surface-2); border-style: solid; }
.flow-node.is-skip { border-style: dashed; background: var(--surface-2); }
.flow-node.is-skip .flow-ic { opacity: .55; }
.flow-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.flow-ic-cap { background: var(--chip); color: var(--text-2); }
.flow-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.flow-t1 { font-weight: 700; font-size: 14px; }
.flow-t2 { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.flow-skip { font-size: 13px; font-weight: 600; color: var(--warn-text); }
.flow-edit { font-size: 13px; font-weight: 600; color: var(--link); flex: none; }
.flow-wire { position: relative; display: flex; align-items: center; gap: 8px; margin-left: 28px; padding: 10px 0 10px 18px; border-left: 2px solid var(--divider); min-height: 44px; }
.flow-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); background: var(--chip); border-radius: 999px; padding: 4px 10px; }
.flow-add { width: 30px; height: 30px; border-radius: 50%; border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 18px; line-height: 1;
  cursor: pointer; opacity: .55; transition: opacity .15s; position: relative; }
.flow-add::before { content: ''; position: absolute; inset: -7px; } /* 44px touch target */
.flow-wire:hover .flow-add, .flow-add:focus-visible { opacity: 1; }
.flow-add:hover { border-color: var(--accent); color: var(--accent-text); }
.flow-form { margin: 4px 0 8px; }
.flow-form .step-card { grid-template-columns: 1fr; }
.flow-form .step-rail { display: none; }
.flow-form .step-card.is-editing .step-main { margin-bottom: 0; }
.flow-exits { border-left: 2px dashed var(--danger); padding: 4px 0 4px 14px; font-size: 13px; color: var(--text-2); }
.flow-exits-h { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-weight: 700; color: var(--danger); font-size: 14px; }
.flow-exits ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.flow-exits-note { margin: 10px 0 0; color: var(--text-3); font-size: 12px; }
@media (max-width: 700px) {
  .flow-wrap { grid-template-columns: 1fr; }
  .flow-exits { border-left: 0; border-top: 2px dashed var(--danger); padding: 12px 0 0; }
  .flow-wire { margin-left: 22px; }
  .flow-add { opacity: 1; }
  .step-view-seg { margin-left: 0; }
}
@media (hover: none) { .flow-add { opacity: 1; } }
.card-head:has(.step-view-seg) { flex-wrap: wrap; }

/* Make a PDF (/pdf) */
.pdf-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 20px; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.pdf-drop:hover, .pdf-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.pdf-drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.pdf-drop-big { font-size: 18px; font-weight: 700; color: var(--accent-text); }
.pdf-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pdf-page { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); flex-wrap: wrap; }
.pdf-thumb { width: 64px; height: 64px; flex: none; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.pdf-thumb img { max-width: 100%; max-height: 100%; transition: transform .2s; }
.pdf-thumb-doc { font-size: 13px; font-weight: 700; color: var(--danger); }
.pdf-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; font-size: 14px; }
.pdf-info .muted { font-size: 13px; overflow-wrap: anywhere; }
.pdf-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pdf-btns .btn { min-height: 44px; min-width: 44px; }
.pdf-options { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin: 16px 0 8px; }
.pdf-options .field { flex: 1 1 220px; }
@media (max-width: 700px) { .pdf-btns { width: 100%; padding-left: 76px; } }

/* ----- Clear Quote (lead record) ----- */
.quote-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.quote-pick { min-width: 220px; }
.quote-form { display: flex; flex-direction: column; gap: 14px; }
.quote-opts { display: grid; grid-template-columns: repeat(var(--q-cols, 1), minmax(0, 1fr)); gap: 12px; }
.q-opt { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); min-width: 0; }
.q-opt-head { display: flex; align-items: center; gap: 8px; }
.q-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.q-label { font-weight: 600; }
.q-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.q-fields .field { font-size: 13px; }
.q-res { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.q-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.q-total span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.q-total strong { font-size: 26px; margin-left: auto; }
.q-total small { width: 100%; text-align: right; color: var(--text-3); font-size: 12px; }
.q-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.q-badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.q-badge::before { content: "★ "; }
.q-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); }
.q-line strong { color: var(--text); font-weight: 600; text-align: right; }
.q-line small { font-weight: 400; color: var(--text-3); }
.q-line.q-strong { font-size: 14px; color: var(--text); font-weight: 600; border-top: 1px dashed var(--border); padding-top: 4px; margin-top: 2px; }
.q-warn { color: var(--danger, #C92A2A) !important; }
.q-opt-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.quote-foot { display: flex; flex-wrap: wrap; gap: 12px; }
.quote-legal { margin: 4px 0 0; font-size: 12px; color: var(--text-3); }
.quote-legal q { font-weight: 600; color: var(--text-2); }
@media (max-width: 1000px) { .quote-opts { grid-template-columns: 1fr; } }

/* ----- Lender finder ----- */
.lf-grid { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.lf-scenario { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; }
.lf-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 0 0 6px; }
.lf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-chips .chip { min-height: 36px; padding: 0 12px; }
.lf-chips .chip[aria-pressed="true"]::before { content: "✓"; }
.lf-chips .chip.is-suggested { border-style: dashed; }
.lf-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lf-results { display: flex; flex-direction: column; gap: 10px; }
.lf-results h2 { margin: 6px 0 0; font-size: 15px; }
.lf-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.lf-card.is-good { border-left: 4px solid var(--act-call); }
.lf-card.is-partial { border-left: 4px solid var(--border-strong); }
.lf-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.lf-top strong { font-size: 15px; }
.lf-fit { font-size: 12px; font-weight: 700; }
.lf-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.lf-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2, var(--accent-soft)); border: 1px solid var(--border); color: var(--text-2); }
.lf-tag.is-hit { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.lf-why { font-size: 13px; color: var(--text-2); margin: 0; }
.lf-contact { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; align-items: center; }
.lf-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-edit { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; display: flex; flex-direction: column; gap: 10px; }
.lf-todo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
@media (max-width: 900px) { .lf-grid { grid-template-columns: 1fr; } .lf-scenario { position: static; } }

/* ----- Lead tags (word always shown; color only helps) ----- */
.ltags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.ltag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1.2; padding: 3px 8px;
  border-radius: 999px; border: 1px solid var(--lt-bd); background: var(--lt-bg); color: var(--lt-fg); white-space: nowrap; }
.ltag-auto { border-style: dashed; background: transparent; }
.ltag-more { --lt-bg: transparent; --lt-fg: var(--text-3); --lt-bd: var(--border); }
.ltag-x { border: 0; background: transparent; color: inherit; font: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 0 0 2px;
  min-width: 24px; min-height: 24px; margin: -6px -6px -6px 0; border-radius: 999px; }
.ltag-x:hover, .ltag-x:focus-visible { background: var(--lt-bd); }
.ltag-red    { --lt-bg: #FDE8E8; --lt-fg: #9B1C1C; --lt-bd: #F4B4B4; }
.ltag-orange { --lt-bg: #FDEBDD; --lt-fg: #9A3D0A; --lt-bd: #F5C29C; }
.ltag-gold   { --lt-bg: #FBF1D3; --lt-fg: #7A5300; --lt-bd: #E9CF85; }
.ltag-green  { --lt-bg: #E1F3E6; --lt-fg: #1E6332; --lt-bd: #A8D8B5; }
.ltag-teal   { --lt-bg: #DDF1F0; --lt-fg: #11605B; --lt-bd: #9ED3CF; }
.ltag-blue   { --lt-bg: #E2EEFA; --lt-fg: #0F4C81; --lt-bd: #A9C8EA; }
.ltag-navy   { --lt-bg: #E3E8F2; --lt-fg: #1D3561; --lt-bd: #AEBBD6; }
.ltag-indigo { --lt-bg: #E8E7FA; --lt-fg: #3B3492; --lt-bd: #BDB8EE; }
.ltag-purple { --lt-bg: #F1E6FA; --lt-fg: #6A2C91; --lt-bd: #D3B3EA; }
.ltag-pink   { --lt-bg: #FBE6F1; --lt-fg: #8E1F5C; --lt-bd: #EDB2D2; }
.ltag-gray   { --lt-bg: #EEF0F3; --lt-fg: #3F4650; --lt-bd: #C9CED6; }
[data-theme="dark"] .ltag-red    { --lt-bg: #3A1D1D; --lt-fg: #F5A3A3; --lt-bd: #6B3434; }
[data-theme="dark"] .ltag-orange { --lt-bg: #3A2617; --lt-fg: #F4B482; --lt-bd: #6B4528; }
[data-theme="dark"] .ltag-gold   { --lt-bg: #352C14; --lt-fg: #EBCB78; --lt-bd: #63532A; }
[data-theme="dark"] .ltag-green  { --lt-bg: #1B3123; --lt-fg: #95D6A6; --lt-bd: #335C40; }
[data-theme="dark"] .ltag-teal   { --lt-bg: #173130; --lt-fg: #8ED3CD; --lt-bd: #2D5A57; }
[data-theme="dark"] .ltag-blue   { --lt-bg: #172A3D; --lt-fg: #9CC6EE; --lt-bd: #2D4D6E; }
[data-theme="dark"] .ltag-navy   { --lt-bg: #1C2436; --lt-fg: #AFC0E4; --lt-bd: #36456A; }
[data-theme="dark"] .ltag-indigo { --lt-bg: #23213D; --lt-fg: #BAB4F2; --lt-bd: #433E73; }
[data-theme="dark"] .ltag-purple { --lt-bg: #2E2039; --lt-fg: #D5B3EE; --lt-bd: #573D6B; }
[data-theme="dark"] .ltag-pink   { --lt-bg: #37202C; --lt-fg: #F0AED0; --lt-bd: #693D54; }
[data-theme="dark"] .ltag-gray   { --lt-bg: #26292E; --lt-fg: #C6CBD3; --lt-bd: #454A53; }
#leads-table .ltags { max-width: 260px; }
.tag-picks { display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto; min-width: 240px; }
.tag-pick { min-height: 36px; }
.tag-pick-h { margin: 8px 0 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
#tags-btn.is-on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.lead-tags-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: center; margin-top: 8px; }
.lead-tags-row .tag-add { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 999px; }
.tag-menu { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.tag-menu button { display: flex; align-items: center; gap: 8px; min-height: 36px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; padding: 2px 8px; border-radius: 8px; cursor: pointer; }
.tag-menu button:hover, .tag-menu button:focus-visible { background: var(--accent-soft); }
.tag-set { display: flex; flex-direction: column; gap: 8px; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tag-row:last-child { border-bottom: 0; }
.tag-row .count-link { font-size: 13px; }
.color-picks { display: flex; flex-wrap: wrap; gap: 4px; }
.color-picks label { position: relative; }
.color-picks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.color-picks .sw { display: inline-block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: var(--lt-bg); box-shadow: inset 0 0 0 1px var(--lt-bd); cursor: pointer; }
.color-picks input:checked + .sw { border-color: var(--lt-fg); }
.color-picks input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----- Lead record: slim profile on the left, details below Lead details (Oct 26, 2026) ----- */
.record aside { overflow: visible; }            /* lets the + Tag menu open past the card */
.profile-top { border-radius: 13px 13px 0 0; }
.record aside:not(:has(.profile-body > :not(:empty))) .profile-top { border-radius: 13px; border-bottom: 0; }
.profile-body:not(:has(> :not(:empty))) { display: none; }
@media (min-width: 1000px) { .record aside { position: sticky; top: 12px; max-width: 320px; } }
.lead-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.lead-more .aside-notes { border-top: 0; padding: 18px 20px 20px; gap: 12px; }
.lead-more #note-body { min-height: 96px; }
.lm-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lm-side h2 { margin: 0; font-size: 15px; }
.lm-side .facts { font-size: 15px; gap: 10px; }
.lm-danger { padding-top: 12px; padding-bottom: 12px; }
.lm-danger .delete-zone { border-top: 0; padding-top: 0; }

/* ----- Loan application form (shared by the borrower portal and the lead's Application tab) ----- */
.uf-intro { margin: 0 0 4px; color: var(--text-2); }
.uf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; align-items: start; }
.uf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.uf-field[hidden] { display: none; }
.uf-full { grid-column: 1 / -1; }
.uf-label, .uf-choices legend { font-weight: 600; font-size: 14px; color: var(--text); padding: 0; }
.uf-opt { font-weight: 400; color: var(--text-3); }
.uf-help { font-size: 13px; color: var(--text-2); }
.uf-help:empty { display: none; }
.uf-err { font-size: 13px; font-weight: 600; color: var(--danger); }
.uf-input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.uf-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 14px; }
.uf-choices { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.uf-choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.uf-choice { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; background: var(--surface); }
.uf-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.uf-choice input, .uf-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.uf-check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 12px; }
.uf-check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.uf-money { position: relative; display: flex; align-items: center; }
.uf-money span { position: absolute; left: 12px; color: var(--text-2); pointer-events: none; }
.uf-money input { padding-left: 26px; width: 100%; }
.uf-secret-on { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.uf-ok { color: var(--ok-text); font-weight: 700; }
.uf-list { display: flex; flex-direction: column; gap: 10px; }
.uf-list[hidden] { display: none; }
.uf-list-h { margin: 6px 0 0; font-size: 16px; }
.uf-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.uf-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.uf-add { align-self: flex-start; }

/* ----- Lead record: Portal and Application tabs ----- */
.pp-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.pp-summary .k { font-size: 12px; font-weight: 600; color: var(--text-3); }
.pp-summary .v { font-size: 20px; font-weight: 700; }
.pp-status { display: inline-block; font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent); }
.pp-person { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 10px; }
.pp-person-main { flex: 1 1 260px; min-width: 0; }
.pp-person-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-bar { height: 6px; border-radius: 999px; background: var(--chip); margin-top: 6px; overflow: hidden; max-width: 320px; }
.pp-bar span { display: block; height: 100%; background: var(--accent); }
.pp-code { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn-text); font-size: 13px; }
.pp-code strong { font-size: 24px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.pp-link { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.pp-link[hidden] { display: none; }
.pp-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.pp-count { border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.pp-count .k { font-size: 13px; font-weight: 600; color: var(--text-2); }
.pp-count .v { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pp-c-owed .v { color: var(--warn-text); } .pp-c-review .v { color: var(--accent-text); } .pp-c-ok .v { color: var(--ok-text); }
.pp-request { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; padding: 12px; border-radius: 12px; background: var(--accent-soft); }
.pp-request .field { min-width: 160px; }
.pp-request input[hidden] { display: none; }
.table-scroll { overflow-x: auto; }
table.leads.pp-table { min-width: 640px; }
.pp-table td:nth-child(4) { overflow-wrap: anywhere; }
.pp-table td { vertical-align: top; }
.pp-acts { display: flex; flex-wrap: wrap; gap: 4px; }
.pp-redo { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.tag-needed { background: var(--warn-soft); color: var(--warn-text); }
.tag-review-doc { background: var(--accent-soft); color: var(--accent-text); }
.tag-accepted { background: var(--ok-soft); color: var(--ok-text); }
.tag-redo { background: var(--danger-soft); color: var(--danger); }
.pp-milestones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 12px; font-size: 14px; }
.pp-milestones li { color: var(--text-3); }
.pp-milestones li.is-done { color: var(--ok-text); font-weight: 600; }
.pp-milestones li.is-current { color: var(--accent-text); font-weight: 700; }
.ap-who { flex-wrap: wrap; }
.ap-le { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ap-le-items { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.ap-le-item { color: var(--text-3); }
.ap-le-item.is-on { color: var(--ok-text); font-weight: 600; }
.ap-le-due { padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn-text); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.ap-le-due.is-sent { background: var(--ok-soft); color: var(--ok-text); }
.ap-done { margin: 0; color: var(--ok-text); font-weight: 700; }
.ap-grid { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ap-steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-steps button { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ap-steps button:hover { background: var(--accent-soft); }
.ap-steps button[aria-current="step"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.ap-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; color: var(--text-3); }
.ap-mark.is-on { background: var(--ok-text); border-color: var(--ok-text); color: var(--surface); }
.ap-actions { justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 12px; }
.ap-actions .btn[hidden] { display: none; }
.ap-reveal[hidden] { display: none; }
.ap-reveal-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.ap-reveal-form .input { width: auto; min-height: 36px; }
.ap-revealed { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.ap-changes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
@media (max-width: 900px) { .ap-grid { grid-template-columns: 1fr; } .ap-steps ol { flex-direction: row; flex-wrap: wrap; } .ap-steps button { width: auto; } }
@media (max-width: 600px) { .pp-counts { grid-template-columns: 1fr; } }
