:root {
  color-scheme: dark;
  --bg: #1b1c21;
  --sidebar: #18191e;
  --panel: #202126;
  --panel-2: #24252b;
  --panel-hover: #292a31;
  --line: #34353c;
  --line-subtle: #2b2c33;
  --text: #f2f2f4;
  --muted: #a0a1ab;
  --dim: #777881;
  --blue: #626cd5;
  --blue-bright: #7c86ed;
  --blue-soft: rgba(98, 108, 213, 0.14);
  --green: #62d3a7;
  --green-soft: rgba(98, 211, 167, 0.12);
  --orange: #d89b5d;
  --orange-soft: rgba(225, 173, 96, 0.12);
  --red: #e56b78;
  --red-soft: rgba(239, 127, 130, 0.12);
  --purple: #9b8afb;
  --field: #1d1e23;
  --raised: #27282f;
  --topbar: rgba(27, 28, 33, 0.93);
  --overlay: rgba(5, 6, 9, 0.64);
  --placeholder: #666873;
  --accent-text: #cdd1ff;
  --accent-text-strong: #eef0ff;
  --accent-link: #aeb5ff;
  --success-text: #92e4c4;
  --warning-text: #ecc682;
  --danger-text: #ffacaf;
  --chart-grid: rgba(255, 255, 255, 0.055);
  --chart-dot: #202126;
  --chart-line-width: 1.6;
  --chart-comparison-line-width: 1;
  --chart-grid-width: 0.75;
  --chart-point-stroke-width: 1.25;
  --quiet-fill: rgba(255, 255, 255, 0.018);
  --hover-fill: rgba(255, 255, 255, 0.035);
  --track-fill: rgba(255, 255, 255, 0.05);
  --logo-filter: none;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --sidebar-width: 240px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7;
  --sidebar: #f8f9fb;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --panel-hover: #eef0f4;
  --line: #d5d8e0;
  --line-subtle: #e5e7ec;
  --text: #202229;
  --muted: #5e6370;
  --dim: #686e7b;
  --blue: #5963c7;
  --blue-bright: #4e58bd;
  --blue-soft: rgba(89, 99, 199, 0.1);
  --green: #167957;
  --green-soft: rgba(22, 121, 87, 0.1);
  --orange: #a66221;
  --orange-soft: rgba(166, 98, 33, 0.1);
  --red: #b84450;
  --red-soft: rgba(184, 68, 80, 0.1);
  --purple: #7667d3;
  --field: #f7f8fa;
  --raised: #ffffff;
  --topbar: rgba(244, 245, 247, 0.9);
  --overlay: rgba(20, 22, 29, 0.3);
  --placeholder: #6b7180;
  --accent-text: #4f58b6;
  --accent-text-strong: #363e98;
  --accent-link: #4854b7;
  --success-text: #126a4d;
  --warning-text: #8f551b;
  --danger-text: #a73c47;
  --chart-grid: rgba(31, 34, 42, 0.1);
  --chart-dot: #ffffff;
  --quiet-fill: rgba(31, 34, 42, 0.025);
  --hover-fill: rgba(31, 34, 42, 0.045);
  --track-fill: rgba(31, 34, 42, 0.08);
  --logo-filter: brightness(0) saturate(100%) invert(13%) sepia(7%) saturate(1067%) hue-rotate(190deg) brightness(92%) contrast(94%);
  --shadow: 0 20px 52px rgba(34, 38, 50, 0.14);
}

/* Pricing source updates: isolated from the scenario and loan workspaces. */
.pricing-updates { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pricing-updates .page-header { margin-bottom: 0; }
.pricing-updates .notice p { margin: 5px 0 9px; }
.pricing-updates .notice ul { margin: 8px 0 0; padding-left: 20px; }
.pricing-updates-toolbar,
.pricing-updates-detail-header,
.pricing-updates-actionbar,
.pricing-updates-actionbar > div:last-child { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pricing-updates-toolbar { flex-wrap: wrap; }
.pricing-updates .segmented { max-width: 100%; }
.pricing-updates .segmented button { white-space: normal; }
.pricing-updates-list-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; }
.pricing-updates-list-back .ui-icon { width: 15px; height: 15px; }
.pricing-updates-detail-header h2 { margin: 4px 0 7px; font-size: 22px; letter-spacing: -.5px; overflow-wrap: anywhere; }
.pricing-updates-detail-header p { margin: 0; color: var(--muted); font-size: 12px; }
.pricing-updates-empty { display: grid; justify-items: center; gap: 10px; padding: 42px 24px; text-align: center; }
.pricing-updates-empty > .ui-icon { width: 30px; height: 30px; color: var(--dim); }
.pricing-updates-empty h3 { margin: 0; font-size: 15px; }
.pricing-updates-empty p { max-width: 570px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.pricing-updates-setup { margin: 0 30px 26px; padding-left: 20px; color: var(--muted); line-height: 1.7; font-size: 12px; }
.pricing-updates-list { display: flex; flex-direction: column; }
.pricing-updates-list-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 19px 22px; background: transparent; border: 0; border-top: 1px solid var(--line-subtle); color: var(--text); text-align: left; cursor: pointer; }
.pricing-updates-list-row:first-child { border-top: 0; }
.pricing-updates-list-row:hover { background: var(--hover-fill); }
.pricing-updates-list-copy { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 6px; }
.pricing-updates-list-copy strong { font-size: 13px; overflow-wrap: anywhere; }
.pricing-updates-list-copy small,
.pricing-updates-assets small,
.pricing-updates-pending-file small { display: block; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.pricing-updates-list-row > .ui-icon { width: 15px; height: 15px; color: var(--dim); }
.pricing-updates-file-icon { display: grid; flex: 0 0 36px; width: 36px; height: 40px; place-items: center; background: var(--blue-soft); color: var(--accent-link); border-radius: 8px; }
.pricing-updates-file-icon .ui-icon { width: 18px; height: 18px; }
.pricing-updates-section { display: flex; flex-direction: column; gap: 22px; padding: 22px; min-width: 0; }
.pricing-updates-assets { display: flex; flex-direction: column; gap: 12px; }
.pricing-updates-assets article { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line-subtle); border-radius: var(--radius); padding: 14px; }
.pricing-updates-assets article > div { flex: 1; min-width: 0; }
.pricing-updates-assets strong,
.pricing-updates-pending-file strong { font-size: 12px; overflow-wrap: anywhere; }
.pricing-updates-pending { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.pricing-updates-pending h3,
.pricing-updates-pending p { margin: 0; }
.pricing-updates-pending h3 { font-size: 13px; }
.pricing-updates-pending p { font-size: 12px; line-height: 1.6; }
.pricing-updates-pending > .button { align-self: flex-end; }
.pricing-updates-pending-file { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(170px, 1fr) auto; gap: 12px; align-items: center; }
.pricing-updates-summary { display: grid; gap: 18px; padding-left: 20px; margin: 8px 0 24px; }
.pricing-updates-summary li { line-height: 1.6; overflow-wrap: anywhere; }
.pricing-updates-summary li span { display: block; color: var(--muted); font-size: 12px; }
.pricing-updates-processing { display: grid; gap: 16px; padding: 4px 0; }
.pricing-updates-processing p { margin: 0; }
.pricing-updates-processing-track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--line-subtle); }
.pricing-updates-processing-track > span { display: block; width: 35%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--accent-link), transparent); animation: pricing-document-review 1.8s linear infinite; }
@keyframes pricing-document-review { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .pricing-updates-processing-track > span { animation: none; transform: translateX(90%); } }
.pricing-updates-next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; justify-content: space-between; padding: 20px; border: 1px solid var(--line-subtle); border-radius: var(--radius); background: var(--quiet-fill); }
.pricing-updates-next-step > div:first-child { flex: 1; min-width: 200px; }
.pricing-updates-next-step > div:last-child, .pricing-updates-secondary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pricing-updates-next-step h3 { margin: 0 0 8px; font-size: 15px; }
.pricing-updates-next-step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.pricing-updates-details > .panel { margin-top: 18px; }
.pricing-updates-blockers summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.pricing-updates-secondary-actions { margin-top: 14px; }
.pricing-check-cards { display: grid; gap: 16px; }
.pricing-check-card { border: 1px solid var(--line-subtle); border-radius: var(--radius); padding: 20px; }
.pricing-check-card header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.pricing-check-card h3 { font-size: 14px; margin: 0; }
.pricing-check-card p, .pricing-source-reason p { font-size: 13px; line-height: 1.7; color: var(--muted); }
.pricing-clarifications form { display: grid; gap: 20px; }
.pricing-clarifications form > .button { justify-self: start; }
.pricing-clarification { display: grid; gap: 16px; min-width: 0; padding: 20px; border: 1px solid var(--line-subtle); border-radius: var(--radius); }
.pricing-clarification h3 { margin: 6px 0 0; font-size: 16px; }
.pricing-clarification p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted); }
.pricing-clarification-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.pricing-clarification-sources > section { min-width: 0; padding: 16px; background: var(--quiet-fill); border-radius: var(--radius); }
.pricing-clarification small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.pricing-clarification blockquote { margin: 12px 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
.pricing-clarification-answer { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.pricing-clarification-answer :is(input, select, textarea) { width: 100%; min-width: 0; }
.pricing-check-next { margin: 16px 0; border-left: 2px solid var(--line-subtle); padding-left: 14px; }
.pricing-check-next > strong { font-size: 12px; }
.pricing-check-next p { margin: 5px 0 0; }
.pricing-check-locations { margin-top: 16px; font-size: 12px; }
.pricing-check-locations summary { cursor: pointer; }
.pricing-check-locations > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pricing-source-reason { border: 1px solid var(--line-subtle); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.pricing-source-reason > section + section { border-top: 1px solid var(--line-subtle); margin-top: 14px; padding-top: 14px; }
.pricing-source-reason strong { font-size: 14px; }
.pricing-source-reason p:last-child { margin-bottom: 0; }
.pricing-source-preview { min-width: 0; border: 1px solid var(--line-subtle); border-radius: var(--radius); overflow: hidden; }
.pricing-source-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px; background: var(--panel); }
.pricing-source-toolbar input { width: 62px; min-width: 0; }
.pricing-source-toolbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.pricing-source-viewport { overflow: auto; scrollbar-gutter: stable; height: 65vh; min-height: 280px; padding: 12px; text-align: center; background: var(--quiet-fill); }
.pricing-source-viewport canvas { display: block; margin: 0 auto; max-width: none; background: #fff; }
.pricing-source-extracted { margin-top: 20px; font-size: 12px; }
.pricing-source-extracted > summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.pricing-source-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
.pricing-source-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.pricing-source-table { overflow: auto; max-height: 60vh; }
.pricing-source-table table { border-collapse: collapse; width: 100%; font-size: 12px; }
.pricing-source-table td, .pricing-source-table th { border: 1px solid var(--line-subtle); padding: 8px; white-space: pre-wrap; min-width: 70px; vertical-align: top; }
.pricing-source-table th { position: sticky; top: 0; background: var(--panel); }
.pricing-updates-pending-file label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
.pricing-updates-pending-file select { width: 100%; min-width: 0; }
.pricing-updates-progress { display: flex; gap: 12px; align-items: flex-start; color: var(--accent-link); }
.pricing-updates-progress > div { display: flex; flex: 1; flex-direction: column; gap: 7px; font-size: 12px; }
.pricing-updates-progress span { color: var(--muted); overflow-wrap: anywhere; }
.pricing-updates-progress .pricing-updates-processing-track { width: 100%; margin-top: 5px; }
.pricing-updates-publishing { max-width: 520px; }
.pricing-updates-retained { padding-top: 18px; border-top: 1px solid var(--line-subtle); font-size: 12px; }
.pricing-updates-retained summary { cursor: pointer; font-weight: 600; }
.pricing-updates-retained p { color: var(--muted); line-height: 1.6; }
.pricing-updates-retained ul { display: flex; flex-direction: column; gap: 12px; padding-left: 18px; }
.pricing-updates-retained li span { display: block; margin-top: 4px; color: var(--muted); }
.pricing-updates-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line-subtle); overflow-x: auto; }
.pricing-updates-tabs .tab-button { padding: 10px 0; white-space: nowrap; }
.pricing-updates-blockers { padding: 17px 20px; border: 1px solid var(--orange); border-radius: var(--radius); background: var(--orange-soft); }
.pricing-updates-blockers header { display: flex; align-items: center; gap: 9px; color: var(--warning-text); }
.pricing-updates-blockers h3 { margin: 0; font-size: 13px; }
.pricing-updates-blockers ul { display: flex; flex-direction: column; gap: 12px; padding-left: 23px; margin: 13px 0 0; }
.pricing-updates-blockers p { margin: 0 0 7px; font-size: 12px; line-height: 1.6; }
.pricing-updates-changes { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.pricing-updates-changes article { border: 1px solid var(--line-subtle); border-radius: var(--radius); overflow: hidden; }
.pricing-updates-changes header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; }
.pricing-updates-changes header small { color: var(--muted); font-size: 11px; }
.pricing-updates-changes h3 { margin: 5px 0 0; font-size: 13px; }
.pricing-updates-changes footer { padding: 12px 18px; border-top: 1px solid var(--line-subtle); background: var(--quiet-fill); font-size: 11px; }
.pricing-updates-more { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line-subtle); }
.pricing-updates-more p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pricing-updates-comparison { display: grid; grid-template-columns: 1fr 1fr; }
.pricing-updates-comparison > div { min-width: 0; padding: 15px 18px; background: var(--quiet-fill); border-top: 1px solid var(--line-subtle); }
.pricing-updates-comparison > div + div { border-left: 1px solid var(--line-subtle); background: var(--blue-soft); }
.pricing-updates-comparison span { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.pricing-updates-comparison p { margin: 7px 0 0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.pricing-updates-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pricing-updates-metric { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line-subtle); border-radius: var(--radius); }
.pricing-updates-metric > span { color: var(--muted); font-size: 11px; }
.pricing-updates-metric strong { font-size: 20px; font-weight: 600; letter-spacing: -.5px; }
.pricing-updates-metric small { color: var(--dim); font-size: 10px; }
.pricing-updates-scenarios { display: flex; flex-direction: column; gap: 16px; }
.pricing-updates-scenarios article { border: 1px solid var(--line-subtle); border-radius: var(--radius); overflow: hidden; }
.pricing-updates-scenarios header { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 15px; }
.pricing-updates-scenarios h3 { margin: 0; font-size: 13px; }
.pricing-updates-scenarios article > p { margin: 0 15px 15px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pricing-updates-table-wrap { overflow: auto; max-width: 100%; }
.pricing-updates-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pricing-updates-table-wrap th,
.pricing-updates-table-wrap td { padding: 11px 15px; text-align: left; border-top: 1px solid var(--line-subtle); line-height: 1.5; }
.pricing-updates-table-wrap th { color: var(--muted); font-weight: 500; }
.pricing-updates-history { display: flex; flex-direction: column; gap: 24px; padding: 0; margin: 0; list-style: none; }
.pricing-updates-history li { display: flex; gap: 13px; }
.pricing-updates-history-dot { margin-top: 5px; width: 8px; height: 8px; flex-shrink: 0; border: 2px solid var(--blue); border-radius: 50%; }
.pricing-updates-history strong { font-size: 12px; }
.pricing-updates-history small { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
.pricing-updates-history p { margin: 8px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; }
.pricing-updates-actionbar { padding: 20px 0 12px; align-items: flex-start; flex-wrap: wrap; }
.pricing-updates-actionbar > div:first-child { display: flex; flex: 1; min-width: 200px; flex-direction: column; gap: 6px; }
.pricing-updates-actionbar strong { font-size: 12px; }
.pricing-updates-actionbar span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.pricing-updates-actionbar > div:last-child { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.detail-drawer[data-variant="pricing-update-evidence"] { width: min(900px, 96vw); }
.pricing-updates-evidence { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pricing-updates-evidence h3,
.pricing-updates-evidence > p { margin: 0; }
.pricing-updates-evidence pre { padding: 16px; margin: 0; border: 1px solid var(--line-subtle); border-radius: var(--radius); background: var(--panel-2); font: inherit; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.pricing-updates-evidence ul { padding-left: 20px; margin: 0; font-size: 12px; line-height: 1.7; }
.pricing-updates .checkbox-label,
.modal[data-variant="pricing-update-action"] .checkbox-label { display: flex; align-items: flex-start; gap: 9px; line-height: 1.6; }
.pricing-updates .checkbox-label input[type="checkbox"],
.modal[data-variant="pricing-update-action"] .checkbox-label input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; padding: 0; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--blue); }
@media (max-width: 1100px) {
  .pricing-updates-pending-file { grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto; }
  .pricing-updates-pending-file > div { grid-column: 1 / -1; }
  .pricing-updates-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .pricing-updates .panel-head { flex-wrap: wrap; gap: 12px; }
  .pricing-updates-toolbar,
  .pricing-updates-detail-header { align-items: flex-start; }
  .pricing-updates-toolbar > .segmented { width: 100%; }
  .pricing-updates-toolbar > .button { width: 100%; }
  .pricing-updates-list-row { flex-wrap: wrap; padding: 17px; gap: 10px; }
  .pricing-updates-list-row > .badge { margin-left: 46px; }
  .pricing-updates-list-copy { flex-basis: calc(100% - 60px); }
  .pricing-updates-section,
  .pricing-updates-changes { padding: 15px; }
  .pricing-updates-assets article { flex-wrap: wrap; }
  .pricing-updates-assets article > div { flex-basis: calc(100% - 50px); }
  .pricing-updates-assets article > .badge { margin-left: 48px; }
  .pricing-updates-pending { padding: 14px; }
  .pricing-updates-pending-file { grid-template-columns: minmax(0, 1fr) auto; }
  .pricing-updates-pending-file label { grid-column: 1; }
  .pricing-updates-pending-file > button { grid-column: 2; grid-row: 2 / 4; }
  .pricing-updates-tabs { gap: 22px; }
  .pricing-updates-changes header { flex-wrap: wrap; }
  .pricing-updates-actionbar > div:last-child { width: 100%; justify-content: flex-start; }
  .pricing-updates-actionbar > div:last-child .button { flex: 1; }
}

/* Borrower workspace */
.borrower-directory,
.borrower-workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.borrower-directory {
  gap: 0;
}

.borrower-workspace {
  gap: 18px;
}

.borrower-filter {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 10px;
}

.borrower-filter .filter-search {
  width: 100%;
}

.borrower-filter .button {
  height: 35px;
  min-height: 35px;
  padding-block: 0;
}

.borrower-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.borrower-table {
  min-width: 1040px;
}

.borrower-table tbody tr {
  cursor: pointer;
}

.borrower-table tbody tr:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: -2px;
}

.borrower-person,
.borrower-picker-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.borrower-person > span:last-child,
.borrower-picker-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.borrower-picker-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.borrower-picker-name .badge {
  flex: 0 0 auto;
}

.borrower-person small,
.borrower-picker-row small,
.borrower-record-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}

.borrower-avatar,
.borrower-workspace-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(124, 134, 237, 0.28);
  background: var(--blue-soft);
  color: var(--accent-text);
  font-weight: 700;
}

.borrower-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 11px;
}

.borrower-workspace-avatar {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  font-size: 16px;
}

.borrower-page-control,
.borrower-tab-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.borrower-page-control {
  padding: 2px 4px;
  color: var(--muted);
  font-size: 12px;
}

.borrower-workspace-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(98, 108, 213, 0.11), rgba(32, 33, 38, 0) 50%), var(--panel);
}

.borrower-workspace-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.borrower-workspace-person > div,
.borrower-workspace-person > div > div {
  min-width: 0;
}

.borrower-workspace-person > div > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.borrower-workspace-person h1,
.borrower-workspace-person p {
  margin-bottom: 0;
}

.borrower-workspace-person > div > p:last-child {
  margin-top: 5px;
  color: var(--muted);
}

.borrower-workspace-hero .page-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.borrower-workspace-metrics {
  display: grid;
  overflow: hidden;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.borrower-workspace-metrics > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 16px 18px;
}

.borrower-workspace-metrics > div + div {
  border-left: 1px solid var(--line-subtle);
}

.borrower-workspace-metrics span,
.borrower-workspace-metrics small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.borrower-workspace-metrics span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.borrower-workspace-metrics strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.borrower-workspace-metrics .borrower-metric-assignee {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}

.borrower-workspace-metrics .borrower-metric-assignee > span:last-child {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  letter-spacing: normal;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.borrower-workspace-metrics .assignee-avatar-fallback {
  color: var(--accent-text);
  font-size: 10px;
  letter-spacing: normal;
  text-transform: none;
}

.borrower-workspace-main {
  overflow: hidden;
}

.borrower-record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  align-items: start;
  gap: 16px;
}

.borrower-record-layout > .borrower-contact-panel {
  position: sticky;
  top: 82px;
  width: 100%;
  min-height: 520px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.borrower-contact-panel-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.borrower-contact-panel-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.borrower-contact-panel-intro > .ui-icon {
  width: 22px;
  height: 22px;
  color: var(--blue-bright);
}

.borrower-contact-panel-intro > div,
.borrower-contact-panel-intro strong,
.borrower-contact-panel-intro span {
  display: block;
  min-width: 0;
}

.borrower-contact-panel-intro span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.borrower-contact-facts {
  display: grid;
  margin: 0;
}

.borrower-contact-facts > div {
  display: grid;
  gap: 5px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-subtle);
}

.borrower-contact-facts > div:last-child {
  border-bottom: 0;
}

.borrower-contact-facts dt {
  color: var(--dim);
  font-size: 9px;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.borrower-contact-facts dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.borrower-contact-facts .assignee-detail > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.borrower-contact-facts .assignee-detail strong,
.borrower-contact-facts .assignee-detail small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.borrower-contact-facts .assignee-detail small {
  color: var(--dim);
  font-size: 10px;
}

.borrower-workspace-tabs {
  display: flex;
  overflow-x: auto;
  gap: 24px;
  padding: 15px 22px 0;
  border-bottom: 1px solid var(--line-subtle);
}

.borrower-workspace-content {
  min-height: 300px;
  padding: 22px;
}

.borrower-workspace-content > .lead-intelligence-source {
  margin-bottom: 16px;
}

.borrower-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.borrower-entity-grid {
  display: grid;
  gap: 0;
}

.borrower-action-stack {
  display: grid;
  gap: 2px;
}

.borrower-action-stack .action-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.borrower-fact-list,
.borrower-entity-card dl,
.borrower-pricing-card dl {
  display: grid;
  margin: 0;
  gap: 0;
}

.borrower-fact-list > div,
.borrower-entity-card dl > div,
.borrower-pricing-card dl > div {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-subtle);
}

.borrower-fact-list > div:last-child,
.borrower-entity-card dl > div:last-child,
.borrower-pricing-card dl > div:last-child {
  border-bottom: 0;
}

.borrower-fact-list dt,
.borrower-entity-card dt,
.borrower-pricing-card dt {
  color: var(--muted);
}

.borrower-fact-list dd,
.borrower-entity-card dd,
.borrower-pricing-card dd {
  margin: 0;
  text-align: right;
}

.borrower-entity-card {
  padding: 18px;
}

.borrower-entity-card header,
.borrower-pricing-card header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
}

.borrower-entity-card header > div,
.borrower-pricing-card header > div {
  min-width: 0;
  flex: 1;
}

.borrower-entity-card header h3,
.borrower-entity-card header p,
.borrower-pricing-card header h3,
.borrower-pricing-card header span {
  margin-bottom: 0;
}

.borrower-entity-card header p,
.borrower-pricing-card header span {
  color: var(--muted);
  font-size: 12px;
}

.borrower-record-list {
  display: grid;
  gap: 0;
}

.borrower-pricing-list {
  display: grid;
  gap: 10px;
}

.borrower-record-card {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  min-height: 59px;
  padding: 12px 15px;
  border: 0;
  border-bottom: 1px solid var(--line-subtle);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.borrower-record-card[data-borrower-open-loan] { grid-template-columns: auto minmax(0, 1fr) auto; }

.borrower-record-card:last-child {
  border-bottom: 0;
}

button.borrower-record-card:hover {
  background: var(--panel-hover);
}

button.borrower-record-card:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: -2px;
}

.borrower-record-value {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.borrower-record-value {
  justify-items: end;
  color: var(--text);
  font-size: 12px;
  font-weight: 590;
}

.borrower-record-value > span:not(.badge) {
  color: var(--dim);
  font-size: 10px;
  font-weight: 450;
  white-space: nowrap;
}

.borrower-record-card > .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--dim);
}

.borrower-entity-card .borrower-record-value,
.borrower-document-card .borrower-record-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.borrower-pricing-card {
  padding: 18px;
}

.borrower-pricing-card header {
  justify-content: space-between;
}

.borrower-pricing-card .button {
  margin-top: 14px;
}

.borrower-loading {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.borrower-loading span {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--blue-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.borrower-document-groups,
.borrower-document-group,
.borrower-portfolio-content,
.borrower-portfolio-match-results {
  display: grid;
  gap: 16px;
}

.borrower-document-group > header {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 15px 7px;
}

.borrower-document-group > header h3,
.borrower-document-group > header p {
  margin-bottom: 0;
}

.borrower-document-group > header h3 {
  font-size: 12px;
}

.borrower-document-group > header > div > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.borrower-document-group > header .eyebrow {
  font-size: 9px;
}

.borrower-document-entities {
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
}

.borrower-document-entity {
  border-bottom: 1px solid var(--line-subtle);
}

.borrower-document-entity:last-child {
  border-bottom: 0;
}

.borrower-document-entity > summary {
  display: grid;
  min-height: 59px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  cursor: pointer;
  list-style: none;
}

.borrower-document-entity > summary::-webkit-details-marker {
  display: none;
}

.borrower-document-entity > summary:hover {
  background: var(--panel-hover);
}

.borrower-document-entity > summary:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: -2px;
}

.borrower-document-entity > summary > .ui-icon:last-child {
  width: 15px;
  height: 15px;
  color: var(--dim);
  transition: transform 140ms ease;
}

.borrower-document-entity[open] > summary > .ui-icon:last-child {
  transform: rotate(180deg);
}

.borrower-document-entity-body {
  border-top: 1px solid var(--line-subtle);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
}

.borrower-document-empty {
  display: flex;
  min-height: 59px;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  color: var(--muted);
  font-size: 12px;
}

.borrower-document-empty .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--blue-bright);
}

.borrower-document-card .document-correction {
  color: var(--orange);
}

.borrower-portfolio-source {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(98, 211, 167, 0.3);
  border-radius: var(--radius);
  background: var(--green-soft);
}

.borrower-portfolio-source[data-source-status="pending"],
.borrower-portfolio-source[data-source-status="stale"] {
  border-color: rgba(216, 155, 93, 0.34);
  background: var(--orange-soft);
}

.borrower-portfolio-source[data-source-status="not_connected"],
.borrower-portfolio-source[data-source-status="match_needed"],
.borrower-portfolio-source[data-source-status="unavailable"] {
  border-color: var(--line);
  background: var(--panel-2);
}

.borrower-portfolio-source > span:nth-child(2),
.borrower-portfolio-match-row > span:nth-child(2),
.borrower-portfolio-lenders span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.borrower-portfolio-source small,
.borrower-portfolio-match-row small,
.borrower-portfolio-lenders small,
.borrower-portfolio-metric small {
  color: var(--muted);
}

.borrower-portfolio-state {
  display: grid;
  min-height: 280px;
  grid-template-columns: auto minmax(0, 520px);
  place-content: center;
  align-items: start;
  gap: 16px;
  padding: 28px;
  color: var(--muted);
  text-align: left;
}

.borrower-portfolio-state > svg {
  width: 28px;
  height: 28px;
  color: var(--blue-bright);
}

.borrower-portfolio-state h3 {
  margin-bottom: 6px;
  color: var(--text);
}

.borrower-portfolio-state p {
  margin-bottom: 16px;
}

.borrower-portfolio-nav {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-subtle);
}

.borrower-portfolio-nav button {
  min-width: max-content;
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
}

.borrower-portfolio-nav button.active {
  border-bottom-color: var(--blue-bright);
  color: var(--text);
}

.borrower-portfolio-lead-summary {
  display: grid;
  gap: 16px;
}

.borrower-portfolio-lead-summary .lead-intelligence-metrics {
  margin-bottom: 0;
}

.borrower-portfolio-lead-summary > .panel {
  margin: 0;
}

.borrower-portfolio-caution {
  padding: 12px 14px;
  border: 1px solid rgba(216, 155, 93, 0.32);
  border-radius: var(--radius);
  background: var(--orange-soft);
  color: var(--orange);
}

.borrower-portfolio-caution.neutral {
  border-color: var(--line-subtle);
  background: var(--panel-2);
  color: var(--muted);
}

.borrower-portfolio-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.borrower-portfolio-metric {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.borrower-portfolio-metric > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.borrower-portfolio-metric > div svg {
  width: 17px;
  height: 17px;
}

.borrower-portfolio-metric > strong {
  display: block;
  overflow: hidden;
  margin: 8px 0 2px;
  font-size: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.borrower-portfolio-summary-grid,
.borrower-portfolio-entity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.borrower-portfolio-brief {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.borrower-portfolio-brief li,
.borrower-portfolio-history dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-subtle);
}

.borrower-portfolio-brief li:last-child,
.borrower-portfolio-history dl > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.borrower-portfolio-brief small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.borrower-portfolio-history {
  grid-column: 1 / -1;
}

.borrower-portfolio-history dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 0;
}

.borrower-portfolio-history dt {
  color: var(--muted);
}

.borrower-portfolio-history dd {
  margin: 0;
  text-align: right;
}

.borrower-portfolio-recent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line-subtle);
  color: var(--muted);
}

.borrower-portfolio-recent strong {
  margin-right: auto;
  color: var(--text);
}

.borrower-portfolio-recent b {
  margin-left: 4px;
  color: var(--text);
}

.borrower-portfolio-lenders {
  display: grid;
  gap: 10px;
}

.borrower-portfolio-lenders article,
.borrower-portfolio-lenders.compact > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.borrower-portfolio-lenders.compact > div {
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 1px solid var(--line-subtle);
}

.borrower-portfolio-lenders.compact > div:last-child {
  border-bottom: 0;
}

.borrower-portfolio-lenders article > span:last-child,
.borrower-portfolio-lenders.compact > div > span:last-child {
  justify-items: end;
  text-align: right;
}

.borrower-portfolio-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
}

.borrower-portfolio-table {
  min-width: 980px;
}

.borrower-portfolio-entity {
  padding: 18px;
}

.borrower-portfolio-entity > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.borrower-portfolio-entity h3,
.borrower-portfolio-entity p {
  margin-bottom: 0;
}

.borrower-portfolio-entity p {
  color: var(--muted);
}

.borrower-portfolio-entity dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin: 18px 0 0;
}

.borrower-portfolio-entity dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-subtle);
}

.borrower-portfolio-entity dt {
  color: var(--muted);
}

.borrower-portfolio-entity dd {
  margin: 0;
  text-align: right;
}

.borrower-portfolio-match-row {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: inherit;
  text-align: left;
}

.borrower-portfolio-match-row:not(.selected) { grid-template-columns: auto minmax(0, 1fr); }

.borrower-portfolio-match-row.selected {
  border-color: var(--blue-bright);
  background: var(--blue-soft);
}

.borrower-picker,
.borrower-picker form,
.borrower-duplicate-panel,
.borrower-contact-reuse,
.borrower-contact-search,
.borrower-contact-candidates,
.borrower-manual-fields {
  display: grid;
  gap: 12px;
}

.borrower-picker form,
.borrower-contact-search {
  grid-template-columns: minmax(0, 1fr) auto;
}

.borrower-contact-reuse {
  padding: 14px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.borrower-contact-reuse .form-hint {
  margin: 4px 0 0;
}

.borrower-selected-contact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(77, 177, 255, 0.35);
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.borrower-selected-contact > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.borrower-selected-contact small {
  color: var(--muted);
}

.borrower-manual-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.borrower-manual-divider::before,
.borrower-manual-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line-subtle);
}

.borrower-picker-row,
.borrower-duplicate-row {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: inherit;
  text-align: left;
}

.borrower-picker-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.borrower-duplicate-panel {
  padding: 14px;
  border: 1px solid rgba(216, 155, 93, 0.38);
  border-radius: var(--radius);
  background: var(--orange-soft);
}

.borrower-duplicate-panel > p {
  margin-bottom: 0;
  color: var(--muted);
}

.borrower-duplicate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.borrower-duplicate-row span {
  display: grid;
  gap: 2px;
}

.borrower-duplicate-row small {
  color: var(--muted);
}

.pricing-borrower-link {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--quiet-fill);
}

.pricing-borrower-link.has-error {
  border-color: rgba(229, 107, 120, 0.4);
}

.pricing-borrower-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 0;
  color: var(--red);
  font-size: 12px;
}

.pricing-borrower-error span,
.pricing-selected-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-selected-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 940px) {
  .borrower-workspace-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .borrower-workspace-hero .page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .borrower-record-layout {
    grid-template-columns: 1fr;
  }

  .borrower-record-layout > .borrower-contact-panel {
    position: static;
    min-height: 0;
  }

  .borrower-workspace-metrics,
  .borrower-overview-grid,
  .borrower-portfolio-metrics,
  .borrower-portfolio-summary-grid,
  .borrower-portfolio-entity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .borrower-workspace-metrics > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line-subtle);
  }

  .borrower-workspace-metrics > div:nth-child(4) {
    border-top: 1px solid var(--line-subtle);
  }
}

@media (max-width: 680px) {
  .borrower-filter,
  .borrower-picker form,
  .borrower-contact-search,
  .borrower-workspace-metrics,
  .borrower-overview-grid,
  .borrower-portfolio-metrics,
  .borrower-portfolio-summary-grid,
  .borrower-portfolio-entity-grid,
  .borrower-portfolio-history dl,
  .borrower-portfolio-entity dl {
    grid-template-columns: 1fr;
  }

  .borrower-portfolio-history {
    grid-column: auto;
  }

  .borrower-portfolio-source {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .borrower-portfolio-source .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .borrower-portfolio-state {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .borrower-document-group > header,
  .borrower-portfolio-recent {
    align-items: flex-start;
    flex-direction: column;
  }

  .borrower-portfolio-lenders article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .borrower-portfolio-lenders article > span:last-child {
    grid-column: 1 / -1;
    justify-items: start;
    text-align: left;
  }

  .borrower-selected-contact {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .borrower-selected-contact .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .borrower-filter .button,
  .borrower-workspace-hero .button,
  .pricing-selected-actions,
  .pricing-selected-actions .button {
    width: 100%;
  }

  .borrower-workspace-hero,
  .borrower-workspace-content {
    padding: 16px;
  }

  .borrower-workspace-person {
    align-items: flex-start;
  }

  .borrower-workspace-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .borrower-workspace-person > div > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .borrower-workspace-metrics > div + div {
    border-top: 1px solid var(--line-subtle);
    border-left: 0;
  }

  .borrower-workspace-tabs {
    gap: 18px;
    padding: 0 16px;
  }

  .borrower-record-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .borrower-record-card[data-borrower-open-loan] { grid-template-columns: auto minmax(0, 1fr); }

  .borrower-record-value {
    display: none;
  }

  .borrower-document-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .borrower-document-card .borrower-record-value {
    display: flex;
    grid-column: 2;
    grid-row: 2;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .borrower-document-card .action-copy strong,
  .borrower-document-card .action-copy span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .borrower-page-control,
  .borrower-tab-actions,
  .pricing-borrower-error {
    align-items: stretch;
    flex-direction: column;
  }

  .pricing-selected-actions {
    justify-content: stretch;
  }
}

/* Role-scoped operational reports */
.reports-page {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.reports-page .page-head {
  margin-bottom: 2px;
}

.reports-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.reports-export {
  min-height: 38px;
}

.reports-filter-panel,
.reports-card,
.reports-kpi,
.reports-loading,
.reports-error,
.reports-empty {
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.reports-filter-panel {
  padding: 13px 14px;
  background:
    linear-gradient(135deg, rgba(98, 108, 213, 0.055), transparent 45%),
    var(--panel);
}

.reports-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.reports-filter {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.reports-filter > span,
.reports-filter > label,
.reports-filter > legend {
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.reports-filter select,
.reports-filter input {
  min-height: 38px;
  padding-block: 7px;
  font-size: 12px;
}

.reports-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
}

.reports-filter-chips:empty {
  display: none;
}

.reports-filter-chips button,
.reports-filter-chips span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid rgba(124, 134, 237, 0.22);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 550;
}

.reports-filter-chip .ui-icon {
  width: 12px;
  height: 12px;
}

.reports-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.reports-kpi {
  min-width: 0;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 105% -10%, rgba(124, 134, 237, 0.13), transparent 52%),
    var(--panel);
}

.reports-kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.reports-kpi-value {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(23px, 2.1vw, 31px);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-kpi-detail {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.reports-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.reports-kpi-delta.positive {
  color: var(--green);
}

.reports-kpi-delta.negative {
  color: var(--red);
}

.reports-card {
  min-width: 0;
  overflow: hidden;
}

.reports-card-head {
  min-height: 67px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-subtle);
}

.reports-card-copy {
  min-width: 0;
}

.reports-card-copy h2,
.reports-card-copy h3 {
  margin: 0 0 3px;
  color: var(--text);
  font-size: 15px;
  font-weight: 640;
}

.reports-card-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.reports-timeline {
  min-height: 438px;
  grid-column: 1 / -1;
}

.reports-chart {
  min-height: 330px;
  display: grid;
  gap: 10px;
  padding: 10px 18px 16px;
}

.reports-chart-svg {
  width: 100%;
  height: clamp(280px, 31vw, 390px);
  display: block;
  overflow: visible;
}

.reports-chart-svg text {
  fill: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.reports-chart-gridline {
  stroke: var(--chart-grid);
  stroke-width: var(--chart-grid-width);
  vector-effect: non-scaling-stroke;
}

.reports-chart-axis-label {
  fill: var(--muted);
  font-size: 12px;
}

.reports-chart-svg circle {
  cursor: pointer;
  stroke: var(--chart-dot);
  stroke-width: var(--chart-point-stroke-width);
  transform-box: fill-box;
  transform-origin: center;
  transition: r 120ms ease, transform 120ms ease, filter 120ms ease;
}

.reports-chart-series.comparison {
  opacity: 0.8;
}

.reports-chart-svg circle:hover,
.reports-chart-svg circle:focus {
  filter: drop-shadow(0 0 6px rgba(124, 134, 237, 0.7));
  outline: none;
  transform: scale(1.25);
}

.reports-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 18px 0;
}

.reports-chart-table-wrap {
  max-height: 320px;
  overflow: auto;
  margin: 0 18px 18px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
}

.reports-chart-table-wrap > summary {
  min-height: 40px;
  padding: 10px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 580;
}

.reports-chart-table-wrap[open] > summary {
  border-bottom: 1px solid var(--line-subtle);
  color: var(--text);
}

.reports-chart-table,
.reports-leaderboard {
  width: 100%;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 12px;
}

.reports-chart-table th,
.reports-chart-table td,
.reports-leaderboard th,
.reports-leaderboard td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-subtle);
  text-align: left;
  white-space: nowrap;
}

.reports-chart-table th,
.reports-leaderboard th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--panel-2);
  color: var(--text);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reports-chart-table td:not(:first-child),
.reports-chart-table th:not(:first-child),
.reports-leaderboard td:not(:first-child),
.reports-leaderboard th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.reports-chart-table tr:last-child td,
.reports-leaderboard tr:last-child td {
  border-bottom: 0;
}

.reports-breakdown-list {
  display: grid;
  gap: 2px;
  padding: 8px;
}

.reports-breakdown-row {
  width: 100%;
  min-height: 48px;
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

button.reports-breakdown-row:hover,
.reports-breakdown-row[tabindex]:hover {
  border-color: var(--line);
  background: var(--panel-2);
}

.reports-breakdown-row {
  grid-template-columns: minmax(100px, 0.9fr) minmax(100px, 1.4fr) auto;
}

.reports-breakdown-row > span:first-child {
  overflow: hidden;
  color: var(--text);
  font-weight: 580;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-breakdown-row > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.reports-breakdown-row > span:first-child strong {
  overflow: hidden;
  color: var(--text);
  font-weight: 580;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-breakdown-row > span:first-child small {
  color: var(--muted);
  font-size: 10px;
}

.reports-breakdown-row.active {
  border-color: rgba(124, 134, 237, 0.32);
  background: var(--blue-soft);
}

.reports-breakdown-row > strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.reports-breakdown-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-subtle);
}

.reports-breakdown-meter > i,
.reports-breakdown-meter > span {
  min-width: 2px;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-bright));
}

.reports-leaderboard-wrap {
  overflow: auto;
}

.reports-leaderboard tbody tr {
  transition: background 120ms ease;
}

.reports-leaderboard tbody tr:hover {
  background: var(--panel-2);
}

.reports-leaderboard td:first-child,
.reports-leaderboard td:nth-child(2) {
  color: var(--text);
}

.reports-leaderboard-person {
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-text);
  font-weight: 600;
  text-align: left;
}

.reports-leaderboard-person:hover,
.reports-leaderboard-person:focus-visible {
  border-color: rgba(124, 134, 237, 0.28);
  background: var(--blue-soft);
}

.reports-quality {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid var(--line-subtle);
  border-radius: 9px;
  background: var(--field);
  color: var(--muted);
  font-size: 12px;
}

.reports-quality.incomplete {
  border-color: rgba(216, 155, 93, 0.28);
  background: var(--orange-soft);
  color: var(--warning-text);
}

.reports-quality > .ui-icon {
  width: 17px;
  flex: 0 0 auto;
}

.reports-quality > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reports-quality > div strong {
  color: var(--text);
}

.reports-quality > div span {
  line-height: 1.45;
}

.reports-point-detail {
  display: grid;
  gap: 18px;
}

.reports-point-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.reports-point-detail dl > div {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--panel-2);
}

.reports-point-detail dt {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reports-point-detail dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.reports-drilldown-list {
  display: grid;
  gap: 7px;
}

.reports-loading,
.reports-error,
.reports-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 36px 24px;
  color: var(--muted);
  text-align: center;
}

.reports-loading::before {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--blue-bright);
  border-radius: 50%;
  animation: reports-spin 800ms linear infinite;
  content: "";
}

.reports-loading > span:empty {
  display: none;
}

.reports-card > .reports-empty {
  min-height: 158px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.reports-error {
  border-color: rgba(229, 107, 120, 0.25);
  background: linear-gradient(135deg, var(--red-soft), transparent 55%), var(--panel);
}

.reports-empty h2,
.reports-error h2 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 17px;
}

.reports-empty p,
.reports-error p {
  max-width: 560px;
  margin-bottom: 0;
  font-size: 13px;
}

@keyframes reports-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1280px) {
  .reports-filters {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .reports-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .reports-page .page-head,
  .reports-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .reports-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .reports-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-chart-svg {
    height: 310px;
  }
}

@media (max-width: 680px) {
  .reports-page {
    gap: 11px;
  }

  .reports-filters,
  .reports-kpis {
    grid-template-columns: 1fr;
  }

  .reports-filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .reports-kpi {
    min-height: 104px;
  }

  .reports-card-head {
    padding: 14px;
  }

  .reports-chart {
    min-height: 280px;
    overflow-x: auto;
    padding-inline: 10px;
  }

  .reports-chart-svg {
    width: 680px;
    max-width: none;
    height: 280px;
  }

  .reports-chart-legend {
    min-width: 650px;
  }

  .reports-breakdown-row {
    grid-template-columns: minmax(92px, 1fr) minmax(80px, 1fr) auto;
  }

  .reports-quality {
    flex-wrap: wrap;
  }

  .reports-point-detail dl {
    grid-template-columns: 1fr;
  }

  .reports-leaderboard-wrap,
  .reports-chart-table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reports-loading::before {
    animation-duration: 1.8s;
  }

  .reports-chart-svg circle,
  .reports-leaderboard tbody tr {
    transition: none;
  }
}

/* Simplified tabbed reports */
.reports-page {
  gap: 0;
}

.reports-page .page-head {
  margin-bottom: 4px;
}

.reports-head-actions {
  gap: 9px;
}

.reports-export {
  min-height: 36px;
}

.reports-tabs.tabs {
  gap: 28px;
  margin: 4px 0 14px;
}

.reports-tabs .tab-button {
  min-height: 39px;
  padding: 0 2px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.reports-tabs .tab-button.active {
  color: var(--text);
}

.reports-tabs .tab-button:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
}

.reports-tab-panel {
  min-width: 0;
  display: grid;
  gap: 12px;
  outline: none;
}

.reports-filter-panel,
.reports-card,
.reports-kpi {
  border-radius: 10px;
}

.reports-filter-panel {
  padding: 12px 14px;
  background: var(--panel);
}

.reports-filters {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.reports-filter > span {
  font-size: 10px;
  letter-spacing: 0.06em;
}

.reports-filter select,
.reports-filter input {
  min-height: 36px;
  border-radius: 7px;
  font-size: 12px;
}

.reports-filter-chips > button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(124, 134, 237, 0.22);
  border-radius: 999px;
  background: rgba(93, 102, 202, 0.1);
  color: var(--accent-text);
  font-size: 11px;
}

.reports-filter-chip > span {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.reports-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.reports-kpi {
  min-height: 112px;
  gap: 8px;
  padding: 15px 16px;
  background: var(--panel);
}

.reports-kpi::before {
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 134, 237, 0.42), transparent);
  content: "";
}

.reports-kpi {
  position: relative;
}

.reports-kpi-value {
  font-size: clamp(23px, 2vw, 30px);
}

.reports-kpi-foot {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.reports-kpi-detail {
  min-height: 0;
}

.reports-kpi-delta {
  flex: 0 0 auto;
}

.reports-kpi-delta small {
  display: none;
}

.reports-kpi-delta.neutral {
  display: none;
}

.reports-card-head {
  min-height: 70px;
  align-items: center;
  padding: 16px 18px;
}

.reports-card-copy h2 {
  font-size: 16px;
  letter-spacing: -0.015em;
}

.reports-card-copy .eyebrow {
  margin-bottom: 5px;
  color: var(--accent-text);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.reports-timeline {
  min-height: 0;
}

.reports-metric-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--field);
}

.reports-metric-switch button {
  min-height: 30px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 580;
}

.reports-metric-switch button:hover,
.reports-metric-switch button:focus-visible {
  color: var(--text);
}

.reports-metric-switch button.active {
  background: var(--panel-hover);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

.reports-chart-legend {
  min-width: 0;
  gap: 12px 22px;
  padding: 14px 20px 0;
}

.reports-chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.reports-chart-legend > span > i {
  width: 18px;
  height: 1px;
  border-radius: 999px;
  background: var(--blue-bright);
}

.reports-chart-legend > span.comparison > i {
  background: repeating-linear-gradient(90deg, #858a9c 0 5px, transparent 5px 8px);
}

.reports-chart-legend strong {
  color: var(--text);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.reports-chart {
  min-height: 290px;
  padding: 8px 20px 14px;
  background: linear-gradient(180deg, rgba(124, 134, 237, 0.018), transparent 68%);
}

.reports-chart-svg {
  height: clamp(270px, 28vw, 340px);
}

.reports-chart-gridline {
  stroke: var(--chart-grid);
  stroke-dasharray: 3 7;
}

.reports-chart-axis-label {
  fill: #777b88;
  font-size: 11px;
}

.reports-chart-area {
  pointer-events: none;
}

.reports-chart-line,
.reports-chart-comparison {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reports-chart-line {
  stroke-width: var(--chart-line-width);
}

.reports-chart-comparison {
  stroke-width: var(--chart-comparison-line-width);
}

.reports-chart-hit {
  fill: transparent !important;
  stroke: transparent !important;
  cursor: pointer;
}

.reports-chart-dot {
  pointer-events: none;
  stroke: var(--chart-dot) !important;
  stroke-width: var(--chart-point-stroke-width) !important;
  transition: opacity 120ms ease, transform 120ms ease;
}

.reports-chart-series.comparison .reports-chart-dot {
  opacity: 0;
}

.reports-chart-hit:hover + .reports-chart-dot,
.reports-chart-hit:focus + .reports-chart-dot {
  filter: drop-shadow(0 0 5px rgba(124, 134, 237, 0.64));
  transform: scale(1.5);
}

.reports-chart-table-wrap {
  margin: 0 18px 16px;
  border-radius: 7px;
}

.reports-chart-table-wrap > summary {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 11px;
}

.reports-tab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reports-tab-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.reports-breakdown-list,
.reports-source-list {
  display: grid;
  gap: 1px;
  padding: 7px;
}

.reports-source-row {
  min-height: 49px;
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(100px, 1.4fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
}

.reports-source-row > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reports-source-row strong {
  color: var(--text);
  font-weight: 590;
}

.reports-source-row small {
  color: var(--muted);
  font-size: 10px;
}

.reports-breakdown-meter {
  height: 5px;
  background: var(--line-subtle);
}

.reports-breakdown-meter > i,
.reports-breakdown-meter > span {
  background: #727de6;
}

.reports-leaderboard-card {
  overflow: hidden;
}

.reports-leaderboard th,
.reports-leaderboard td {
  padding: 12px 16px;
}

.reports-leaderboard td:first-child,
.reports-leaderboard th:first-child {
  text-align: left;
}

.reports-leaderboard .primary-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reports-team-rank {
  width: 25px;
  height: 25px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-subtle);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.reports-leaderboard-person {
  min-height: 30px;
  padding: 4px 6px;
}

.reports-about {
  width: fit-content;
  color: var(--muted);
  font-size: 11px;
}

.reports-about > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 1px;
  color: var(--muted);
  cursor: pointer;
}

.reports-about > summary .ui-icon {
  width: 13px;
  height: 13px;
}

.reports-about > div {
  max-width: 760px;
  padding: 8px 0 3px;
}

.reports-about p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.reports-about dl {
  display: grid;
  gap: 7px;
  margin: 0 0 8px;
}

.reports-about dl > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
}

.reports-about dt {
  color: var(--text);
  font-weight: 600;
}

.reports-about dd {
  margin: 0;
}

.reports-page .reports-error.notice {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  text-align: left;
}

@media (max-width: 940px) {
  .reports-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reports-card-head {
    align-items: flex-start;
  }

  .reports-metric-switch {
    width: fit-content;
  }
}

@media (max-width: 680px) {
  .reports-tabs.tabs {
    overflow-x: auto;
    gap: 24px;
    margin-top: 2px;
  }

  .reports-tabs .tab-button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .reports-tab-panel {
    gap: 10px;
  }

  .reports-filters,
  .reports-kpis,
  .reports-tab-grid {
    grid-template-columns: 1fr;
  }

  .reports-kpi {
    min-height: 98px;
  }

  .reports-kpi-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .reports-card-head {
    gap: 12px;
    padding: 14px;
  }

  .reports-metric-switch {
    width: 100%;
  }

  .reports-metric-switch button {
    flex: 1 1 0;
  }

  .reports-chart-legend {
    min-width: 0;
    flex-wrap: wrap;
    padding: 12px 14px 0;
  }

  .reports-chart {
    padding-inline: 8px;
  }

  .reports-chart-svg {
    width: 620px;
    height: 270px;
  }

  .reports-source-row,
  .reports-breakdown-row {
    grid-template-columns: minmax(100px, 1fr) auto;
  }

  .reports-source-row .reports-breakdown-meter,
  .reports-breakdown-row .reports-breakdown-meter {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .reports-about dl > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  letter-spacing: -0.015em;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 650;
  line-height: 1.18;
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 650;
}

h3 {
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 640;
}

.hidden {
  display: none !important;
}

.ui-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: -0.18em;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

.loading-screen {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
  color: var(--muted);
}

.loading-screen img {
  width: 112px;
  max-height: 34px;
  object-fit: contain;
  filter: var(--logo-filter);
}

.loading-screen::after {
  width: 136px;
  height: 2px;
  content: "";
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent 0%, var(--blue) 48%, transparent 100%);
  background-size: 70% 100%;
  animation: loading 1.2s ease-in-out infinite;
}

@keyframes loading {
  from { background-position: -130px 0; }
  to { background-position: 180px 0; }
}

.auth-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 52px);
  background:
    radial-gradient(circle at 16% 14%, rgba(98, 108, 213, 0.2), transparent 30%),
    radial-gradient(circle at 82% 88%, rgba(98, 211, 167, 0.08), transparent 26%),
    var(--bg);
}

.auth-layout {
  width: min(1040px, 100%);
  min-height: min(720px, calc(100svh - clamp(36px, 8vw, 104px)));
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-story {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 38px;
  background:
    linear-gradient(150deg, rgba(124, 134, 237, 0.14), transparent 44%),
    linear-gradient(180deg, var(--panel), var(--sidebar));
}

.auth-card {
  min-width: 0;
  display: grid;
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  border-left: 1px solid var(--line-subtle);
  background: var(--panel);
}

.auth-card-inner {
  width: min(480px, 100%);
  margin: auto;
}

.auth-card[data-auth-view="activate"] {
  align-items: start;
}

.auth-heading {
  margin-bottom: 27px;
}

.auth-heading h1 {
  margin-bottom: 9px;
  font-size: clamp(27px, 3.2vw, 36px);
}

.auth-heading h1:focus {
  outline: none;
}

.auth-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
}

.auth-brand {
  width: fit-content;
  color: var(--text);
  text-decoration: none;
}

.auth-brand img,
.brand-logo {
  width: 92px;
  max-height: 28px;
  object-fit: contain;
  object-position: left center;
  filter: var(--logo-filter);
}

.auth-brand span,
.brand span {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-story-copy {
  margin: auto 0;
  padding: 50px 0;
}

.auth-story-copy h2 {
  max-width: 390px;
  margin-bottom: 14px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
}

.auth-story-copy > p:not(.eyebrow) {
  max-width: 390px;
  color: var(--muted);
  font-size: 14px;
}

.auth-assurances {
  display: grid;
  gap: 17px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.auth-assurances li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.auth-assurances .ui-icon {
  width: 20px;
  height: 20px;
  color: var(--blue-bright);
}

.auth-assurances li > span:last-child {
  display: grid;
  gap: 2px;
}

.auth-assurances strong {
  color: var(--text);
  font-size: 13px;
}

.auth-story-foot {
  margin: 0;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-intro {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  gap: 0;
}

.auth-form > label:not(.auth-check),
.auth-password-label {
  margin-bottom: 7px;
}

.auth-form > input,
.auth-form > select,
.auth-form > textarea {
  margin-bottom: 16px;
}

.auth-form > input[aria-describedby] {
  margin-bottom: 7px;
}

.auth-form > .form-hint {
  margin: 0 0 16px;
}

.auth-form > .form-error {
  margin: 0 0 12px;
}

.auth-password-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-password-label label {
  display: block;
}

.auth-password-label a,
.auth-back-link a {
  color: var(--accent-link);
  font-size: 12px;
  text-underline-offset: 3px;
}

.auth-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field.span-2 {
  grid-column: 1 / -1;
}

.auth-field label span {
  color: var(--dim);
  font-weight: 450;
}

.auth-form > .auth-field {
  margin-bottom: 16px;
}

.auth-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: var(--muted);
}

.auth-check input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.auth-assignment {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  margin: -8px 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--line-subtle);
  border-radius: 9px;
  background: var(--field);
}

.auth-assignment > span:first-child {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-assignment strong {
  grid-column: 1;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}

.auth-role {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 650;
}

.auth-back-link {
  margin: 18px 0 0;
  text-align: center;
}

.auth-result {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 0 0 22px;
  padding: 24px;
  border: 1px solid var(--line-subtle);
  border-radius: 12px;
  background: var(--field);
  color: var(--muted);
  text-align: center;
}

.auth-result p {
  margin: 0;
}

.auth-result-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.auth-result-icon .ui-icon {
  width: 25px;
  height: 25px;
}

.auth-result.success .auth-result-icon {
  background: var(--green-soft);
  color: var(--green);
}

.auth-result.error .auth-result-icon {
  background: var(--red-soft);
  color: var(--red);
}

.auth-result-error {
  margin-top: 12px;
  text-align: center;
}

.stack-form,
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.invite-access-field {
  align-self: start;
  align-content: start;
}

.assignment-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 500;
}

.assignment-toggle input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

label,
.field-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--field);
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8e99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

select:not([multiple]):not([size]):focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c86ed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(98, 108, 213, 0.18);
}

.form-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--red);
  font-size: 12px;
}

.form-hint {
  color: var(--dim);
  font-size: 11px;
  font-weight: 450;
}

.button,
.icon-button,
.text-button,
.segmented button,
.tab-button {
  border: 0;
  background: none;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

/* Author-level display rules otherwise override the browser's hidden state. */
.button[hidden],
.icon-button[hidden],
.text-button[hidden] {
  display: none !important;
}

.button:hover {
  border-color: #454750;
  background: var(--panel-hover);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.button.primary:hover {
  border-color: var(--blue-bright);
  background: var(--blue-bright);
}

.button.danger {
  border-color: rgba(239, 127, 130, 0.25);
  background: var(--red-soft);
  color: var(--danger-text);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.button.wide {
  width: 100%;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.text-button {
  padding: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.text-button:hover {
  color: var(--text);
}

.security-note,
.demo-access {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-subtle);
  color: var(--dim);
  font-size: 11px;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 7px;
}

.demo-access {
  display: grid;
  gap: 2px;
}

.demo-access strong {
  color: var(--orange);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--line-subtle);
  background: var(--sidebar);
}

.brand {
  min-height: 45px;
  padding: 0 10px;
}

.avatar {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
}

.profile > span:nth-child(2) {
  min-width: 0;
  display: grid;
  flex: 1;
}

.profile strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile small {
  overflow: hidden;
  color: var(--dim);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav {
  display: grid;
  gap: 3px;
  margin-top: 21px;
}

.nav-item {
  position: relative;
  isolation: isolate;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  text-align: left;
  transform: translateZ(0);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 180ms ease,
    color 160ms ease,
    transform 110ms ease;
}

.nav-item::before,
.nav-item::after {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  content: '';
}

.nav-item::before {
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 24% 50%, rgba(124, 134, 237, 0.2), transparent 58%);
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 160ms ease, transform 180ms ease;
}

.nav-item::after {
  top: 5px;
  right: -1px;
  bottom: 5px;
  width: 3px;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(180deg, rgba(155, 138, 251, 0), var(--purple) 24%, var(--purple) 76%, rgba(155, 138, 251, 0));
  box-shadow: -2px 0 10px rgba(155, 138, 251, 0.48);
  opacity: 0;
  transform: translateX(3px) scaleY(0.45);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-item .ui-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.65;
  transition: color 160ms ease, filter 180ms ease, transform 180ms ease;
}

.nav-item:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.035);
  background: var(--hover-fill);
  color: var(--text);
}

.nav-item:focus-visible {
  outline: 2px solid rgba(124, 134, 237, 0.82);
  outline-offset: 2px;
}

.nav-item:active {
  transform: translateY(1px) scale(0.985);
}

.nav-item:active::before {
  opacity: 1;
  transform: scale(1);
}

.nav-item.active {
  border-color: rgba(155, 138, 251, 0.17);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0%, rgba(255, 255, 255, 0.018) 55%, rgba(98, 108, 213, 0.065) 77%, rgba(155, 138, 251, 0.16) 100%),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    inset -6px 0 14px rgba(155, 138, 251, 0.055),
    0 5px 14px rgba(0, 0, 0, 0.13);
  color: var(--accent-text-strong);
}

.nav-item.active:hover {
  border-color: rgba(155, 138, 251, 0.23);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.022) 55%, rgba(98, 108, 213, 0.08) 77%, rgba(155, 138, 251, 0.2) 100%),
    var(--panel);
}

.nav-item.active::after {
  opacity: 1;
  transform: translateX(0) scaleY(1);
}

.nav-item.active .ui-icon {
  color: var(--accent-text-strong);
  filter: drop-shadow(0 0 4px rgba(155, 138, 251, 0.24));
}

@media (prefers-reduced-motion: reduce) {
  .nav-item,
  .nav-item::before,
  .nav-item::after,
  .nav-item .ui-icon {
    transition: none;
  }

  .nav-item:active {
    transform: none;
  }
}

.sidebar-bottom {
  display: grid;
  gap: 5px;
  margin-top: auto;
}

.profile {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.profile:hover {
  border-color: var(--line-subtle);
  background: var(--panel);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.profile > .ui-icon {
  width: 14px;
  color: var(--dim);
}

.main-content {
  min-width: 0;
  background: var(--bg);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--topbar);
  backdrop-filter: blur(12px);
}

.breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--dim);
  font-size: 12px;
}

.breadcrumb-link {
  min-width: 0;
  padding: 3px 2px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.breadcrumb-link:hover {
  color: var(--text);
  background: var(--hover-fill);
}

.breadcrumb-link:active {
  transform: scale(0.97);
}

.breadcrumb-link:focus-visible {
  outline: 2px solid rgba(139, 154, 255, 0.72);
  outline-offset: 2px;
}

.breadcrumb-current {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb-separator {
  flex: 0 0 auto;
  color: var(--dim);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.global-search {
  width: min(330px, 31vw);
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--field);
}

.global-search > .ui-icon {
  width: 15px;
  color: var(--dim);
}

.global-search input {
  min-width: 0;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 11px;
}

.global-search kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--dim);
  font: 9px inherit;
  white-space: nowrap;
}

#notificationButton {
  position: relative;
}

.global-search-form {
  gap: 14px;
}

.global-search-results {
  max-height: min(58vh, 560px);
  overflow: auto;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.global-search-group + .global-search-group {
  border-top: 1px solid var(--line-subtle);
}

.global-search-group > .eyebrow {
  margin: 0;
  padding: 12px 15px 7px;
}

.global-search-result {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.global-search-result .action-copy small {
  overflow: hidden;
  color: var(--dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-kind {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.global-search-empty {
  min-height: 110px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 24px;
  color: var(--dim);
  text-align: center;
}

.global-search-empty strong {
  color: var(--text);
  font-size: 12px;
}

.global-search-empty span {
  font-size: 10px;
}

#notificationButton b {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--bg);
  border-radius: 50%;
  background: var(--red);
}

.mode-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  white-space: nowrap;
}

.mode-pill {
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid var(--line-subtle);
  color: var(--dim);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mobile-menu {
  display: none;
}

.view {
  width: min(1540px, 100%);
  min-height: calc(100vh - 65px);
  margin: 0 auto;
  padding: 25px 27px 48px;
  outline: none;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.page-actions,
.inline-actions,
.filter-bar,
.panel-head,
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel,
.metric-card,
.record-card {
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel {
  overflow: hidden;
}

.panel-head {
  min-height: 54px;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-subtle);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
}

.panel-head p {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 11px;
}

.panel-body {
  padding: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 13px;
}

.metric-card {
  min-height: 112px;
  padding: 15px;
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.metric-label .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--dim);
}

.metric-value {
  display: block;
  margin: 12px 0 5px;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-detail {
  color: var(--dim);
  font-size: 10px;
}

.metric-detail.positive {
  color: var(--green);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 13px;
}

.dashboard-grid + .dashboard-grid {
  margin-top: 13px;
}

.action-list,
.timeline,
.result-list,
.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.action-row,
.timeline-item,
.notification-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line-subtle);
}

.action-row:last-child,
.timeline-item:last-child,
.notification-item:last-child {
  border-bottom: 0;
}

.action-row:hover {
  background: var(--panel-hover);
}

.action-icon,
.activity-dot {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--accent-text);
}

.action-icon.warning {
  background: var(--orange-soft);
  color: var(--orange);
}

.action-icon.danger {
  background: var(--red-soft);
  color: var(--red);
}

.action-icon.success {
  background: var(--green-soft);
  color: var(--green);
}

.action-icon .ui-icon {
  width: 15px;
  height: 15px;
  display: block;
}

.action-copy,
.notification-copy {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 2px;
}

.action-copy strong,
.notification-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 590;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-copy span,
.notification-copy span {
  overflow: hidden;
  color: var(--dim);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-row time,
.timeline-item time {
  color: var(--dim);
  font-size: 10px;
  white-space: nowrap;
}

.stage-bars {
  display: grid;
  gap: 13px;
}

.stage-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

.stage-bar-label strong {
  color: var(--text);
}

.bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-subtle);
}

.bar-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
}

/* Dashboard command center */
.dashboard-page {
  display: grid;
  gap: 14px;
}

.dashboard-hero {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 1px 8px;
}

.dashboard-hero-copy,
.dashboard-title-line {
  min-width: 0;
}

.dashboard-title-line {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.dashboard-title-line h1 {
  margin: 0;
  font-size: clamp(25px, 2.35vw, 34px);
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.dashboard-title-line time {
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
}

.dashboard-hero-copy > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-hero-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.dashboard-kpi {
  min-width: 0;
  min-height: 126px;
  display: flex;
  padding: 16px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  flex-direction: column;
  background:
    radial-gradient(circle at 96% -20%, rgba(124, 134, 237, 0.13), transparent 46%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 58%),
    var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.dashboard-kpi:hover {
  border-color: rgba(124, 134, 237, 0.34);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.dashboard-kpi:active,
.dashboard-pipeline-stage:active,
.dashboard-priority-row:active,
.dashboard-closing-list > button:active,
.dashboard-risk-stats button:active {
  transform: scale(0.985);
}

.dashboard-kpi:focus-visible,
.dashboard-pipeline-stage:focus-visible,
.dashboard-priority-row:focus-visible,
.dashboard-closing-list > button:focus-visible,
.dashboard-risk-stats button:focus-visible,
.dashboard-icon-button:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

.dashboard-kpi.danger {
  background:
    radial-gradient(circle at 98% -10%, rgba(229, 107, 120, 0.12), transparent 45%),
    var(--panel);
}

.dashboard-kpi.positive {
  background:
    radial-gradient(circle at 98% -10%, rgba(98, 211, 167, 0.1), transparent 45%),
    var(--panel);
}

.dashboard-kpi-top,
.dashboard-kpi-foot,
.dashboard-pipeline-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dashboard-kpi-top {
  color: var(--muted);
  font-size: 11px;
  font-weight: 540;
}

.dashboard-kpi-icon {
  width: 28px;
  height: 28px;
  display: grid;
  border: 1px solid rgba(124, 134, 237, 0.16);
  border-radius: 9px;
  place-items: center;
  background: rgba(124, 134, 237, 0.08);
  color: var(--accent-text);
}

.dashboard-kpi.danger .dashboard-kpi-icon {
  border-color: rgba(229, 107, 120, 0.17);
  background: var(--red-soft);
  color: var(--red);
}

.dashboard-kpi.positive .dashboard-kpi-icon {
  border-color: rgba(98, 211, 167, 0.16);
  background: var(--green-soft);
  color: var(--green);
}

.dashboard-kpi-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.dashboard-kpi-value {
  display: block;
  margin: 15px 0 11px;
  font-size: clamp(25px, 2.4vw, 32px);
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 1;
}

.dashboard-kpi-foot {
  margin-top: auto;
  color: var(--dim);
  font-size: 10px;
}

.dashboard-kpi-foot > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi-delta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-weight: 650;
}

.dashboard-kpi-delta .ui-icon {
  width: 11px;
  height: 11px;
}

.dashboard-kpi-delta.positive {
  color: var(--green);
}

.dashboard-kpi-delta.negative {
  color: var(--red);
}

.dashboard-kpi-delta.negative .ui-icon {
  transform: rotate(90deg);
}

.dashboard-primary-grid,
.dashboard-secondary-grid {
  display: grid;
  gap: 14px;
}

.dashboard-primary-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
}

.dashboard-secondary-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.8fr);
}

.dashboard-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.018), transparent 45%),
    var(--panel);
}

.dashboard-card-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line-subtle);
}

.dashboard-card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.018em;
}

.dashboard-card-head p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 10px;
}

.dashboard-card-head .text-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.dashboard-card-head .text-button .ui-icon {
  width: 12px;
  height: 12px;
}

.dashboard-icon-button {
  width: 31px;
  height: 31px;
  display: grid;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  place-items: center;
  background: var(--quiet-fill);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.dashboard-icon-button:hover {
  border-color: rgba(124, 134, 237, 0.4);
  background: var(--blue-soft);
  color: var(--accent-text);
}

.dashboard-icon-button .ui-icon {
  width: 14px;
  height: 14px;
}

.dashboard-priority-list {
  display: grid;
}

.dashboard-priority-row {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 15px;
  border: 0;
  border-bottom: 1px solid var(--line-subtle);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color 150ms ease, transform 150ms ease;
}

button.dashboard-priority-row {
  cursor: pointer;
}

.dashboard-priority-row:last-child {
  border-bottom: 0;
}

button.dashboard-priority-row:hover {
  background: var(--hover-fill);
}

.dashboard-priority-icon {
  width: 34px;
  height: 34px;
  display: grid;
  border-radius: 10px;
  place-items: center;
  background: var(--blue-soft);
  color: var(--accent-text);
}

.dashboard-priority-icon.danger {
  background: var(--red-soft);
  color: var(--red);
}

.dashboard-priority-icon .ui-icon {
  width: 15px;
  height: 15px;
}

.dashboard-priority-copy,
.dashboard-priority-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dashboard-priority-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-priority-copy span,
.dashboard-priority-meta span {
  overflow: hidden;
  color: var(--dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-priority-meta {
  min-width: 96px;
  text-align: right;
}

.dashboard-priority-meta strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.dashboard-priority-meta.overdue strong {
  color: var(--red);
}

.dashboard-priority-meta.today strong {
  color: var(--orange);
}

.dashboard-pipeline-list {
  display: grid;
  gap: 3px;
  padding: 10px 14px 13px;
}

.dashboard-pipeline-stage {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 8px 3px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.dashboard-pipeline-stage:hover {
  background: var(--quiet-fill);
}

.dashboard-pipeline-label {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-pipeline-label > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.dashboard-pipeline-label > span i {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--blue-bright);
  box-shadow: 0 0 0 4px rgba(124, 134, 237, 0.08);
}

.dashboard-pipeline-label strong {
  color: var(--text);
  font-size: 9px;
  font-weight: 590;
  white-space: nowrap;
}

.dashboard-pipeline-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track-fill);
}

.dashboard-pipeline-track > i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #6974dc, #8991f3);
  box-shadow: 0 0 14px rgba(124, 134, 237, 0.28);
}

.dashboard-pipeline-stage small {
  margin-top: -3px;
  color: var(--red);
  font-size: 8px;
  text-align: right;
}

.dashboard-chart-summary {
  display: flex;
  align-items: center;
  gap: 13px;
}

.dashboard-chart-summary > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.dashboard-loan-volume {
  width: 100%;
  min-height: 410px;
  background:
    radial-gradient(circle at 8% -26%, rgba(124, 134, 237, 0.16), transparent 39%),
    radial-gradient(circle at 93% 7%, rgba(85, 214, 173, 0.08), transparent 28%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.022), transparent 48%),
    var(--panel);
}

.dashboard-volume-head {
  min-height: 78px;
  padding: 17px 20px;
}

.dashboard-volume-head h2 {
  font-size: 17px;
  letter-spacing: -0.025em;
}

.dashboard-volume-head p {
  margin-top: 5px;
  font-size: 10px;
}

.dashboard-volume-summary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-volume-summary > span {
  min-width: 112px;
  display: grid;
  gap: 2px;
  padding: 8px 11px;
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
  background: var(--quiet-fill);
}

.dashboard-volume-summary small {
  color: var(--dim);
  font-size: 8px;
  font-weight: 570;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.dashboard-volume-summary strong {
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.dashboard-volume-summary > span[data-series="1"] strong {
  color: var(--green);
}

.dashboard-volume-toolbar {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 20px 0;
}

.dashboard-volume-toolbar .dashboard-chart-legend {
  min-height: 25px;
  padding: 0;
}

.dashboard-volume-range {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--quiet-fill);
}

.dashboard-volume-range button {
  min-width: 51px;
  min-height: 25px;
  padding: 4px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  font-size: 9px;
  font-weight: 620;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.dashboard-volume-range button:hover {
  color: var(--text);
}

.dashboard-volume-range button.active {
  background: var(--panel-hover);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.dashboard-volume-range button:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 1px;
}

.dashboard-volume-chart-wrap {
  min-height: 297px;
  padding: 0 17px 4px 5px;
}

.dashboard-volume-chart {
  height: 286px;
}

.dashboard-volume-chart .dashboard-chart-area {
  fill: url(#dashboardLoanVolumeChartGradient);
}

.dashboard-volume-chart .dashboard-chart-line {
  stroke-width: var(--chart-line-width);
}

.dashboard-volume-chart .dashboard-chart-line[data-series="1"] {
  stroke-dasharray: 8 7;
}

.dashboard-volume-chart circle {
  opacity: 0;
  pointer-events: none;
}

.dashboard-volume-chart circle[data-last="true"] {
  opacity: 1;
}

.dashboard-chart-wrap {
  min-height: 260px;
  padding: 4px 9px 7px 4px;
}

.dashboard-chart-legend {
  min-height: 31px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 9px 12px 0 50px;
  color: var(--dim);
  font-size: 9px;
}

.dashboard-chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-chart-legend strong {
  color: var(--muted);
  font-weight: 650;
}

.dashboard-chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #818af0;
  box-shadow: 0 0 0 3px rgba(129, 138, 240, 0.1);
}

.dashboard-chart-legend i[data-series="1"] {
  background: #55d6ad;
  box-shadow: 0 0 0 3px rgba(85, 214, 173, 0.1);
}

.dashboard-chart-legend .comparison i {
  width: 13px;
  height: 0;
  border-top: 1px dashed #777b8c;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-chart-svg {
  width: 100%;
  height: 260px;
  display: block;
  overflow: visible;
}

.dashboard-chart-svg text {
  fill: var(--dim);
  font-size: 9px;
}

.dashboard-chart-gridline {
  stroke: var(--chart-grid);
  stroke-width: var(--chart-grid-width);
  vector-effect: non-scaling-stroke;
}

.dashboard-chart-area {
  fill: url(#dashboardChartGradient);
  stroke: none;
}

.dashboard-chart-line,
.dashboard-chart-comparison {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.dashboard-chart-line {
  stroke: #818af0;
  stroke-width: var(--chart-line-width);
  filter: drop-shadow(0 5px 8px rgba(98, 108, 213, 0.25));
}

.dashboard-chart-line[data-series="1"] {
  stroke: #55d6ad;
  filter: drop-shadow(0 5px 8px rgba(85, 214, 173, 0.18));
}

.dashboard-chart-comparison {
  stroke: #818af0;
  stroke-width: var(--chart-comparison-line-width);
  stroke-dasharray: 5 6;
  opacity: 0.38;
}

.dashboard-chart-comparison[data-series="1"] {
  stroke: #55d6ad;
}

.dashboard-chart-svg circle {
  fill: var(--panel);
  stroke: #9ba2fa;
  stroke-width: var(--chart-point-stroke-width);
  transition: r 120ms ease, fill 120ms ease;
}

.dashboard-chart-svg circle[data-series="1"] {
  stroke: #70dfbd;
}

.dashboard-chart-svg circle:hover,
.dashboard-chart-svg circle:focus {
  r: 6;
  fill: #818af0;
  outline: none;
}

.dashboard-chart-svg circle[data-series="1"]:hover,
.dashboard-chart-svg circle[data-series="1"]:focus {
  fill: #55d6ad;
}

.dashboard-chart-empty {
  min-height: 250px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--dim);
  text-align: center;
}

.dashboard-chart-empty .ui-icon {
  width: 22px;
  height: 22px;
}

.dashboard-chart-empty strong {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-chart-empty span {
  font-size: 9px;
}

.dashboard-risk-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-subtle);
}

.dashboard-risk-stats button {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 0;
  border-right: 1px solid var(--line-subtle);
  background: var(--quiet-fill);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.dashboard-risk-stats button:last-child {
  border-right: 0;
}

.dashboard-risk-stats button:hover {
  background: var(--hover-fill);
}

.dashboard-risk-stats button > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: var(--dim);
  font-size: 8px;
  white-space: nowrap;
}

.dashboard-risk-stats button .ui-icon {
  width: 11px;
  height: 11px;
}

.dashboard-risk-stats button strong {
  font-size: 19px;
  font-weight: 660;
}

.dashboard-closing-list {
  display: grid;
  padding: 4px 0;
}

.dashboard-closing-list > button {
  width: 100%;
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-subtle);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.dashboard-closing-list > button:last-child {
  border-bottom: 0;
}

.dashboard-closing-list > button:hover {
  background: var(--hover-fill);
}

.dashboard-closing-date {
  width: 36px;
  height: 39px;
  display: grid;
  align-content: center;
  border: 1px solid rgba(124, 134, 237, 0.2);
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--accent-text);
  text-align: center;
}

.dashboard-closing-date strong {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.dashboard-closing-date span {
  margin-top: -1px;
  font-size: 14px;
  font-weight: 680;
}

.dashboard-closing-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dashboard-closing-copy strong {
  font-size: 10px;
  font-weight: 620;
}

.dashboard-closing-copy span {
  overflow: hidden;
  color: var(--dim);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-closing-list .badge {
  font-size: 7px;
  white-space: nowrap;
}

.dashboard-closing-empty,
.dashboard-empty {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: var(--dim);
  text-align: left;
}

.dashboard-empty.compact {
  min-height: 210px;
}

.dashboard-empty > .ui-icon {
  width: 23px;
  height: 23px;
  color: var(--green);
}

.dashboard-empty > div {
  display: grid;
  gap: 3px;
}

.dashboard-empty strong {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-empty span,
.dashboard-closing-empty {
  font-size: 9px;
}

@media (max-width: 1120px) {
  .dashboard-primary-grid,
  .dashboard-secondary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-pipeline-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
  }
}

@media (max-width: 820px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .dashboard-hero-actions {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .dashboard-page {
    gap: 11px;
  }

  .dashboard-hero {
    min-height: 0;
    padding-bottom: 4px;
  }

  .dashboard-title-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .dashboard-title-line h1 {
    font-size: 25px;
  }

  .dashboard-title-line time {
    font-size: 10px;
  }

  .dashboard-hero-copy > p {
    max-width: 34ch;
    font-size: 11px;
    line-height: 1.5;
  }

  .dashboard-hero-actions .button {
    flex: 1;
    justify-content: center;
  }

  .dashboard-kpi-grid {
    gap: 8px;
  }

  .dashboard-kpi {
    min-height: 112px;
    padding: 13px;
  }

  .dashboard-kpi-value {
    margin: 12px 0 9px;
    font-size: 24px;
  }

  .dashboard-kpi-top,
  .dashboard-kpi-foot {
    font-size: 9px;
  }

  .dashboard-kpi-foot > span:first-child {
    max-width: 13ch;
  }

  .dashboard-kpi-icon {
    width: 25px;
    height: 25px;
  }

  .dashboard-card-head {
    min-height: 61px;
    padding: 13px;
  }

  .dashboard-card-head p {
    max-width: 32ch;
  }

  .dashboard-volume-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .dashboard-volume-summary {
    width: 100%;
  }

  .dashboard-volume-summary > span {
    min-width: 0;
    flex: 1;
  }

  .dashboard-volume-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 9px 13px 2px;
  }

  .dashboard-volume-toolbar .dashboard-chart-legend {
    padding-left: 0;
  }

  .dashboard-volume-range {
    width: 100%;
  }

  .dashboard-volume-range button {
    min-width: 0;
    flex: 1;
  }

  .dashboard-volume-chart-wrap {
    min-height: 278px;
    overflow-x: auto;
    padding-right: 9px;
  }

  .dashboard-volume-chart {
    width: 660px;
    min-height: 238px;
    height: 238px;
  }

  .dashboard-priority-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px 12px;
  }

  .dashboard-priority-meta {
    min-width: 70px;
  }

  .dashboard-priority-meta span {
    display: none;
  }

  .dashboard-pipeline-list {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-summary > span {
    display: none;
  }

  .dashboard-chart-wrap {
    min-height: 251px;
    height: auto;
  }

  .dashboard-chart-svg {
    min-height: 220px;
    height: 220px;
  }

  .dashboard-chart-legend {
    min-height: 0;
    padding: 9px 8px 0 42px;
  }

  .dashboard-risk-stats button {
    padding: 11px 9px;
  }

  .dashboard-risk-stats button > span {
    align-items: flex-start;
    flex-direction: column;
    white-space: normal;
  }

  .dashboard-closing-list > button {
    grid-template-columns: 36px minmax(0, 1fr);
    padding-inline: 12px;
  }

  .dashboard-closing-list .badge {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-kpi,
  .dashboard-priority-row,
  .dashboard-pipeline-stage,
  .dashboard-risk-stats button,
  .dashboard-closing-list > button,
  .dashboard-chart-svg circle,
  .dashboard-volume-range button {
    transition: none;
  }

  .dashboard-kpi:hover,
  .dashboard-kpi:active,
  .dashboard-priority-row:active,
  .dashboard-pipeline-stage:active,
  .dashboard-risk-stats button:active,
  .dashboard-closing-list > button:active {
    transform: none;
  }
}

.filter-bar {
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel);
}

.filter-bar .filter-search {
  width: min(330px, 100%);
}

.filter-bar input,
.filter-bar select {
  min-height: 34px;
  font-size: 11px;
}

.filter-bar select {
  width: auto;
  min-width: 150px;
}

.filter-spacer {
  flex: 1;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--field);
}

.segmented button {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
}

.segmented button.active {
  background: var(--panel-hover);
  color: var(--text);
}

.segmented .ui-icon {
  width: 13px;
  height: 13px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th {
  height: 40px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--dim);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table-sort-button {
  display: inline-flex;
  min-width: 0;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button:focus-visible,
.table-sort-button.is-active {
  color: var(--text);
}

.table-sort-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.table-sort-button .ui-icon {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  opacity: 0.35;
}

.table-sort-button.is-active .ui-icon {
  color: var(--accent-bright);
  opacity: 0.82;
}

.data-table td {
  height: 57px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--muted);
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 100ms ease;
}

.data-table tbody tr:hover {
  background: var(--panel-hover);
}

.data-table .primary-cell {
  max-width: 230px;
  color: var(--text);
  cursor: pointer;
}

.directory-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.directory-initials {
  width: 32px;
  height: 32px;
  display: inline-grid;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid rgba(124, 134, 237, 0.28);
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
}

.assignee-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-grid;
  overflow: hidden;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid rgba(124, 134, 237, 0.28);
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
}

.assignee-avatar-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.assignee-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.assignee-avatar--compact {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 6px;
  font-size: 7px;
}

.assignee-identity,
.assignee-detail,
.card-assignee,
.lead-compose-assignee {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.assignee-identity-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.assignee-identity-copy strong,
.assignee-identity-copy small,
.card-assignee > span:last-child,
.lead-compose-assignee > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignee-identity-copy strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 620;
}

.assignee-identity-copy small {
  color: var(--dim);
  font-size: 9px;
}

.table-assignee {
  min-width: 132px;
}

.directory-person-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.primary-cell strong,
.primary-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-cell strong {
  font-size: 12px;
  font-weight: 610;
}

.primary-cell small {
  margin-top: 2px;
  color: var(--dim);
  font-size: 10px;
}

.unread-indicator {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(98, 108, 213, 0.34);
  border-radius: 999px;
  background: rgba(98, 108, 213, 0.1);
  color: var(--accent-text);
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.unread-indicator .ui-icon {
  width: 11px;
  height: 11px;
}

.badge {
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 630;
}

.badge.blue {
  border-color: rgba(98, 108, 213, 0.26);
  background: var(--blue-soft);
  color: var(--accent-text);
}

.badge.green {
  border-color: rgba(98, 211, 167, 0.22);
  background: var(--green-soft);
  color: var(--success-text);
}

.badge.amber {
  border-color: rgba(225, 173, 96, 0.22);
  background: var(--orange-soft);
  color: var(--warning-text);
}

.badge.red {
  border-color: rgba(239, 127, 130, 0.22);
  background: var(--red-soft);
  color: var(--danger-text);
}

.kanban {
  display: grid;
  grid-auto-columns: minmax(270px, 1fr);
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
}

.kanban-column {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--field);
  scroll-snap-align: start;
}

.kanban-column.drag-over {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(107, 115, 230, 0.28);
}

.kanban-head {
  min-height: 47px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line-subtle);
}

.kanban-head i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.kanban-head strong {
  flex: 1;
  font-size: 11px;
}

.kanban-head span {
  color: var(--dim);
  font-size: 9px;
}

.kanban-cards {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px;
}

.record-card {
  padding: 11px;
  background: var(--panel);
  cursor: pointer;
}

.record-card:hover {
  border-color: var(--line);
  background: var(--panel-2);
}

.record-card.dragging {
  opacity: 0.48;
}

.record-card .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.record-card h3 {
  margin: 0;
  font-size: 12px;
}

.record-card .amount {
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 630;
}

.record-card .location,
.record-card .message-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--dim);
  font-size: 10px;
}

.record-card .message-preview {
  overflow: hidden;
  padding: 7px;
  border-radius: 6px;
  background: var(--field);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-card .location .ui-icon,
.record-card .message-preview .ui-icon {
  width: 12px;
  height: 12px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line-subtle);
  color: var(--dim);
  font-size: 9px;
}

.card-footer .mini-avatar,
.card-footer .assignee-avatar {
  width: 20px;
  height: 20px;
  display: grid;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--accent-text);
  font-size: 7px;
  font-weight: 700;
}

.card-footer .card-assignee {
  overflow: hidden;
  flex: 1 1 auto;
}

.card-footer .card-assignee > span:last-child {
  min-width: 0;
}

.card-footer time {
  flex: 0 0 auto;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 36px;
  color: var(--dim);
  text-align: center;
}

.empty-state .ui-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  color: var(--dim);
}

.empty-state h3 {
  color: var(--muted);
}

.empty-state p {
  max-width: 350px;
  font-size: 11px;
}

.detail-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-item {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--field);
}

.summary-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 590;
  text-overflow: ellipsis;
}

.tabs {
  display: flex;
  gap: 17px;
  margin: 20px 0 11px;
  border-bottom: 1px solid var(--line-subtle);
}

.tab-button {
  position: relative;
  padding: 0 0 9px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 620;
}

.tab-button.active {
  color: var(--text);
}

.tab-button.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  border-radius: 2px 2px 0 0;
  background: var(--blue);
}

.data-table tbody tr[data-open-loan] {
  cursor: pointer;
}

.data-table tbody tr[data-open-loan]:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: -2px;
}

.loan-workspace {
  width: 100%;
}

.loan-workspace-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 17px;
}

.loan-workspace-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.loan-workspace-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(98, 108, 213, 0.28);
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--accent-text);
}

.loan-workspace-mark .ui-icon {
  width: 23px;
  height: 23px;
}

.loan-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loan-title-line h1 {
  margin: 0;
}

.loan-workspace-title .record-workspace-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.loan-workspace-title > div > span:last-child {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--dim);
  font-size: 10px;
}

.loan-workspace-title > div > span:last-child .ui-icon {
  width: 12px;
}

.loan-workspace-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 13px;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel);
}

.loan-workspace-metrics > div {
  min-width: 0;
  padding: 15px 17px;
  border-right: 1px solid var(--line-subtle);
}

.loan-workspace-metrics > div:last-child {
  border-right: 0;
}

.loan-workspace-metrics span,
.loan-workspace-metrics small {
  display: block;
  color: var(--dim);
  font-size: 9px;
}

.loan-workspace-metrics span {
  margin-bottom: 7px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.loan-workspace-metrics strong {
  display: block;
  overflow: hidden;
  margin-bottom: 3px;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loan-workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  align-items: start;
  gap: 13px;
}

.loan-workspace-main {
  min-height: 525px;
}

.loan-workspace-tabs {
  display: flex;
  gap: 21px;
  overflow-x: auto;
  padding: 17px 19px 0;
  border-bottom: 1px solid var(--line-subtle);
}

.loan-workspace-tabs .tab-button {
  flex: 0 0 auto;
  padding-bottom: 13px;
  white-space: nowrap;
}

.loan-workspace-content {
  padding: 19px;
}

.loan-workspace-content > .summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loan-workspace-sidebar {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 13px;
}

.loan-workspace-sidebar .panel-head > .ui-icon {
  width: 16px;
  color: var(--dim);
}

.loan-stage-field {
  display: grid;
  gap: 6px;
  margin-bottom: 9px;
}

.loan-stage-field > span,
.loan-sidebar-value > span,
.loan-team-row div > span {
  color: var(--dim);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.loan-stage-field select {
  width: 100%;
}

.loan-sidebar-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.loan-team-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loan-team-row + .loan-team-row {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line-subtle);
}

.loan-team-row .mini-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--accent-text);
  font-size: 9px;
  font-weight: 700;
}

.loan-team-row .assignee-avatar {
  border-radius: 9px;
}

.loan-team-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.loan-team-row strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loan-borrower-link {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.loan-borrower-link > div {
  flex: 1;
}

.loan-borrower-link:hover strong,
.loan-borrower-link:focus-visible strong {
  color: var(--blue);
}

.conversation {
  display: grid;
  gap: 10px;
}

.message-bubble {
  width: min(82%, 390px);
  padding: 10px 11px;
  border: 1px solid var(--line-subtle);
  border-radius: 9px 9px 9px 2px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
}

.message-bubble.outbound {
  margin-left: auto;
  border-color: rgba(98, 108, 213, 0.25);
  border-radius: 9px 9px 2px 9px;
  background: var(--blue-soft);
  color: var(--accent-text-strong);
}

.message-bubble small {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 8px;
}

.compose-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-subtle);
}

.source-banner,
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(225, 173, 96, 0.22);
  border-radius: 9px;
  background: var(--orange-soft);
  color: var(--warning-text);
  font-size: 10px;
}

.source-banner .ui-icon,
.notice .ui-icon {
  width: 16px;
  margin-top: 1px;
}

.source-banner strong,
.notice strong {
  display: block;
  margin-bottom: 2px;
  color: var(--warning-text);
}

.notice.info {
  border-color: rgba(98, 108, 213, 0.22);
  background: var(--blue-soft);
  color: var(--accent-text);
}

.work-metrics {
  display: grid;
  overflow: hidden;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 13px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel);
}

.work-metric {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 15px 17px;
}

.work-metric + .work-metric {
  border-left: 1px solid var(--line-subtle);
}

.work-metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.work-metric-label .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--dim);
}

.work-metric > strong {
  margin-top: 5px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
}

.work-metric > small {
  overflow: hidden;
  color: var(--dim);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-metric.danger > strong,
.work-metric.danger .work-metric-label .ui-icon {
  color: var(--red);
}

.work-metric.warning > strong,
.work-metric.warning .work-metric-label .ui-icon {
  color: var(--orange);
}

.work-metric.positive > small {
  color: var(--green);
}

.work-panel {
  overflow: hidden;
}

.work-panel > .empty-state {
  min-height: 260px;
}

.work-group + .work-group {
  border-top: 1px solid var(--line-subtle);
}

.work-group-head {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--field);
}

.work-group-head > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.work-group-head h3,
.work-group-head p {
  margin: 0;
}

.work-group-head h3 {
  font-size: 11px;
  font-weight: 650;
}

.work-group-head p {
  overflow: hidden;
  color: var(--dim);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-group-head > span {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.work-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-list > li + li {
  border-top: 1px solid var(--line-subtle);
}

.work-item {
  width: 100%;
  min-height: 61px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto minmax(105px, auto);
  align-items: center;
  gap: 11px;
  padding: 10px 15px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.work-item {
  cursor: pointer;
}

.work-item:hover {
  background: var(--panel-hover);
}

.work-item:focus-visible {
  position: relative;
  z-index: 1;
  outline: 0;
  box-shadow: inset 0 0 0 2px rgba(98, 108, 213, 0.72);
}

.work-item-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.work-item-copy strong,
.work-item-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-item-copy strong {
  font-size: 12px;
  font-weight: 610;
}

.work-item-copy span {
  color: var(--dim);
  font-size: 10px;
}

.work-item > .badge {
  justify-self: end;
}

.work-item-due {
  min-width: 105px;
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.work-item-due strong,
.work-item-due time,
.work-item-due span {
  font-size: 9px;
  white-space: nowrap;
}

.work-item-due strong {
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.work-item-due time,
.work-item-due span {
  color: var(--dim);
}

.work-item-due.is-overdue strong,
.work-item-due.is-overdue time {
  color: var(--red);
}

.work-item-due.is-today strong {
  color: var(--orange);
}

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 13px;
}

.settings-menu {
  height: fit-content;
  padding: 6px;
}

.settings-menu button {
  width: 100%;
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
}

.settings-menu button.active {
  background: var(--blue-soft);
  color: var(--accent-text);
}

.settings-menu .ui-icon {
  width: 14px;
}

.appearance-settings-body {
  display: grid;
  gap: 12px;
}

.appearance-setting-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line-subtle);
  border-radius: 11px;
  background: var(--field);
}

.appearance-setting-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(124, 134, 237, 0.22);
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--accent-text);
}

.appearance-setting-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.appearance-setting-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.appearance-setting-copy strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.appearance-setting-copy small {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.45;
}

.appearance-switch {
  min-width: 78px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 110ms ease;
}

.appearance-switch:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--text);
}

.appearance-switch:active:not(:disabled) {
  transform: translateY(1px);
}

.appearance-switch[aria-checked="true"] {
  border-color: rgba(98, 108, 213, 0.38);
  background: var(--blue-soft);
  color: var(--accent-text);
}

.appearance-switch-track {
  width: 32px;
  height: 18px;
  display: block;
  padding: 2px;
  border-radius: 999px;
  background: var(--line);
  transition: background 140ms ease;
}

.appearance-switch-track > span {
  width: 14px;
  height: 14px;
  display: block;
  border-radius: 50%;
  background: var(--raised);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
  transform: translateX(0);
  transition: transform 170ms cubic-bezier(0.2, 0.8, 0.2, 1), background 140ms ease;
}

.appearance-switch[aria-checked="true"] .appearance-switch-track {
  background: var(--blue);
}

.appearance-switch[aria-checked="true"] .appearance-switch-track > span {
  background: #ffffff;
  transform: translateX(14px);
}

.appearance-switch-state {
  min-width: 19px;
  font-size: 10px;
  font-weight: 650;
  text-align: left;
}

.appearance-setting-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0 2px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.5;
}

.appearance-setting-note .ui-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 1px;
  color: var(--blue-bright);
}

.appearance-setting-note strong {
  margin-right: 4px;
  color: var(--muted);
}

.appearance-settings-error {
  margin: 0;
}

.integration-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line-subtle);
}

.integration-row:last-child {
  border-bottom: 0;
}

.integration-logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--muted);
}

.integration-copy {
  min-width: 0;
  flex: 1;
}

.integration-copy strong {
  display: block;
  font-size: 12px;
}

.integration-copy span {
  color: var(--dim);
  font-size: 10px;
}

.modal-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(2px);
}

.modal {
  z-index: 100;
  width: min(620px, calc(100vw - 30px));
  max-height: min(820px, calc(100vh - 40px));
  max-height: min(820px, calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.modal::backdrop {
  background: transparent;
}

.modal-head,
.drawer-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-subtle);
}

.modal-head h2,
.drawer-head h2 {
  margin: 0;
}

.modal-head .eyebrow,
.drawer-head .eyebrow {
  margin: 0 0 2px;
}

.modal-body,
.drawer-body {
  overflow: auto;
  padding: 17px;
}

.modal-body {
  min-height: 0;
  max-height: none;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 18px -17px -17px;
  padding: 12px 17px;
  border-top: 1px solid var(--line-subtle);
  background: var(--field);
}

.modal-footer-spacer {
  flex: 1 1 auto;
}

.lead-intake {
  display: grid;
  gap: 20px;
}

.lead-intake-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lead-intake-progress li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--dim);
}

.lead-intake-progress li > span {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

.lead-intake-progress li div,
.lead-match-person > span,
.lead-match-message div {
  min-width: 0;
}

.lead-intake-progress strong,
.lead-intake-progress small {
  display: block;
}

.lead-intake-progress strong {
  font-size: 11px;
}

.lead-intake-progress small {
  overflow: hidden;
  font-size: 9px;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-intake-progress li[aria-current="step"] {
  border-color: rgba(98, 108, 213, 0.34);
  background: var(--blue-soft);
  color: var(--accent-text);
}

.lead-intake-progress li[aria-current="step"] > span {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.lead-intake-step[hidden] {
  display: none;
}

.lead-intake-heading {
  margin-bottom: 18px;
}

.lead-intake-heading .eyebrow {
  margin-bottom: 3px;
}

.lead-intake-heading h3 {
  margin-bottom: 4px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.lead-intake-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.lead-intake .form-grid {
  gap: 15px 16px;
}

.lead-match-results:empty {
  display: none;
}

.lead-match-results {
  display: grid;
  gap: 11px;
  margin-top: 20px;
}

.lead-match-result-head,
.lead-match-result-head strong,
.lead-match-result-head span {
  display: block;
}

.lead-match-result-head strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.lead-match-result-head span {
  margin-top: 3px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.4;
}

.lead-match-list {
  display: grid;
  gap: 8px;
}

.lead-match-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(160px, 0.95fr) minmax(230px, 1.25fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.lead-match-card:hover {
  border-color: var(--blue);
  background: var(--panel-hover);
  transform: translateY(-1px);
}

.lead-match-card.is-selected,
.lead-match-card[aria-pressed="true"] {
  border-color: var(--blue-bright);
  background: var(--blue-soft);
  box-shadow: 0 0 0 1px rgba(126, 136, 255, 0.16);
}

.lead-portfolio-match-form {
  display: grid;
  gap: 16px;
}

.lead-portfolio-match-footer > span {
  flex: 1 1 auto;
}

.lead-match-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.lead-match-person > i {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--accent-text);
}

.lead-match-person .ui-icon {
  width: 14px;
  height: 14px;
}

.lead-match-person strong,
.lead-match-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-match-person strong {
  font-size: 12px;
  letter-spacing: -0.01em;
}

.lead-match-person small {
  color: var(--dim);
  font-size: 9px;
}

.lead-match-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lead-match-metrics > span {
  min-width: 0;
}

.lead-match-metrics strong,
.lead-match-metrics small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-match-metrics strong {
  color: var(--muted);
  font-size: 10px;
}

.lead-match-metrics small {
  color: var(--dim);
  font-size: 8px;
}

.lead-match-select {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-left: 2px;
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.lead-match-select .ui-icon {
  width: 12px;
  height: 12px;
}

.lead-match-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--muted);
}

.lead-match-message > .ui-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  color: var(--blue-bright);
}

.lead-match-message strong,
.lead-match-message span {
  display: block;
}

.lead-match-message strong {
  color: var(--text);
  font-size: 11px;
}

.lead-match-message span {
  margin-top: 2px;
  color: var(--dim);
  font-size: 10px;
}

.lead-match-message.is-loading > .ui-icon {
  animation: lead-match-pulse 900ms ease-in-out infinite alternate;
}

.lead-intake-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
}

.lead-intake-footer > span {
  flex: 1 1 auto;
}

@keyframes lead-match-pulse {
  to { opacity: 0.35; }
}

.detail-drawer {
  position: fixed;
  z-index: 110;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 180ms ease;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-body {
  height: calc(100vh - 67px);
}

.toast-region {
  position: fixed;
  z-index: 160;
  right: 18px;
  bottom: 18px;
  width: min(370px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raised);
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease;
}

.toast .ui-icon {
  width: 16px;
  color: var(--green);
}

.toast.error .ui-icon {
  color: var(--red);
}

.toast strong {
  display: block;
  font-size: 11px;
}

.toast span {
  color: var(--muted);
  font-size: 10px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.borrower-portal {
  min-height: 100vh;
  padding: 32px 18px 60px;
  background:
    radial-gradient(circle at 50% 0, rgba(98, 108, 213, 0.12), transparent 32%),
    var(--bg);
}

.borrower-shell {
  width: min(780px, 100%);
  margin: 0 auto;
}

.borrower-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.borrower-brand img {
  width: 100px;
  max-height: 28px;
  object-fit: contain;
  filter: var(--logo-filter);
}

.borrower-hero {
  margin-bottom: 13px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.borrower-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.progress-row .bar-track {
  height: 7px;
  flex: 1;
}

.progress-row span {
  color: var(--dim);
  font-size: 10px;
}

.request-item {
  margin-bottom: 9px;
  padding: 15px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel);
}

.request-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.request-item h3 {
  margin: 0;
}

.request-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.upload-zone {
  min-height: 90px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 13px;
  border: 1px dashed #444650;
  border-radius: 8px;
  background: var(--field);
  color: var(--dim);
  font-size: 10px;
  text-align: center;
}

.upload-zone:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone .ui-icon {
  width: 22px;
  height: 22px;
}

.borrower-footer {
  padding: 22px 0;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
}

.skeleton {
  min-height: 12px;
  overflow: hidden;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--panel-2), var(--line-subtle), var(--panel-2));
  background-size: 220% 100%;
  animation: skeleton 1.3s linear infinite;
}

@keyframes skeleton {
  to { background-position: -220% 0; }
}

/* Lead workspace */
.lead-workspace-page {
  min-width: 0;
}

.lead-workspace-page > .lead-workspace {
  height: calc(100vh - 169px);
  min-height: 680px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

[data-open-lead]:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: -2px;
}

.lead-workspace {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.lead-profile-header {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(330px, 0.9fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--field);
}

.lead-profile-primary,
.lead-profile-title,
.lead-contact-line,
.lead-profile-actions,
.lead-source-identity,
.lead-conversation-person,
.lead-compose-actions,
.lead-compose-toolbar,
.lead-section-intro {
  display: flex;
  align-items: center;
}

.lead-profile-primary {
  min-width: 0;
  gap: 12px;
}

.lead-profile-primary > div,
.lead-conversation-person > div {
  min-width: 0;
}

.lead-profile-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(98, 108, 213, 0.32);
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 720;
}

.lead-profile-title {
  min-width: 0;
  gap: 8px;
}

.lead-profile-title h2 {
  overflow: hidden;
  margin: 0;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-profile-primary p {
  overflow: hidden;
  margin: 3px 0 7px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-contact-line {
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--dim);
  font-size: 9px;
}

.lead-contact-line a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.lead-contact-line a:hover {
  color: var(--text);
}

.lead-contact-line .ui-icon {
  width: 11px;
  height: 11px;
}

.lead-operational-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
}

.lead-operational-context dt,
.lead-fact-grid dt {
  color: var(--dim);
  font-size: 8px;
  font-weight: 680;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.lead-operational-context dd,
.lead-fact-grid dd {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 580;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-profile-actions {
  justify-content: flex-end;
  gap: 6px;
}

.lead-profile-actions .button,
.lead-borrower-action,
.lead-borrower-action span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.lead-stage-control {
  width: 150px;
}

.lead-stage-control span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.lead-mobile-switch {
  display: none;
  margin: 10px 12px 0;
}

.lead-workspace-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 440px);
  overflow: hidden;
}

.lead-intelligence-column {
  min-width: 0;
  overflow-y: auto;
  padding: 15px 17px 34px;
  scrollbar-gutter: stable;
}

.lead-intelligence-source {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel);
}

.lead-intelligence-source[data-source-status="stale"],
.lead-intelligence-source[data-source-status="pending"] {
  border-color: rgba(235, 183, 81, 0.26);
}

.lead-source-identity {
  min-width: 0;
  gap: 10px;
}

.lead-source-identity > div > strong,
.lead-source-identity > div > span,
.lead-conversation-person > div > strong,
.lead-conversation-person > div > span {
  display: block;
}

.lead-source-identity > div > strong,
.lead-conversation-person > div > strong {
  font-size: 11px;
}

.lead-source-identity > div > span,
.lead-conversation-person > div > span {
  overflow: hidden;
  margin-top: 2px;
  color: var(--dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-intelligence-tabs {
  margin: 15px 0 13px;
}

.lead-intelligence-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 11px;
}

.lead-intelligence-metric {
  min-height: 102px;
  padding: 13px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--panel);
}

.lead-intelligence-metric > strong {
  display: block;
  margin: 11px 0 5px;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 660;
  letter-spacing: -0.04em;
  line-height: 1;
}

.lead-intelligence-metric > span {
  display: block;
  color: var(--dim);
  font-size: 8px;
  line-height: 1.4;
}

.lead-overview-grid,
.lead-activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 11px;
}

.panel-body.flush {
  padding: 0;
}

.lead-brief-list,
.lead-lender-list,
.lead-note-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lead-brief-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lead-brief-list span,
.lead-brief-list strong,
.lead-brief-list small {
  display: block;
}

.lead-brief-list span {
  color: var(--dim);
  font-size: 8px;
  font-weight: 670;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lead-brief-list strong {
  overflow: hidden;
  margin-top: 3px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-brief-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.lead-lender-list li {
  min-height: 54px;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-subtle);
}

.lead-lender-rank {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--dim);
  font-size: 8px;
  font-weight: 700;
}

.lead-lender-copy > div,
.lead-lender-values {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.lead-lender-copy strong,
.lead-lender-values strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-lender-copy span,
.lead-lender-values span {
  color: var(--dim);
  font-size: 8px;
  white-space: nowrap;
}

.lead-lender-copy i {
  height: 3px;
  display: block;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--panel-2);
}

.lead-lender-copy i b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
}

.lead-lender-values {
  align-items: flex-end;
  flex-direction: column;
}

.text-button {
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font-size: 9px;
  font-weight: 650;
}

.lead-entity-list {
  display: grid;
}

.lead-entity-card {
  border-bottom: 1px solid var(--line-subtle);
}

.lead-entity-card summary {
  min-height: 62px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  list-style: none;
  cursor: pointer;
}

.lead-entity-card summary::-webkit-details-marker {
  display: none;
}

.lead-entity-card summary:hover {
  background: var(--panel-hover);
}

.lead-entity-card summary > div > strong,
.lead-entity-card summary > div > span {
  display: block;
}

.lead-entity-card summary > div > strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-entity-card summary > div > span {
  margin-top: 2px;
  color: var(--dim);
  font-size: 8px;
}

.lead-entity-card summary > .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--dim);
  transition: transform 150ms ease;
}

.lead-entity-card[open] summary > .ui-icon {
  transform: rotate(180deg);
}

.lead-entity-counts {
  text-align: right;
}

.lead-entity-body {
  padding: 0 14px 14px 56px;
}

.lead-evidence-note {
  margin: 0 0 8px;
  color: var(--dim);
  font-size: 9px;
}

.lead-entity-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.lead-fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 7px;
  background: var(--field);
}

.lead-property-stack {
  display: grid;
  gap: 8px;
  container-type: inline-size;
}

.lead-property-stack article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-subtle);
  border-radius: 7px;
  background: var(--panel-2);
}

.lead-property-stack article > div { min-width: 0; }
.lead-property-stack article > .action-icon { width: 28px; height: 28px; }
.lead-property-stack article > div > strong,
.lead-property-stack article > div > span { display: block; }

.lead-property-stack article > div > strong {
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.lead-property-stack article > div > span {
  margin-top: 3px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.lead-property-amount { text-align: right; }
.lead-property-stack .lead-property-amount > strong { font-size: 12px; font-variant-numeric: tabular-nums; }

.lead-property-mortgages {
  grid-column: 2 / -1;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
}

.lead-property-mortgage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, .45fr);
  gap: 18px;
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.lead-property-mortgage + .lead-property-mortgage {
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
}
.lead-property-mortgage > div { min-width: 0; }
.lead-property-mortgage > div:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.lead-property-mortgage dt { color: var(--dim); font-size: 9px; }
.lead-property-mortgage dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.lead-property-mortgage dd small {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--field);
  color: var(--muted);
  font-size: 9px;
}

@container (max-width: 480px) {
  .lead-property-stack article { grid-template-columns: 28px minmax(0, 1fr); }
  .lead-property-amount { grid-column: 2; text-align: left; }
  .lead-property-mortgages { grid-column: 1 / -1; }
  .lead-property-mortgage { grid-template-columns: minmax(0, 1fr) minmax(0, .7fr); gap: 12px; }
}

.lead-empty-copy {
  margin: 0;
  color: var(--dim);
  font-size: 10px;
}

.lead-empty-copy.padded {
  padding: 18px;
}

.lead-section-intro {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 3px 2px 12px;
  border-bottom: 1px solid var(--line-subtle);
}

.lead-section-intro h3 {
  margin-bottom: 3px;
}

.lead-section-intro p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.lead-ungrouped {
  margin-top: 11px;
}

.lead-ungrouped .lead-property-stack {
  padding: 11px;
}

.lead-debt-grid,
.lead-activity-side {
  display: grid;
  align-content: start;
  gap: 11px;
}

.lead-mortgage-table-wrap {
  overflow: auto;
}

.lead-mortgage-table {
  min-width: 760px;
}

.lead-mortgage-table th,
.lead-mortgage-table td {
  padding: 9px 10px;
}

.lead-note-list {
  display: grid;
  gap: 7px;
  margin-bottom: 11px;
}

.lead-note-list li {
  padding: 9px 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 7px;
  background: var(--field);
}

.lead-note-list p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  white-space: pre-wrap;
}

.lead-note-list span {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 8px;
}

.lead-note-form {
  padding-top: 11px;
  border-top: 1px solid var(--line-subtle);
}

.lead-portfolio-state {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--field);
}

.lead-portfolio-state > .ui-icon {
  width: 36px;
  height: 36px;
  color: var(--dim);
}

.lead-portfolio-state h3 {
  margin-bottom: 5px;
}

.lead-portfolio-state p {
  max-width: 580px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
}

.lead-data-caution,
.lead-history-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--warning-text);
  font-size: 9px;
}

.lead-data-caution {
  margin-bottom: 11px;
  padding: 9px 11px;
  border: 1px solid rgba(235, 183, 81, 0.2);
  border-radius: 7px;
  background: rgba(235, 183, 81, 0.05);
}

.lead-conversation-panel {
  position: sticky;
  top: 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--line-subtle);
  background: var(--field);
}

.lead-conversation-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--panel);
}

.lead-conversation-person {
  min-width: 0;
  gap: 9px;
}

.lead-history-notice {
  padding: 7px 13px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--dim);
}

.lead-conversation-area {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

@property --conversation-scrollbar-thumb {
  syntax: '<color>';
  inherits: true;
  initial-value: transparent;
}

.lead-conversation-panel .conversation {
  min-height: 0;
  align-content: start;
  flex: 1;
  overflow-y: auto;
  padding: 14px 13px 18px;
  scrollbar-gutter: stable;
  --conversation-scrollbar-thumb: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--conversation-scrollbar-thumb) transparent;
  transition: --conversation-scrollbar-thumb 220ms ease;
}

.lead-conversation-panel .conversation.is-scrolling {
  --conversation-scrollbar-thumb: var(--dim);
}

/* Chromium and Safari: explicit styling removes Windows' native arrow buttons.
   Non-auto standard scrollbar styles would override these pseudo-elements. */
@supports selector(::-webkit-scrollbar) {
  .lead-conversation-panel .conversation {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
  .lead-conversation-panel .conversation::-webkit-scrollbar { width: 6px; }
  .lead-conversation-panel .conversation::-webkit-scrollbar-track,
  .lead-conversation-panel .conversation::-webkit-scrollbar-corner { background: transparent; }
  .lead-conversation-panel .conversation::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  .lead-conversation-panel .conversation::-webkit-scrollbar-thumb {
    background: var(--conversation-scrollbar-thumb);
    border-radius: 999px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-conversation-panel .conversation { transition: none; }
}

@media (forced-colors: active) {
  .lead-conversation-panel .conversation { scrollbar-color: auto; }
  .lead-conversation-panel .conversation::-webkit-scrollbar-thumb { background: CanvasText; }
}

.lead-conversation-panel .message-bubble {
  width: min(86%, 345px);
  position: relative;
}

.lead-conversation-panel .message-bubble.has-reaction {
  margin-top: 12px;
}

.message-reaction {
  position: absolute;
  top: -13px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 27px;
  padding: 2px 7px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: var(--panel-2);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16);
  font-size: 16px;
  line-height: 1;
}

.lead-conversation-panel .message-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.lead-conversation-empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  color: var(--dim);
  text-align: center;
}

.lead-conversation-empty .ui-icon {
  width: 27px;
  height: 27px;
  margin-bottom: 10px;
}

.lead-conversation-empty strong,
.lead-conversation-empty span {
  display: block;
}

.lead-conversation-empty strong {
  color: var(--muted);
  font-size: 11px;
}

.lead-conversation-empty span {
  max-width: 270px;
  margin-top: 4px;
  font-size: 9px;
}

.lead-compose-box {
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid var(--line-subtle);
  background: var(--panel);
}

.lead-compose-box > .form-error {
  margin: 8px 0 0;
}

.lead-compose-box > .form-error:empty {
  display: none;
}

.lead-compose-unavailable .empty-state {
  min-height: 150px;
  padding: 20px 14px;
}

.lead-compose-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.lead-compose-shell:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(98,108,213,.12); }
.lead-compose-inline { display: flex; align-items: flex-end; gap: 6px; padding: 7px; }
.lead-compose-box .lead-compose-inline textarea {
  scrollbar-width: none;
  flex: 1; width: 0; min-width: 0; min-height: 38px; max-height: 150px;
  padding: 9px 3px; border: 0; border-radius: 0; box-shadow: none;
  background: transparent; resize: none; font-size: 12px; line-height: 20px;
}

.lead-compose-box .lead-compose-inline textarea::-webkit-scrollbar {
  display: none;
}
.compose-attach, .compose-send, .compose-emoji {
  display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px;
  padding: 0; border: 0; border-radius: 50%; cursor: pointer;
}
.compose-attach, .compose-emoji { background: transparent; color: var(--muted); }
.compose-attach:hover, .compose-emoji:hover { color: var(--text); background: var(--panel); }
.compose-send { color: white; background: color-mix(in srgb, var(--blue) 85%, black); border-radius: 9px; }
.compose-send:hover { filter: brightness(1.12); }
.compose-attach svg, .compose-send svg, .compose-emoji svg { width: 19px; height: 19px; }
.compose-emoji-picker {
  position: fixed;
  inset: auto;
  width: 340px;
  height: 410px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: hidden;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
.compose-emoji-picker:popover-open { display: flex; flex-direction: column; gap: 10px; }
.compose-emoji-picker > strong { display: block; font-size: 12px; }
.compose-emoji-picker > input, .compose-emoji-picker > select { width: 100%; min-height: 34px; flex-shrink: 0; padding: 7px 9px; font-size: 12px; }
.compose-emoji-results { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1; scrollbar-width: none; }
.compose-emoji-results::-webkit-scrollbar { display: none; }
.compose-emoji-status { flex-shrink: 0; font-size: 11px; color: var(--muted); }
.compose-emoji-status:empty { display: none; }
.compose-emoji-more { width: 100%; margin-top: 8px; }
.compose-emoji-more[hidden] { display: none; }
.compose-emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
.compose-emoji-grid button {
  display: grid; place-items: center; min-width: 0; height: 32px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; font-size: 21px; cursor: pointer;
}
.compose-emoji-grid button:hover { background: var(--panel-hover); }
.compose-emoji-grid button:focus-visible, .compose-emoji:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 1px; }
.compose-send:disabled { opacity: .5; cursor: wait; }
.lead-compose-box[aria-busy=true] .compose-send svg { animation: compose-sending 1s ease-in-out infinite alternate; }
@keyframes compose-sending { to { opacity: .35; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .lead-compose-box[aria-busy=true] .compose-send svg { animation: none; } }
.compose-attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 3px; }
.compose-attachments[hidden] { display: none; }
.compose-attachment, .message-attachment { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); font-size: 11px; }
.compose-attachment > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-attachment svg, .message-attachment svg { width: 14px; height: 14px; flex-shrink: 0; }
.compose-attachment button { display: grid; place-items: center; padding: 2px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.message-attachment { margin: 4px 3px 4px 0; overflow-wrap: anywhere; text-decoration: none; }
.message-attachment:hover { border-color: var(--blue); }

.skeleton-block,
.skeleton-panel {
  position: relative;
  min-height: 102px;
  overflow: hidden;
  background: var(--panel-2);
}

.skeleton-panel {
  min-height: 235px;
}

.skeleton-block::after,
.skeleton-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent);
  animation: loading 1.3s linear infinite;
}

@media (max-width: 1500px) {
  .lead-workspace-page .lead-profile-header {
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.8fr);
  }

  .lead-workspace-page .lead-profile-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  .lead-profile-header {
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.8fr);
  }

  .lead-profile-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .lead-workspace-grid {
    grid-template-columns: minmax(0, 1fr) minmax(370px, 410px);
  }

  .lead-intelligence-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 940px) {
  .loan-workspace-layout {
    grid-template-columns: 1fr;
  }

  .loan-workspace-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-workspace-page .lead-profile-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
  }

  .lead-operational-context {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .lead-workspace-page .lead-profile-actions {
    grid-column: auto;
    min-width: 0;
  }

  .lead-mobile-switch {
    display: flex;
  }

  .lead-workspace-grid {
    grid-template-columns: 1fr;
  }

  .lead-workspace[data-active-pane="portfolio"] .lead-conversation-panel,
  .lead-workspace[data-active-pane="conversation"] .lead-intelligence-column {
    display: none;
  }

  .lead-conversation-panel {
    position: static;
    border-top: 1px solid var(--line-subtle);
    border-left: 0;
  }

  .auth-layout {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: auto;
    padding: 24px 28px;
  }

  .auth-story-copy,
  .auth-story-foot {
    display: none;
  }

  .auth-card {
    padding: 42px 28px;
    border-top: 1px solid var(--line-subtle);
    border-left: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: min(var(--sidebar-width), calc(100vw - 48px));
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-grid;
  }

  .breadcrumb {
    margin-right: auto;
  }

  .topbar {
    gap: 8px;
    padding: 0 15px;
  }

  .global-search {
    width: min(280px, 35vw);
  }

  .view {
    padding: 21px 18px 44px;
  }

  .dashboard-grid,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-menu {
    display: flex;
    overflow: auto;
  }

  .settings-menu button {
    width: auto;
    white-space: nowrap;
  }
}

@media (max-width: 680px) {
  .loan-workspace-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .loan-workspace-hero .page-actions,
  .loan-workspace-hero .button {
    width: 100%;
  }

  .loan-workspace-metrics,
  .loan-workspace-sidebar,
  .loan-workspace-content > .summary-grid {
    grid-template-columns: 1fr;
  }

  .loan-workspace-metrics > div {
    border-right: 0;
    border-bottom: 1px solid var(--line-subtle);
  }

  .loan-workspace-metrics > div:last-child {
    border-bottom: 0;
  }

  .loan-workspace-mark {
    width: 44px;
    height: 44px;
  }

  .loan-workspace-content {
    padding: 14px;
  }

  .lead-workspace-page > .lead-workspace {
    height: calc(100vh - 142px);
    min-height: 720px;
  }

  .lead-profile-primary {
    align-items: flex-start;
  }

  .lead-profile-avatar {
    width: 40px;
    height: 40px;
  }

  .lead-profile-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .lead-operational-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-workspace-page .lead-profile-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .lead-stage-control {
    width: min(150px, 42vw);
  }

  .lead-intelligence-column {
    padding: 12px 11px 28px;
  }

  .lead-intelligence-source {
    align-items: flex-start;
  }

  .lead-source-identity span {
    white-space: normal;
  }

  .lead-intelligence-tabs {
    gap: 13px;
    overflow-x: auto;
  }

  .lead-intelligence-tabs .tab-button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .lead-intelligence-metrics,
  .lead-overview-grid,
  .lead-activity-grid,
  .lead-brief-list {
    grid-template-columns: 1fr;
  }

  .lead-entity-card summary {
    grid-template-columns: 32px minmax(0, 1fr) 14px;
  }

  .lead-entity-counts {
    display: none;
  }

  .lead-entity-body {
    padding-left: 14px;
  }

  .lead-fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    height: 58px;
  }

  .breadcrumb-home,
  .breadcrumb-root-separator,
  .global-search,
  .mode-pill {
    display: none;
  }

  .view {
    min-height: calc(100vh - 58px);
    padding: 18px 12px 38px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .metric-grid,
  .form-grid,
  .detail-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .work-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-metric:nth-child(3) {
    border-top: 1px solid var(--line-subtle);
    border-left: 0;
  }

  .work-metric:nth-child(4) {
    border-top: 1px solid var(--line-subtle);
  }

  .work-group-head p {
    display: none;
  }

  .work-item {
    grid-template-areas:
      "icon copy due"
      "icon status due";
    grid-template-columns: 31px minmax(0, 1fr) auto;
    gap: 5px 9px;
    padding: 11px 12px;
  }

  .work-item > .action-icon {
    grid-area: icon;
  }

  .work-item-copy {
    grid-area: copy;
  }

  .work-item > .badge {
    grid-area: status;
    justify-self: start;
  }

  .work-item-due {
    min-width: 78px;
    grid-area: due;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .lead-intake-progress small {
    display: none;
  }

  .lead-match-card {
    grid-template-columns: 1fr;
  }

  .lead-match-select {
    justify-self: end;
  }

  .lead-intake-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-intake-footer > span {
    display: none;
  }

  .lead-intake-footer .button {
    width: 100%;
  }

  .lead-portfolio-match-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-portfolio-match-footer > span {
    display: none;
  }

  .lead-portfolio-match-footer .button {
    width: 100%;
  }

  .metric-card {
    min-height: 96px;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar .filter-search,
  .filter-bar select,
  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    justify-content: center;
  }

  .auth-screen {
    display: block;
    padding: 0;
  }

  .auth-layout {
    min-height: 100svh;
    border: 0;
    border-radius: 0;
  }

  .auth-story {
    padding: 20px;
  }

  .auth-card {
    padding: 34px 20px 42px;
  }

  .auth-field-grid {
    grid-template-columns: 1fr;
  }

  .auth-field.span-2 {
    grid-column: auto;
  }

  .borrower-portal {
    padding: 22px 10px 40px;
  }

  .borrower-hero {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Pricing workspace */
.pricing-workspace {
  min-width: 0;
}

.pricing-preview-notice {
  margin: -8px 0 14px;
}

.pricing-catalog-toggle {
  width: min(100%, 460px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin: -8px 0 14px;
  padding: 3px;
  border: 1px solid var(--line-subtle);
  border-radius: 14px;
  background: var(--field);
}

.pricing-catalog-toggle button {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.pricing-catalog-toggle button:hover:not(.active) {
  background: var(--hover-fill);
  color: var(--text);
}

.pricing-catalog-toggle button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--accent-text-strong);
  box-shadow: inset 0 0 0 1px rgba(124, 134, 237, 0.12);
}

.pricing-catalog-toggle button:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(98, 108, 213, 0.2);
}

.pricing-catalog-toggle button.active:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(124, 134, 237, 0.16), 0 0 0 3px rgba(98, 108, 213, 0.2);
}

.pricing-catalog-indicator {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 1px solid var(--dim);
  border-radius: 50%;
  background: transparent;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.pricing-catalog-toggle button.active .pricing-catalog-indicator {
  border-color: var(--blue-bright);
  background: var(--blue-bright);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.pricing-catalog-toggle-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.pricing-catalog-toggle-copy strong {
  font-size: 12px;
  font-weight: 720;
  line-height: 1.2;
}

.pricing-catalog-toggle-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 560;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.pricing-catalog-toggle button.active .pricing-catalog-toggle-copy small {
  color: var(--accent-text);
}

.pricing-workspace:has(.pricing-catalog-toggle) .pricing-layout {
  height: calc(100vh - 318px);
  height: max(360px, calc(100dvh - 318px));
}

.pricing-layout {
  min-height: 0;
  height: calc(100vh - 255px);
  height: max(360px, calc(100dvh - 255px));
  display: grid;
  grid-template-columns: minmax(430px, 0.9fr) minmax(520px, 1.1fr);
  align-items: stretch;
  gap: 16px;
}

.pricing-input-panel,
.pricing-results-panel {
  min-width: 0;
  min-height: 0;
}

.pricing-input-panel,
.pricing-results-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.pricing-form {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.pricing-input-head {
  align-items: flex-start;
  gap: 16px;
  padding: 17px 20px 16px;
}

.pricing-input-head h2 {
  font-size: 22px;
  letter-spacing: -0.035em;
}

.pricing-input-head p:last-child {
  max-width: 620px;
}

.pricing-input-head-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pricing-input-scroll,
.pricing-results-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.pricing-input-scroll {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  background: var(--quiet-fill);
}

.pricing-form-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-subtle);
  border-radius: 12px;
  background:
    linear-gradient(145deg, var(--quiet-fill), transparent 42%),
    var(--panel);
}

.pricing-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.pricing-group-icon {
  width: 29px;
  height: 29px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(124, 134, 237, 0.2);
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--accent-text);
}

.pricing-group-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.pricing-group-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pricing-group-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

.pricing-group-head p {
  margin: 0;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.4;
}

.pricing-form-group-context {
  padding-top: 15px;
}

.pricing-form-subsection + .pricing-form-subsection {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line-subtle);
}

.pricing-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

.pricing-subhead h4 {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 640;
}

.pricing-subhead p {
  margin: 0;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.35;
  text-align: right;
}

.pricing-grid {
  display: grid;
  align-items: start;
  gap: 10px 11px;
}

.pricing-grid + .pricing-grid,
.pricing-grid + .pricing-form-subsection,
.pricing-dscr-fieldset + [data-pricing-dscr-fields],
[data-pricing-dscr-fields] + .pricing-grid {
  margin-top: 10px;
}

.pricing-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pricing-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-scenario-name {
  max-width: 360px;
}

.pricing-context-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.pricing-context-stack .pricing-loan-link {
  margin-bottom: 0;
}

.pricing-structure-lock {
  margin-top: 10px;
}

.pricing-grid-wide {
  grid-column: 1 / -1;
  margin: -3px 0 0;
}

.pricing-conditional-row:empty {
  display: none;
}

.pricing-conditional-row[hidden],
.pricing-conditional-row > div[hidden],
[data-pricing-dscr-fields][hidden] {
  display: none;
}

.pricing-field-error {
  min-height: 0;
  color: var(--red);
  font-size: 10px;
  font-weight: 500;
}

.pricing-field-error:empty {
  display: none;
}

.pricing-dscr-fieldset {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
}

.pricing-dscr-fieldset legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.pricing-dscr-toggle {
  min-height: 40px;
  width: 100%;
}

.pricing-dscr-toggle button {
  flex: 1;
  justify-content: center;
}

.pricing-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
}

.pricing-check {
  position: relative;
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 999px;
  background: var(--field);
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, transform 120ms ease;
}

.pricing-check:hover {
  border-color: var(--line);
  background: var(--panel-hover);
  color: var(--text);
}

.pricing-check:active {
  transform: translateY(1px);
}

.pricing-check:has(input:checked) {
  border-color: var(--blue-bright);
  background: var(--blue-soft);
  color: var(--accent-text);
}

.pricing-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.pricing-check:has(input:focus-visible) {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(98, 108, 213, 0.18);
}

.pricing-check-mark {
  width: 18px;
  height: 18px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: transparent;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.pricing-check-mark .ui-icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.4;
}

.pricing-check:has(input:checked) .pricing-check-mark {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.pricing-check-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pricing-screen-footer {
  z-index: 3;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line-subtle);
  background: var(--panel);
  box-shadow: 0 -8px 22px rgba(12, 14, 22, 0.06);
}

.pricing-screen-footer .button {
  min-height: 46px;
  justify-content: space-between;
  padding-inline: 17px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 680;
}

.pricing-screen-footer .button .ui-icon {
  width: 19px;
  height: 19px;
}

.pricing-screen-footer .form-error {
  min-height: 0;
  margin: 0 0 8px;
}

.pricing-screen-footer .form-error:empty {
  display: none;
}

.pricing-loan-link {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  padding: 9px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--field);
}

.pricing-form label {
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.pricing-info-field {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.pricing-info-label-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pricing-form .pricing-info-label-row > label {
  display: inline;
  color: inherit;
  font: inherit;
}

.pricing-info-tip {
  position: relative;
  display: inline-flex;
}

.pricing-info-trigger {
  width: 16px;
  height: 16px;
  min-height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: help;
}

.pricing-info-trigger:hover {
  color: var(--text);
}

.pricing-info-trigger:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

.pricing-info-trigger .ui-icon {
  width: 13px;
  height: 13px;
}

.pricing-info-tooltip {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  width: min(250px, calc(100vw - 48px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.pricing-info-tip:hover .pricing-info-tooltip,
.pricing-info-tip:focus-within .pricing-info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pricing-form input,
.pricing-form select {
  min-height: 40px;
  padding-top: 7px;
  padding-bottom: 7px;
  border-radius: 8px;
  font-size: 12px;
}

.pricing-form select:hover:not(:disabled) {
  border-color: var(--line);
}

.pricing-city-field {
  min-width: 0;
  display: grid;
}

.pricing-city-list-action {
  width: max-content;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.pricing-city-list-action:hover {
  color: var(--text);
}

.pricing-loan-current {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-loan-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.pricing-loan-search-row input {
  min-height: 34px;
  font-size: 11px;
}

.pricing-loan-results {
  display: grid;
  gap: 5px;
}

.pricing-loan-results:empty {
  display: none;
}

.pricing-loan-results p {
  margin: 0;
  font-size: 10px;
}

.pricing-loan-result {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid var(--line-subtle);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.pricing-loan-result:hover {
  border-color: var(--blue);
  background: var(--panel-hover);
}

.pricing-loan-result span,
.pricing-loan-result strong,
.pricing-loan-result small {
  min-width: 0;
  display: block;
}

.pricing-loan-result strong,
.pricing-loan-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pricing-loan-result strong {
  font-size: 11px;
}

.pricing-loan-result small {
  margin-top: 2px;
  color: var(--dim);
  font-size: 9px;
}

.pricing-results-scroll {
  padding: 13px;
}

.pricing-initial-state {
  min-height: 330px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.pricing-initial-state > .ui-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  color: var(--blue-bright);
}

.pricing-initial-state h2,
.pricing-initial-state h3 {
  color: var(--text);
}

.pricing-initial-state p {
  max-width: 460px;
  margin: 0;
  font-size: 12px;
}

.pricing-initial-state .notice {
  max-width: 520px;
  margin-top: 18px;
  text-align: left;
}

.pricing-selected-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(98, 211, 167, 0.3);
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green);
}

.pricing-selected-banner.is-stale {
  border-color: rgba(225, 173, 96, 0.3);
  background: var(--orange-soft);
  color: var(--orange);
}

.pricing-selected-banner > .ui-icon {
  width: 20px;
  height: 20px;
}

.pricing-selected-banner div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pricing-selected-banner strong {
  color: var(--text);
  font-size: 12px;
}

.pricing-selected-banner span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pricing-clear-selection {
  width: max-content;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pricing-clear-selection:hover {
  color: var(--text);
}

.pricing-selected-banner .pricing-selected-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.pricing-selected-actions .button {
  width: 100%;
  min-width: 132px;
  padding-right: 12px;
  padding-left: 12px;
  white-space: nowrap;
}

.pricing-result-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr)) auto;
  align-items: stretch;
  gap: 1px;
  margin-bottom: 11px;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--line-subtle);
}

.pricing-result-summary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  background: var(--field);
}

.pricing-result-summary span {
  color: var(--dim);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pricing-result-summary strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pricing-result-summary .button {
  height: 100%;
  border: 0;
  border-radius: 0;
}

.pricing-result-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.pricing-result-controls > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.pricing-result-controls > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.pricing-sort-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.pricing-sort-chip:hover {
  border-color: var(--blue-bright);
  color: var(--text);
}

.pricing-sort-chip.active {
  border-color: var(--blue-bright);
  background: var(--blue-soft);
  color: var(--accent-text);
}

.pricing-sort-chip .ui-icon {
  width: 13px;
  height: 13px;
}

.pricing-offer-list {
  display: grid;
  gap: 10px;
}

.pricing-offer-card {
  position: relative;
  overflow: hidden;
  padding: 13px 14px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--field);
}

.pricing-offer-card:hover {
  border-color: var(--line);
  background: var(--panel-2);
}

.pricing-offer-card.is-selected {
  padding-left: 18px;
  border-color: var(--blue-bright);
  box-shadow: inset 4px 0 0 var(--blue-bright), 0 0 0 1px rgba(124, 134, 237, 0.1);
}

.pricing-offer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.pricing-offer-head p {
  margin: 7px 0 1px;
  color: var(--muted);
  font-size: 10px;
}

.pricing-offer-head h3 {
  margin: 0;
  font-size: 14px;
}

.pricing-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pricing-badges .badge {
  min-height: 19px;
  padding: 3px 8px;
  border: 0;
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pricing-offer-rate {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 24px;
  font-weight: 660;
  letter-spacing: -0.04em;
  line-height: 1;
}

.pricing-offer-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 28px;
  margin-top: 13px;
}

.pricing-offer-metrics > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 0;
}

.pricing-offer-metrics span {
  color: var(--dim);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pricing-offer-metrics strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pricing-rtl-offer-metrics strong small {
  color: var(--dim);
  font-size: 9px;
  font-weight: 500;
}

.pricing-rtl-catalogue {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
  background: var(--field);
}

.pricing-rtl-catalogue h3 {
  margin: 2px 0 0;
  font-size: 13px;
}

.pricing-rtl-catalogue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pricing-rtl-catalogue-grid article {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--panel);
}

.pricing-rtl-catalogue-grid strong {
  font-size: 10px;
}

.pricing-rtl-catalogue-grid span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pricing-rtl-catalogue-grid small {
  color: var(--dim);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.pricing-rtl-catalogue-review > div > p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.pricing-rtl-catalogue-blockers {
  margin: 0;
}

.pricing-rtl-catalogue-blockers code {
  overflow-wrap: anywhere;
}

.pricing-workspace[data-catalog-kind="short_term"] .pricing-comparison-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-preliminary-summary {
  margin: 10px 0 0;
  padding: 7px 9px;
  border: 1px solid rgba(225, 170, 73, 0.3);
  border-radius: 7px;
  background: var(--orange-soft);
  color: var(--warning-text);
  font-size: 9px;
  line-height: 1.4;
}

.modal[open][data-variant="pricing-questions"] {
  width: min(560px, calc(100vw - 30px));
}

.pricing-question-form {
  gap: 12px;
}

.pricing-question-intro {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.pricing-question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pricing-question-field {
  align-content: start;
}

.pricing-question-grid .form-hint {
  font-size: 9px;
}

.pricing-offer-explanation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
}

.pricing-offer-explanation p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.pricing-offer-explanation .button {
  min-width: 116px;
  min-height: 36px;
  flex: 0 0 auto;
  padding-inline: 14px;
  white-space: nowrap;
}

.pricing-outcome-list {
  display: grid;
  gap: 8px;
}

.pricing-outcome-list article {
  padding: 11px 12px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--field);
}

.pricing-outcome-list article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pricing-outcome-list strong {
  font-size: 11px;
}

.pricing-outcome-list p,
.pricing-outcome-list small {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.pricing-comparison {
  margin-top: 12px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--field);
}

.pricing-comparison summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  color: var(--text);
  font-size: 11px;
  font-weight: 620;
  cursor: pointer;
  list-style: none;
}

.pricing-comparison summary::-webkit-details-marker {
  display: none;
}

.pricing-comparison[open] summary {
  border-bottom: 1px solid var(--line-subtle);
}

.pricing-comparison-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pricing-comparison-grid article {
  min-width: 0;
  padding: 11px;
  border-right: 1px solid var(--line-subtle);
}

.pricing-comparison-grid article:last-child {
  border-right: 0;
}

.pricing-comparison-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 10px;
}

.pricing-comparison-grid p {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 9px;
}

.pricing-county-provenance {
  margin: 10px 2px 0;
  color: var(--dim);
  font-size: 9px;
}

.modal[open][data-variant="pricing-offer"],
.modal[open][data-variant="pricing-term-sheet"] {
  width: min(82vw, 1380px);
  height: min(82vh, 900px);
  max-height: min(82vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.modal[open][data-variant="pricing-history"] {
  width: min(900px, 82vw);
  max-height: min(82vh, 860px);
}

.modal[data-variant="pricing-offer"] .modal-body,
.modal[data-variant="pricing-term-sheet"] .modal-body {
  min-height: 0;
  max-height: none;
  overflow: hidden;
  padding: 0;
}

.pricing-review-layout {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  overflow: hidden;
  background: var(--bg);
}

.pricing-review-main,
.pricing-review-side {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.pricing-review-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 10px;
}

.pricing-review-main.pricing-rtl-review-main {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.pricing-review-side {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border-left: 1px solid var(--line-subtle);
  background: var(--panel);
}

.pricing-review-side-scroll {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 13px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px 13px;
  scrollbar-gutter: stable;
}

.pricing-review-summary {
  display: grid;
  grid-template-columns: minmax(230px, 1.55fr) repeat(3, minmax(105px, 0.7fr));
  overflow: hidden;
  border: 1px solid rgba(124, 134, 237, 0.42);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2b3065 0%, #222741 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.pricing-review-summary > div {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 11px;
  background: transparent;
}

.pricing-review-summary > div + div {
  border-left: 1px solid rgba(220, 223, 255, 0.14);
}

.pricing-review-summary p,
.pricing-review-summary span {
  margin: 0;
  color: #b6bae2;
  font-size: 9px;
}

.pricing-review-rate > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pricing-review-rate > div > strong {
  font-size: 30px;
  letter-spacing: -0.045em;
}

.pricing-review-rate small {
  color: var(--success-text);
  font-size: 9px;
  font-weight: 620;
}

.pricing-review-summary strong {
  color: #fff;
  font-size: 15px;
}

.pricing-ladder {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
}

.pricing-review-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line-subtle);
}

.pricing-review-section-head h3,
.pricing-review-section-head p {
  margin: 0;
}

.pricing-review-section-head > p {
  max-width: 390px;
  color: var(--dim);
  font-size: 9px;
  text-align: right;
}

.pricing-review-section-head .eyebrow {
  margin-bottom: 3px;
}

.pricing-ladder-scroll {
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: auto;
}

.pricing-ladder-head,
.pricing-ladder-row {
  min-width: 720px;
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  align-items: center;
}

.pricing-ladder-head {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line-subtle);
  background: #292e52;
  color: #c7cae6;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pricing-ladder-row {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 560;
  text-align: left;
}

.pricing-ladder-row:hover,
.pricing-ladder-row.active {
  background: var(--blue-soft);
  color: var(--text);
}

.pricing-ladder-row.active {
  background: rgba(98, 108, 213, 0.18);
  box-shadow: inset 3px 0 0 var(--blue-bright);
}

.pricing-rtl-rate-ladder {
  max-height: 240px;
}

.pricing-ladder-head.pricing-rtl-ladder-grid,
.pricing-ladder-row.pricing-rtl-ladder-grid {
  min-width: 980px;
  grid-template-columns:
    minmax(170px, 1.35fr)
    repeat(4, minmax(116px, 1fr))
    repeat(2, minmax(128px, 1fr));
}

.pricing-rtl-ladder-row {
  min-height: 52px;
  cursor: pointer;
}

.pricing-rtl-ladder-row > span {
  min-width: 0;
}

.pricing-rtl-ladder-rate {
  display: grid;
  gap: 4px;
}

.pricing-rtl-ladder-rate > strong {
  color: var(--text);
  font-size: 11px;
}

.pricing-rtl-ladder-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.pricing-rtl-ladder-labels small {
  padding: 2px 5px;
  border: 1px solid rgba(98, 108, 213, 0.28);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--muted);
  font-size: 7px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.pricing-economics {
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
}

.pricing-economics > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-subtle);
}

.pricing-economics article {
  display: grid;
  gap: 2px;
  min-height: 68px;
  padding: 9px 11px;
  background: var(--panel);
}

.pricing-economics article.internal {
  background: var(--orange-soft);
}

.pricing-economics span {
  color: var(--dim);
  font-size: 9px;
}

.pricing-economics strong {
  font-size: 13px;
}

.pricing-economics small {
  align-self: end;
  color: var(--dim);
  font-size: 8px;
}

.pricing-review-side section {
  padding: 13px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--field);
}

.pricing-review-side h3 {
  margin-bottom: 10px;
}

.pricing-review-side .eyebrow {
  margin: 0 0 3px;
}

.pricing-review-side dl,
.pricing-history-list dl,
.pricing-term-document dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.pricing-review-side dl > div,
.pricing-history-list dl > div,
.pricing-term-document dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pricing-review-side dl > div {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-subtle);
}

.pricing-review-side dl > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pricing-review-side dt,
.pricing-review-side dd,
.pricing-history-list dt,
.pricing-history-list dd,
.pricing-term-document dt,
.pricing-term-document dd {
  margin: 0;
  font-size: 9px;
}

.pricing-review-side dt,
.pricing-history-list dt,
.pricing-term-document dt {
  color: var(--dim);
}

.pricing-review-side dd,
.pricing-history-list dd,
.pricing-term-document dd {
  color: var(--text);
  text-align: right;
}

.pricing-review-side section > .button {
  margin-top: 12px;
}

.pricing-readiness-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pricing-readiness-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border-radius: 8px;
  background: var(--panel);
}

.pricing-readiness-list li > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.pricing-readiness-list li.warning > span,
.pricing-readiness-list li.fail > span {
  background: var(--orange-soft);
  color: var(--orange);
}

.pricing-readiness-list .ui-icon {
  width: 13px;
  height: 13px;
}

.pricing-readiness-list strong {
  display: block;
  font-size: 9px;
}

.pricing-readiness-list p {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 8px;
}

.pricing-review-action {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--line-subtle);
  background: var(--panel);
  box-shadow: 0 -12px 24px rgba(0, 0, 0, 0.12);
}

.pricing-review-action .button {
  min-height: 44px;
  justify-content: space-between;
}

.pricing-review-action p {
  margin: 0;
  text-align: center;
}

.detail-drawer[data-variant="pricing-audit"] {
  width: min(640px, 100vw);
}

.pricing-audit {
  display: grid;
  gap: 15px;
}

.pricing-audit-tabs {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-subtle);
}

.pricing-audit-tabs .tab-button {
  flex: 0 0 auto;
  padding: 0 0 10px;
}

.pricing-audit-tabs .tab-button.active {
  border-bottom: 2px solid var(--blue-bright);
  color: var(--text);
}

.pricing-audit-rows {
  display: grid;
  gap: 8px;
}

.pricing-audit-rows article {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--field);
}

.pricing-audit-state {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.pricing-audit-state.fail {
  background: var(--red-soft);
  color: var(--red);
}

.pricing-audit-state.warning {
  background: var(--orange-soft);
  color: var(--orange);
}

.pricing-audit-state .ui-icon {
  width: 12px;
  height: 12px;
}

.pricing-audit-rows article > div {
  min-width: 0;
  flex: 1;
}

.pricing-audit-rows article > div > strong,
.pricing-audit-rows article > div > span {
  display: block;
}

.pricing-audit-rows strong {
  font-size: 11px;
}

.pricing-audit-rows article > div > span,
.pricing-audit-rows p {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 9px;
}

.pricing-history {
  display: grid;
  gap: 13px;
}

.pricing-history-list {
  display: grid;
  gap: 9px;
}

.pricing-history-list article {
  padding: 12px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--field);
}

.pricing-history-list article > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.pricing-history-list h3,
.pricing-history-list header p,
.pricing-history-list header span {
  margin: 0;
}

.pricing-history-list header span {
  color: var(--dim);
  font-size: 9px;
}

.pricing-history-list dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pricing-history-list article > footer {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
}

.pricing-term-layout {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(440px, 1.22fr);
  overflow: hidden;
}

.pricing-term-editor,
.pricing-term-preview {
  min-height: 0;
  overflow: auto;
}

.pricing-term-editor {
  padding: 16px;
  border-right: 1px solid var(--line-subtle);
}

.pricing-term-preview {
  padding: 22px;
  background: #17181d;
}

.pricing-term-editor > .form-hint {
  display: block;
  margin: 0 0 14px;
}

.pricing-term-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.pricing-term-totals > div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--field);
}

.pricing-term-totals span {
  color: var(--dim);
  font-size: 8px;
  text-transform: uppercase;
}

.pricing-term-totals strong {
  font-size: 11px;
}

.pricing-term-download {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  min-height: 42px;
  margin-top: 12px;
  box-shadow: 0 -10px 22px var(--bg);
}

.pricing-term-download .ui-icon {
  width: 16px;
  height: 16px;
}

.pricing-term-actions {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  background: var(--bg);
  box-shadow: 0 -10px 22px var(--bg);
}

.pricing-term-actions .pricing-term-download {
  position: static;
  margin-top: 0;
  box-shadow: none;
}

.pricing-term-document {
  width: min(760px, 100%);
  min-height: 980px;
  margin: 0 auto;
  padding: 44px 50px 28px;
  border-radius: 4px;
  background: #fff;
  color: #4b4c50;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.32);
}

.pricing-term-document-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e8e8e8;
}

.pricing-term-brand img {
  display: block;
  width: 108px;
  height: auto;
  filter: brightness(0) saturate(100%) invert(36%) sepia(94%) saturate(2192%) hue-rotate(212deg) brightness(101%) contrast(103%);
}

.pricing-term-brand address {
  margin-top: 9px;
  color: #5f6064;
  font-size: 10px;
  font-style: normal;
  line-height: 1.55;
}

.pricing-term-title {
  text-align: right;
}

.pricing-term-title h2,
.pricing-term-title span {
  margin: 0;
}

.pricing-term-title h2 {
  color: #45464a;
  font-size: 20px;
  line-height: 1.15;
}

.pricing-term-title span {
  display: block;
  max-width: 210px;
  margin-top: 8px;
  color: #77787c;
  font-size: 8px;
  overflow-wrap: anywhere;
}

.pricing-term-document-section {
  margin-top: 20px;
}

.pricing-term-document-section h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 9px;
  color: #45464a;
  font-size: 13px;
  font-weight: 500;
}

.pricing-term-document-section h3 .ui-icon {
  width: 13px;
  height: 13px;
  color: #2266ee;
  stroke-width: 2;
}

.pricing-term-loan-information {
  padding-top: 16px;
  border-top: 1px solid #3f4044;
}

.pricing-term-document dl {
  gap: 0;
}

.pricing-term-document .pricing-term-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  min-height: 24px;
  padding: 4px 8px;
}

.pricing-term-document .pricing-term-row dt,
.pricing-term-document .pricing-term-row dd {
  color: #5c5d61;
  font-size: 10px;
  line-height: 1.35;
}

.pricing-term-document .pricing-term-row dd {
  max-width: 65%;
  color: #77787c;
  text-align: right;
  overflow-wrap: anywhere;
}

.pricing-term-summary-card {
  margin-top: 18px;
  padding: 3px 9px 0;
  border: 1px solid #dedfe3;
  border-radius: 7px;
}

.pricing-term-document .pricing-term-row-major {
  min-height: 31px;
  align-items: center;
  padding-top: 7px;
  padding-bottom: 7px;
}

.pricing-term-document .pricing-term-row-major dt,
.pricing-term-document .pricing-term-row-major dd {
  color: #4a4b4f;
  font-size: 13px;
  font-weight: 650;
}

.pricing-term-document .pricing-term-row-major dt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pricing-term-document .pricing-term-row-major dt .ui-icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: #2266ee;
  stroke-width: 2;
}

.pricing-term-document .pricing-term-row-rule {
  border-top: 1px solid #3f4044;
}

.pricing-term-document .pricing-term-row-secondary {
  padding-bottom: 8px;
}

.pricing-term-disclaimer {
  margin: 7px 0 0;
  padding: 10px 0 8px;
  border-top: 1px solid #3f4044;
  color: #606166;
  font-size: 7.5px;
  line-height: 1.3;
}

.pricing-term-document-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  color: #65666a;
}

.pricing-term-document-footer p,
.pricing-term-document-footer strong {
  margin: 0;
  font-size: 9px;
}

.pricing-term-document-footer strong {
  font-weight: 700;
}

.pricing-term-housing-mark {
  display: grid;
  justify-items: center;
  color: #7c7d81;
  line-height: 0.8;
}

.pricing-term-housing-mark > span {
  font-size: 22px;
}

.pricing-term-housing-mark small {
  font-size: 4px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .pricing-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  .pricing-input-panel {
    min-height: 0;
    height: calc(100vh - 255px);
    height: max(420px, calc(100dvh - 255px));
  }

  .pricing-workspace:has(.pricing-catalog-toggle) .pricing-input-panel {
    height: calc(100vh - 318px);
    height: max(420px, calc(100dvh - 318px));
  }

  .pricing-results-panel {
    min-height: 520px;
  }

  .pricing-comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-workspace[data-catalog-kind="short_term"] .pricing-comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-comparison-grid article:nth-child(2) {
    border-right: 0;
  }

  .pricing-comparison-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-subtle);
  }
}

@media (max-width: 940px) {
  .modal[open][data-variant="pricing-offer"],
  .modal[open][data-variant="pricing-term-sheet"],
  .modal[open][data-variant="pricing-history"] {
    width: calc(100vw - 28px);
    height: calc(100vh - 28px);
    max-height: calc(100vh - 28px);
  }

  .pricing-review-layout {
    display: block;
    overflow: auto;
  }

  .pricing-term-layout {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .pricing-review-main,
  .pricing-review-side,
  .pricing-term-editor,
  .pricing-term-preview {
    overflow: visible;
  }

  .pricing-review-main {
    display: block;
  }

  .pricing-ladder,
  .pricing-economics {
    margin-top: 10px;
  }

  .pricing-ladder-scroll {
    height: auto;
    max-height: 320px;
  }

  .pricing-rtl-rate-ladder {
    max-height: none;
  }

  .pricing-review-side,
  .pricing-term-preview {
    border-top: 1px solid var(--line-subtle);
    border-left: 0;
  }

  .pricing-review-side {
    display: block;
  }

  .pricing-review-side-scroll {
    overflow: visible;
  }

  .pricing-review-action {
    position: sticky;
    bottom: 0;
  }

  .pricing-term-editor {
    border-right: 0;
  }

  .pricing-review-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .pricing-question-grid {
    grid-template-columns: 1fr;
  }

  .pricing-catalog-toggle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-catalog-toggle button {
    padding-inline: 10px;
  }

  .pricing-input-panel,
  .pricing-results-panel {
    min-height: 0;
    height: auto;
    max-height: none;
  }

  .pricing-input-scroll,
  .pricing-results-scroll {
    overflow: visible;
  }

  .pricing-input-head,
  .pricing-input-scroll,
  .pricing-screen-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .pricing-grid-2,
  .pricing-grid-3,
  .pricing-offer-metrics,
  .pricing-comparison-grid,
  .pricing-economics > div,
  .pricing-history-list dl,
  .pricing-term-totals,
  .pricing-term-document dl {
    grid-template-columns: 1fr;
  }

  .pricing-rtl-catalogue-grid,
  .pricing-workspace[data-catalog-kind="short_term"] .pricing-comparison-grid {
    grid-template-columns: 1fr;
  }

  .pricing-subhead,
  .pricing-offer-head,
  .pricing-offer-explanation {
    align-items: flex-start;
    flex-direction: column;
  }

  .pricing-subhead p {
    text-align: left;
  }

  .pricing-loan-search-row,
  .pricing-selected-banner {
    grid-template-columns: 1fr;
  }

  .pricing-selected-banner > .ui-icon {
    display: none;
  }

  .pricing-selected-banner .pricing-selected-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pricing-result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-result-summary .button {
    grid-column: 1 / -1;
  }

  .pricing-result-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .pricing-result-controls > div {
    justify-content: flex-start;
  }

  .pricing-sort-chip,
  .pricing-offer-explanation .button {
    width: 100%;
  }

  .pricing-comparison-grid article,
  .pricing-comparison-grid article:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line-subtle);
  }

  .pricing-comparison-grid article:last-child {
    border-bottom: 0;
  }

  .pricing-review-summary {
    grid-template-columns: 1fr;
  }

  .pricing-review-summary > div + div {
    border-top: 1px solid rgba(220, 223, 255, 0.14);
    border-left: 0;
  }

  .pricing-review-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .pricing-review-section-head > p {
    max-width: none;
    text-align: left;
  }

  .pricing-term-document {
    min-height: 0;
    padding: 24px 18px;
  }

  .pricing-term-preview {
    padding: 10px;
  }

  .pricing-term-document-header {
    gap: 12px;
  }

  .pricing-term-brand img {
    width: 86px;
  }

  .pricing-term-brand address {
    font-size: 8px;
  }

  .pricing-term-title h2 {
    font-size: 16px;
  }

  .pricing-term-title span {
    max-width: 125px;
  }

  .pricing-term-document .pricing-term-row {
    gap: 12px;
    padding-right: 3px;
    padding-left: 3px;
  }

  .pricing-term-document .pricing-term-row dd {
    max-width: 58%;
  }

  .pricing-term-document-footer {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pricing-term-document-footer strong {
    display: none;
  }

  .pricing-history-list article > header,
  .pricing-history-list article > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-drawer[data-variant="pricing-audit"] {
    width: 100vw;
  }
}

/* Unified record workspaces: Borrower is the visual authority for Lead and Loan detail. */
.lead-workspace-page > .lead-workspace,
.loan-workspace {
  min-height: 0;
  height: auto;
  border: 0;
  background: transparent;
}

.lead-workspace,
.loan-workspace {
  width: 100%;
  display: flex;
  overflow: visible;
  flex-direction: column;
  gap: 18px;
}

.lead-workspace-hero,
.loan-workspace-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(98, 108, 213, 0.11), rgba(32, 33, 38, 0) 50%), var(--panel);
}

.lead-profile-header {
  grid-template-columns: none;
  border-bottom: 0;
}

.lead-profile-primary,
.loan-workspace-title {
  gap: 16px;
}

.loan-workspace-title {
  min-width: min(420px, 100%);
  flex: 1 1 420px;
}

.lead-profile-primary > div,
.loan-workspace-title > div {
  min-width: 0;
}

.lead-profile-avatar,
.loan-workspace-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

.lead-profile-title h1,
.loan-title-line h1 {
  overflow: hidden;
  margin: 0;
  font-size: 27px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-workspace-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.record-workspace-meta > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.record-workspace-meta a {
  color: inherit;
  text-decoration: none;
}

.record-workspace-meta a:hover {
  color: var(--text);
}

.record-workspace-meta .ui-icon {
  width: 12px;
  height: 12px;
}

.record-workspace-meta .loan-number-meta {
  color: var(--text);
  font-weight: 650;
}

.lead-profile-actions,
.loan-workspace-hero .page-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.lead-workspace-metrics,
.loan-workspace-metrics {
  display: grid;
  overflow: hidden;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.lead-workspace-metrics > div,
.loan-workspace-metrics > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 16px 18px;
  border: 0;
}

.lead-workspace-metrics > div + div,
.loan-workspace-metrics > div + div {
  border-left: 1px solid var(--line-subtle);
}

.lead-workspace-metrics span,
.lead-workspace-metrics small,
.loan-workspace-metrics span,
.loan-workspace-metrics small {
  display: block;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-workspace-metrics span,
.loan-workspace-metrics span {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-workspace-metrics strong,
.loan-workspace-metrics strong {
  display: block;
  overflow: hidden;
  margin: 0;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-workspace-main,
.loan-workspace-main {
  min-height: 0;
  overflow: hidden;
}

.lead-workspace-tabs,
.loan-workspace-tabs {
  display: flex;
  overflow-x: auto;
  gap: 24px;
  padding: 15px 22px 0;
  border-bottom: 1px solid var(--line-subtle);
}

.lead-workspace-tabs {
  overflow-y: hidden;
  scrollbar-width: none;
}

.lead-workspace-tabs::-webkit-scrollbar {
  display: none;
}

.borrower-workspace-tabs .tab-button,
.lead-workspace-tabs .tab-button,
.loan-workspace-tabs .tab-button {
  flex: 0 0 auto;
  padding-bottom: 13px;
  white-space: nowrap;
}

.lead-workspace-content,
.loan-workspace-content {
  min-height: 300px;
  padding: 22px;
}

.lead-workspace-content > #leadIntelligenceSource {
  margin-bottom: 16px;
}

.lead-workspace-content > #leadIntelligenceSource[hidden] {
  display: none;
}

.lead-workspace-content .lead-intelligence-tabs,
.lead-mobile-switch {
  display: none;
}

.lead-record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  align-items: start;
  gap: 16px;
}

.loan-workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  align-items: start;
  gap: 16px;
}

.lead-record-layout > .lead-conversation-panel,
.loan-workspace-sidebar {
  position: sticky;
  top: 82px;
}

.lead-record-layout > .lead-conversation-panel {
  width: 100%;
  min-height: 520px;
  height: min(690px, calc(100vh - 190px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.loan-workspace-sidebar {
  display: grid;
  gap: 13px;
}

.loan-stage-panel .panel-body {
  padding: 14px;
}

.loan-stage-panel .loan-stage-field {
  gap: 7px;
  margin: 0;
}

.loan-stage-panel .loan-stage-field small {
  color: var(--dim);
  font-size: 9px;
}

.loan-team-panel .panel-body {
  display: grid;
  padding: 16px;
}

.loan-team-panel .loan-team-row {
  min-height: 38px;
}

.loan-team-panel .loan-team-row + .loan-team-row {
  margin-top: 12px;
  padding-top: 12px;
}

.loan-team-panel .panel-body > .button {
  margin-top: 16px;
}

.loan-overview-grid,
.loan-operations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.loan-connected-work-card {
  grid-column: 1 / -1;
}

.lead-record-overview .lead-conversation-brief {
  grid-column: 1 / -1;
}

.loan-overview-grid .borrower-action-stack .action-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

@media (max-width: 940px) {
  .lead-workspace-hero,
  .loan-workspace-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .lead-profile-actions,
  .loan-workspace-hero .page-actions {
    width: 100%;
    grid-column: auto;
    justify-content: flex-start;
  }

  .loan-overview-grid,
  .loan-operations-grid {
    grid-template-columns: 1fr;
  }

  .loan-connected-work-card {
    grid-column: auto;
  }

  .lead-record-layout,
  .loan-workspace-layout {
    grid-template-columns: 1fr;
  }

  .lead-record-layout > .lead-conversation-panel,
  .loan-workspace-sidebar {
    position: static;
  }
}

@media (max-width: 680px) {
  .lead-workspace,
  .loan-workspace {
    gap: 14px;
  }

  .lead-workspace-hero,
  .loan-workspace-hero {
    padding: 18px;
  }

  .lead-profile-primary,
  .loan-workspace-title {
    align-items: flex-start;
  }

  .lead-profile-avatar,
  .loan-workspace-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .lead-profile-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .lead-profile-title h1,
  .loan-title-line h1 {
    font-size: 22px;
  }

  .lead-profile-actions .button,
  .lead-borrower-action,
  .loan-workspace-hero .button {
    width: 100%;
  }

  .lead-stage-control {
    width: 100%;
  }

  .lead-workspace-metrics,
  .loan-workspace-metrics {
    grid-template-columns: 1fr;
  }

  .lead-workspace-metrics > div + div,
  .loan-workspace-metrics > div + div {
    border-top: 1px solid var(--line-subtle);
    border-left: 0;
  }

  .lead-workspace-tabs,
  .loan-workspace-tabs {
    gap: 18px;
    padding: 12px 14px 0;
  }

  .lead-workspace-content,
  .loan-workspace-content {
    padding: 14px;
  }

  .lead-record-layout > .lead-conversation-panel {
    height: min(660px, calc(100vh - 190px));
  }

  .lead-overview-grid,
  .lead-activity-grid,
  .loan-overview-grid .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Lead assignment and follow-up controls share one compact visual language. */
.lead-record-control {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  line-height: 1.2;
}

button.lead-record-control {
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

button.lead-record-control:hover,
button.lead-record-control:focus-visible {
  border-color: var(--line);
  background: var(--panel-hover);
}

button.lead-record-control:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.lead-record-control-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.lead-assignee-control .lead-record-control-icon {
  border: 1px solid rgba(124, 134, 237, 0.22);
  background: var(--blue-soft);
  color: var(--accent-text);
}

.lead-record-control-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.lead-record-control-copy {
  min-width: 0;
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
}

.lead-record-control-copy strong,
.lead-record-control-copy small {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-record-control-copy strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 620;
}

.lead-record-control-copy small {
  color: var(--dim);
  font-size: 9px;
}

.lead-follow-up-control.is-overdue .lead-record-control-icon {
  background: var(--red-soft);
  color: var(--danger-text);
}

.lead-follow-up-control.is-overdue .lead-record-control-copy small {
  color: var(--danger-text);
  font-weight: 650;
}

.lead-follow-up-control.is-today .lead-record-control-icon {
  background: var(--orange-soft);
  color: var(--warning-text);
}

.lead-follow-up-control.is-upcoming .lead-record-control-icon {
  background: var(--blue-soft);
  color: var(--accent-text);
}

.lead-directory-table {
  min-width: 900px;
}

.lead-directory-table .lead-contact-cell {
  min-width: 220px;
}

.lead-contact-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.lead-assignment-directory-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
  color: var(--dim);
  font-size: 10px;
}

.modal[data-variant="lead-assignment"] {
  width: min(580px, calc(100vw - 30px));
}

.lead-assignment-form {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.lead-assignment-intro {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(98, 108, 213, 0.2);
  border-radius: 10px;
  background: linear-gradient(110deg, rgba(98, 108, 213, 0.1), rgba(98, 108, 213, 0.025) 58%, transparent);
}

.lead-assignment-intro-icon {
  width: 32px;
  height: 32px;
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid rgba(124, 134, 237, 0.25);
  border-radius: 9px;
  background: rgba(98, 108, 213, 0.1);
  color: var(--accent-text);
}

.lead-assignment-intro-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.lead-assignment-intro > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.lead-assignment-intro strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
}

.lead-assignment-intro > div > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.lead-assignment-panel {
  display: grid;
  min-width: 0;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line-subtle);
  border-radius: 11px;
  background: var(--field);
}

.lead-assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.lead-assignment-field,
.lead-assignment-reason {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.lead-assignment-field-label {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.lead-assignment-field-label small {
  color: var(--dim);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-assignment-field select,
.lead-assignment-reason input {
  min-height: 42px;
  border-radius: 9px;
  background-color: var(--field);
}

.lead-assignment-current,
.lead-assignment-help {
  margin: 0;
  color: var(--dim);
  font-size: 9px;
  font-weight: 450;
  line-height: 1.45;
}

.lead-assignment-current {
  color: var(--orange);
}

.lead-assignment-reason {
  padding-top: 11px;
  border-top: 1px solid var(--line-subtle);
}

.lead-assignment-form > .form-error:empty {
  display: none;
}

.lead-assignment-form > .form-error {
  margin: 0;
}

.lead-assignment-form > .modal-footer {
  margin-top: 2px;
}

.lead-directory-table .lead-control-cell {
  width: 176px;
  min-width: 164px;
}

.lead-directory-table .lead-message-cell {
  width: 220px;
  max-width: 260px;
  cursor: default;
}

.lead-directory-table .lead-record-control {
  min-height: 36px;
}

.lead-directory-table button.lead-record-control {
  width: calc(100% + 12px);
  margin: -5px -6px;
  padding: 5px 6px;
}

.lead-directory-table .lead-record-control-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.lead-workspace-metrics .lead-summary-control {
  padding: 10px 12px;
}

.lead-workspace-metrics .lead-summary-control.is-clickable {
  cursor: pointer;
  transition: background 140ms ease;
}

.lead-workspace-metrics .lead-summary-control.is-clickable:hover {
  background: var(--quiet-fill);
}

.lead-workspace-metrics .lead-summary-control > span:first-child {
  padding: 0 6px;
}

.lead-workspace-metrics .lead-record-control {
  min-height: 46px;
  margin-top: 1px;
  color: var(--text);
  font-size: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.lead-workspace-metrics button.lead-record-control {
  padding: 5px 6px;
}

.lead-workspace-metrics .lead-record-control-copy {
  display: grid;
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.lead-workspace-metrics .lead-record-control-copy strong {
  font-size: 15px;
  letter-spacing: normal;
  text-transform: none;
}

.lead-workspace-metrics .lead-record-control-copy small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: normal;
  text-transform: none;
}

.lead-workspace-metrics .lead-record-control-icon {
  display: inline-grid;
  overflow: visible;
  margin: 0;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
}

.lead-workspace-metrics .assignee-avatar-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
}

.lead-kanban-controls {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line-subtle);
}

.lead-kanban-controls .lead-record-control {
  min-height: 28px;
}

.lead-kanban-controls .lead-record-control-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  border-radius: 7px;
}

.lead-kanban-controls .lead-record-control-copy strong {
  font-size: 10px;
}

.lead-kanban-controls .lead-record-control-copy small {
  font-size: 8px;
}

.modal[data-variant="lead-follow-up"] {
  width: min(720px, calc(100vw - 30px));
}

.lead-follow-up-form {
  min-width: 0;
  gap: 14px;
}

.lead-follow-up-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lead-follow-up-presets .button {
  width: 100%;
  border-color: var(--line-subtle);
  background: transparent;
}

.lead-follow-up-picker-trigger {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(110deg, var(--blue-soft), var(--panel) 46%);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.lead-follow-up-picker-trigger:hover,
.lead-follow-up-picker-trigger.is-open {
  border-color: rgba(124, 134, 237, 0.48);
  background: linear-gradient(110deg, rgba(98, 108, 213, 0.16), var(--panel-hover) 48%);
}

.lead-follow-up-picker-trigger:active {
  transform: translateY(1px);
}

.lead-follow-up-picker-trigger > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(124, 134, 237, 0.25);
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--accent-text);
  font-style: normal;
}

.lead-follow-up-picker-trigger > i .ui-icon {
  width: 17px;
  height: 17px;
}

.lead-follow-up-picker-trigger > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.lead-follow-up-picker-trigger small,
.lead-follow-up-picker-trigger span > span {
  color: var(--dim);
  font-size: 9px;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-follow-up-picker-trigger strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-follow-up-picker-chevron {
  width: 16px;
  height: 16px;
  color: var(--dim);
  transition: transform 160ms ease;
}

.lead-follow-up-picker-trigger.is-open .lead-follow-up-picker-chevron {
  transform: rotate(180deg);
}

.lead-follow-up-picker-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.lead-follow-up-picker-panel[hidden] {
  display: none;
}

.lead-follow-up-calendar {
  min-width: 0;
  padding: 14px;
}

.lead-calendar-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.lead-calendar-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.lead-calendar-head .icon-button {
  width: 32px;
  height: 32px;
}

.lead-calendar-head .ui-icon {
  width: 14px;
  height: 14px;
}

.lead-calendar-weekdays,
.lead-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.lead-calendar-weekdays {
  margin-bottom: 5px;
}

.lead-calendar-weekdays span {
  padding: 4px 0;
  color: var(--dim);
  font-size: 9px;
  font-weight: 650;
  text-align: center;
}

.lead-calendar-day {
  min-width: 0;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 580;
  cursor: pointer;
  transition: border-color 100ms ease, background 100ms ease, color 100ms ease, transform 100ms ease;
}

.lead-calendar-day:hover {
  border-color: var(--line);
  background: var(--panel-hover);
  color: var(--text);
}

.lead-calendar-day:active {
  transform: scale(0.95);
}

.lead-calendar-day.is-outside {
  color: var(--dim);
}

.lead-calendar-day.is-today {
  border-color: rgba(124, 134, 237, 0.55);
  color: var(--accent-text);
}

.lead-calendar-day.is-selected {
  border-color: var(--blue-bright);
  background: linear-gradient(145deg, var(--blue-bright), var(--blue));
  color: white;
  box-shadow: 0 5px 14px rgba(98, 108, 213, 0.28);
}

.lead-calendar-today {
  padding-top: 9px;
  color: var(--accent-text);
  font-size: 10px;
}

.lead-follow-up-time {
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 16px;
  border-left: 1px solid var(--line-subtle);
  background: var(--panel-2);
}

.lead-follow-up-time-head {
  display: grid;
  gap: 3px;
}

.lead-follow-up-time-head > span,
.lead-follow-up-time-fields label > span {
  color: var(--dim);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-follow-up-time-head strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.lead-follow-up-time-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lead-follow-up-time-fields label {
  gap: 5px;
}

.lead-follow-up-time-fields select {
  min-height: 38px;
  padding: 7px 38px 7px 9px;
  background-color: var(--panel);
  font-size: 12px;
  font-weight: 620;
}

.lead-follow-up-period {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-subtle);
  border-radius: 9px;
  background: var(--panel);
}

.lead-follow-up-period button {
  min-height: 31px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.lead-follow-up-period button:hover {
  color: var(--text);
}

.lead-follow-up-period button.active {
  background: var(--blue-soft);
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1px rgba(124, 134, 237, 0.2);
}

.lead-follow-up-time-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding-top: 3px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.45;
}

.lead-follow-up-time-note .ui-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

@media (min-width: 681px) and (max-width: 940px) {
  .lead-workspace-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-workspace-metrics > div + div {
    border-left: 0;
  }

  .lead-workspace-metrics > div:nth-child(even) {
    border-left: 1px solid var(--line-subtle);
  }

  .lead-workspace-metrics > div:nth-child(n + 3) {
    border-top: 1px solid var(--line-subtle);
  }
}

@media (max-width: 680px) {
  .modal[data-variant="lead-assignment"] {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .lead-assignment-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .lead-assignment-directory-more {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-assignment-directory-more .button {
    width: 100%;
  }

  .lead-assignment-form > .modal-footer {
    flex-wrap: wrap;
  }

  .lead-directory-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .lead-directory-table {
    min-width: 0;
    display: block;
  }

  .lead-directory-table thead {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .lead-directory-table tbody {
    display: grid;
    gap: 10px;
  }

  .lead-directory-table tbody tr {
    display: grid;
    overflow: hidden;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "contact contact"
      "stage assigned"
      "message message"
      "followup time";
    border: 1px solid var(--line-subtle);
    border-radius: var(--radius);
    background: var(--panel);
  }

  .lead-directory-table td,
  .lead-directory-table .primary-cell,
  .lead-directory-table .lead-control-cell,
  .lead-directory-table .lead-message-cell {
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    display: grid;
    align-content: start;
    gap: 7px;
    padding: 10px 11px;
    border: 0;
    white-space: normal;
  }

  .lead-directory-table td::before {
    content: attr(data-label);
    color: var(--dim);
    font-size: 8px;
    font-weight: 650;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
  }

  .lead-directory-table .lead-contact-cell {
    grid-area: contact;
    border-bottom: 1px solid var(--line-subtle);
  }

  .lead-directory-table .lead-stage-cell {
    grid-area: stage;
  }

  .lead-directory-table .lead-time-cell {
    grid-area: time;
    border-top: 1px solid var(--line-subtle);
  }

  .lead-directory-table td[data-label="Assignee"] {
    grid-area: assigned;
  }

  .lead-directory-table td[data-label="Follow-up"] {
    grid-area: followup;
    border-top: 1px solid var(--line-subtle);
  }

  .lead-directory-table .lead-message-cell {
    grid-area: message;
    border-top: 1px solid var(--line-subtle);
  }

  .lead-directory-table button.lead-record-control {
    width: 100%;
    margin: 0;
  }

  .lead-directory-table tbody tr:hover {
    background: var(--panel);
  }

  .lead-follow-up-form {
    min-width: 0;
  }

  .modal[data-variant="lead-follow-up"] {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .lead-follow-up-picker-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .lead-follow-up-time {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 10px;
    border-top: 1px solid var(--line-subtle);
    border-left: 0;
  }

  .lead-follow-up-time-head,
  .lead-follow-up-time-note {
    grid-column: 1 / -1;
  }

  .lead-follow-up-form .modal-footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 440px) {
  .lead-assignment-form > .modal-footer .button {
    flex: 1 1 calc(50% - 4px);
  }

  .lead-directory-table tbody tr {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "contact"
      "stage"
      "assigned"
      "message"
      "followup"
      "time";
  }

  .lead-directory-table td[data-label="Assignee"] {
    border-top: 1px solid var(--line-subtle);
  }

  .lead-follow-up-presets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .lead-follow-up-presets .button {
    min-width: 0;
    padding-inline: 5px;
    font-size: 10px;
  }

  .lead-follow-up-time {
    grid-template-columns: minmax(0, 1fr);
  }

  .lead-follow-up-time-head,
  .lead-follow-up-time-note {
    grid-column: auto;
  }

  .lead-follow-up-picker-trigger {
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    padding-inline: 10px;
  }

  .lead-follow-up-picker-trigger > i {
    width: 34px;
    height: 34px;
  }

  .lead-follow-up-calendar {
    padding: 11px;
  }

  .lead-calendar-weekdays,
  .lead-calendar-grid {
    gap: 2px;
  }

  .lead-calendar-day {
    min-height: 28px;
    border-radius: 7px;
  }

  .lead-follow-up-form .modal-footer-spacer {
    display: none;
  }

  .lead-follow-up-form .modal-footer .button {
    flex: 1 1 calc(50% - 4px);
  }

  .lead-follow-up-form .modal-footer [data-clear-follow-up] {
    flex-basis: 100%;
  }
}

/* Reports header is intentionally quieter than action-oriented workspaces. */
.reports-page > .page-head > .page-actions:empty {
  display: none;
}

.reports-page .reports-export {
  min-height: 32px;
  padding: 5px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 560;
}

.reports-page .reports-export:hover,
.reports-page .reports-export:focus-visible {
  border-color: var(--line-subtle);
  background: var(--panel-2);
  color: var(--text);
}

.reports-page .reports-export > .ui-icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 680px) {
  .reports-page > .page-head {
    position: relative;
    align-items: flex-start;
    flex-direction: row;
  }

  .reports-page-has-actions > .page-head {
    padding-right: 42px;
  }

  .reports-page > .page-head > div:first-child {
    min-width: 0;
  }

  .reports-page > .page-head > .page-actions {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
  }

  .reports-page .reports-head-actions {
    width: auto;
  }

  .reports-page .reports-head-actions > .reports-export {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .reports-page .reports-export-label {
    display: none;
  }
}

/* Account menu and personal account workspace */
.sidebar-bottom {
  position: relative;
}

.avatar {
  position: relative;
  overflow: hidden;
}

.avatar-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile[aria-expanded="true"] {
  border-color: rgba(124, 134, 237, 0.28);
  background: var(--panel);
}

.profile > .ui-icon {
  transition: transform 160ms ease, color 160ms ease;
}

.profile[aria-expanded="true"] > .ui-icon {
  color: var(--accent-text);
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  z-index: 50;
  bottom: calc(100% + 8px);
  left: 0;
  width: 286px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    radial-gradient(circle at 100% 0, rgba(124, 134, 237, 0.1), transparent 44%),
    var(--raised);
  box-shadow: var(--shadow);
  transform-origin: left bottom;
  animation: account-menu-in 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.account-menu[hidden] {
  display: none !important;
}

@keyframes account-menu-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.account-menu-identity {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line-subtle);
}

.account-menu-identity > span:last-child,
.account-menu-item > span:last-child {
  min-width: 0;
  display: grid;
}

.account-menu-identity strong,
.account-menu-identity small,
.account-menu-item strong,
.account-menu-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-identity strong {
  font-size: 12px;
  font-weight: 650;
}

.account-menu-identity small {
  color: var(--dim);
  font-size: 10px;
}

.account-menu-avatar {
  width: 38px;
  height: 38px;
}

.account-menu-list {
  display: grid;
  gap: 2px;
  padding: 6px;
}

.account-menu-signout {
  border-top: 1px solid var(--line-subtle);
}

.account-menu-item {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.account-menu-item:hover,
.account-menu-item:focus-visible {
  border-color: rgba(124, 134, 237, 0.16);
  background: rgba(124, 134, 237, 0.09);
  outline: none;
}

.account-menu-item > span:first-child {
  width: 30px;
  height: 30px;
  display: grid;
  border-radius: 8px;
  place-items: center;
  background: var(--hover-fill);
  color: var(--muted);
}

.account-menu-item .ui-icon {
  width: 14px;
  height: 14px;
}

.account-menu-item strong {
  font-size: 11px;
  font-weight: 620;
}

.account-menu-item small {
  color: var(--dim);
  font-size: 9px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 780px);
  align-items: start;
  justify-content: center;
  gap: 16px;
}

.account-summary {
  position: sticky;
  top: 88px;
}

.account-summary-visual {
  display: grid;
  justify-items: center;
  padding: 26px 20px 20px;
  border-bottom: 1px solid var(--line-subtle);
  background:
    radial-gradient(circle at 50% -18%, rgba(124, 134, 237, 0.2), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent);
}

.account-avatar {
  position: relative;
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(124, 134, 237, 0.3);
  border-radius: 50%;
  place-items: center;
  background: linear-gradient(145deg, rgba(124, 134, 237, 0.24), rgba(155, 138, 251, 0.1)), var(--panel-2);
  color: var(--accent-text-strong);
  font-weight: 720;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.account-avatar-large {
  width: 100px;
  height: 100px;
  font-size: 25px;
}

.account-avatar-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.account-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 15px;
}

.account-avatar-actions label.button {
  display: inline-flex;
  cursor: pointer;
}

.account-avatar-actions label:has(+ input:focus-visible) {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(98, 108, 213, 0.18);
}

.account-avatar-help,
.account-avatar-status {
  margin: 9px 0 0;
  color: var(--dim);
  font-size: 9px;
  text-align: center;
}

.account-avatar-status {
  min-height: 14px;
  margin-top: 4px;
}

.account-avatar-status.error {
  color: var(--red);
}

.account-summary-copy {
  display: grid;
  justify-items: center;
  padding: 20px;
  text-align: center;
}

.account-summary-copy h2 {
  margin: 11px 0 3px;
  font-size: 19px;
}

.account-summary-copy p {
  max-width: 100%;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-role-pill {
  padding: 4px 8px;
  border: 1px solid rgba(124, 134, 237, 0.2);
  border-radius: 999px;
  background: rgba(124, 134, 237, 0.09);
  color: var(--accent-text);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.account-access-list {
  display: grid;
  margin: 0;
  padding: 0 16px 14px;
}

.account-access-list > div {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line-subtle);
}

.account-access-list dt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.account-access-list dt .ui-icon {
  width: 13px;
  color: var(--dim);
}

.account-access-list dd {
  margin: 0;
  font-size: 10px;
  font-weight: 620;
}

.account-summary > .button {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
}

.account-content {
  display: grid;
  gap: 13px;
}

.account-card .panel-head > .ui-icon {
  width: 16px;
  color: var(--dim);
}

.account-card .panel-body {
  gap: 14px;
}

.account-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 2px;
}

.account-form-footer > span {
  color: var(--dim);
  font-size: 10px;
}

.account-form-footer .button {
  flex: 0 0 auto;
}

.account-session-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.account-session-icon {
  width: 38px;
  height: 38px;
  display: grid;
  border: 1px solid rgba(98, 211, 167, 0.18);
  border-radius: 10px;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
}

.account-session-icon .ui-icon {
  width: 17px;
}

.account-session-card h2 {
  margin: 0 0 2px;
  font-size: 13px;
}

.account-session-card p {
  margin: 0;
  color: var(--dim);
  font-size: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .account-menu {
    animation: none;
  }

  .profile > .ui-icon {
    transition: none;
  }
}

@media (max-width: 940px) {
  .account-layout {
    grid-template-columns: 1fr;
  }

  .account-summary {
    position: static;
  }
}

@media (max-width: 680px) {
  .account-menu {
    width: min(286px, calc(100vw - 28px));
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }

  .account-summary-visual {
    padding: 22px 16px 17px;
  }

  .account-avatar-large {
    width: 88px;
    height: 88px;
    font-size: 22px;
  }

  .account-form-footer,
  .account-session-card {
    align-items: stretch;
    flex-direction: column;
  }

  .account-form-footer {
    display: flex;
  }

  .account-form-footer .button,
  .account-session-card .button {
    width: 100%;
  }

  .account-session-card {
    display: flex;
  }
}

/* Light workspace palette: intentionally appended so legacy component literals
   cannot leave isolated dark surfaces behind. */
:root[data-theme="light"] .nav-item:hover:not(.active),
:root[data-theme="light"] .breadcrumb-link:hover {
  border-color: rgba(31, 34, 42, 0.06);
  background: var(--hover-fill);
}

:root[data-theme="light"] .nav-item.active {
  border-color: rgba(89, 99, 199, 0.18);
  background:
    linear-gradient(90deg, rgba(31, 34, 42, 0.025) 0%, rgba(31, 34, 42, 0.015) 55%, rgba(89, 99, 199, 0.055) 77%, rgba(118, 103, 211, 0.12) 100%),
    var(--panel);
  box-shadow:
    inset -6px 0 14px rgba(118, 103, 211, 0.045),
    0 5px 14px rgba(34, 38, 50, 0.07);
}

:root[data-theme="light"] .nav-item.active:hover {
  border-color: rgba(89, 99, 199, 0.25);
  background:
    linear-gradient(90deg, rgba(31, 34, 42, 0.035) 0%, rgba(31, 34, 42, 0.02) 55%, rgba(89, 99, 199, 0.07) 77%, rgba(118, 103, 211, 0.15) 100%),
    var(--panel);
}

:root[data-theme="light"] .dashboard-kpi {
  background:
    radial-gradient(circle at 96% -20%, rgba(89, 99, 199, 0.1), transparent 46%),
    linear-gradient(145deg, rgba(31, 34, 42, 0.018), transparent 58%),
    var(--panel);
}

:root[data-theme="light"] .dashboard-kpi:hover {
  box-shadow: 0 12px 28px rgba(34, 38, 50, 0.09);
}

:root[data-theme="light"] .skeleton-panel::after {
  background: linear-gradient(90deg, transparent, rgba(31, 34, 42, 0.045), transparent);
}

:root[data-theme="light"] .pricing-term-preview {
  background: #e9ebf0;
}

:root[data-theme="light"] .lead-calendar-day.is-outside {
  color: var(--dim);
}

@media (prefers-reduced-motion: reduce) {
  .appearance-switch,
  .appearance-switch-track,
  .appearance-switch-track > span {
    transition: none;
  }
}

@media (max-width: 680px) {
  .appearance-setting-row {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 12px;
  }

  .appearance-setting-icon {
    width: 38px;
    height: 38px;
  }

  .appearance-switch {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }
}

@media (forced-colors: active) {
  select:not([multiple]):not([size]) {
    -webkit-appearance: auto;
    appearance: auto;
    padding-right: 11px;
    background-image: none;
  }
}

/* Platform accounts and the shared loan workflow. */
.platform-users, .platform-loans { min-width: 0; }
.platform-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.platform-stat { display: grid; min-width: 0; gap: 3px; padding: 16px 18px; }
.platform-stat + .platform-stat { border-left: 1px solid var(--line-subtle); }
.platform-stat > span { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.platform-stat > strong { color: var(--text); font-size: 18px; line-height: 1.4; }
.platform-stat > small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.platform-page-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.platform-loading { padding: 36px 20px; color: var(--muted); text-align: center; font-size: 14px; }
.platform-users .filter-search, .platform-loans .filter-search { flex: 1; min-width: 150px; }
.platform-users-table { min-width: 600px; }
.platform-users-table th:first-child { width: 50%; }
.platform-users-table .primary-cell { cursor: default; }
.platform-users .table-wrap { overscroll-behavior-inline: contain; }
.platform-users .filter-bar { flex-wrap: wrap; }
.platform-users .filter-bar .filter-search,
.platform-users .filter-bar .button,
.platform-loans .filter-bar .filter-search,
.platform-loans .filter-bar .button { height: 36px; min-height: 36px; padding-block: 0; }
.platform-users .page-actions:empty { display: none; }
.platform-loans-table { min-width: 760px; }
.platform-loans-table tbody tr { cursor: pointer; }
.platform-loans-table tbody tr:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: -2px; }
.platform-loans .tabs { margin-top: 0; }
.platform-loans .tab-button { min-height: 40px; }
.platform-loans .filter-bar { flex-wrap: wrap; }
.platform-loans .page-head h1 { overflow-wrap: anywhere; }
.platform-request-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin-bottom: 20px; }
.platform-request-grid .panel { min-width: 0; }
.platform-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; margin: 0 0 22px; }
.platform-facts > div { min-width: 0; }
.platform-facts dt { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.platform-facts dd { margin: 0; color: var(--text); font-size: 15px; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; }
.platform-scenario-facts { padding-top: 20px; border-top: 1px solid var(--line-subtle); }
.platform-scenario-facts > .muted { margin: 0 0 18px; }
.platform-scenario-section + .platform-scenario-section { padding-top: 18px; border-top: 1px solid var(--line-subtle); }
.platform-scenario-section h4 { margin: 0 0 14px; color: var(--text); font-size: 13px; font-weight: 650; }
.platform-scenario-section .platform-facts { margin-bottom: 18px; }
.platform-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.platform-actions .button, .platform-work-row > .button { white-space: nowrap; }
.platform-needs { padding-left: 20px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.platform-activity { padding: 0; margin: 0; list-style: none; }
.platform-activity li { padding: 14px 0; border-bottom: 1px solid var(--line-subtle); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.platform-activity li:first-child { padding-top: 0; }
.platform-activity li:last-child { border: 0; padding-bottom: 0; }
.platform-activity strong { font-size: 14px; font-weight: 500; }
.platform-activity span { color: var(--muted); font-size: 12px; }
.platform-activity p { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.platform-work-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.platform-work-head h2 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.02em; }
.platform-work-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.platform-work-head > .button { flex-shrink: 0; }
.platform-work-list { display: grid; gap: 12px; }
.platform-work-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px; border: 1px solid var(--line-subtle); background: var(--panel-2); border-radius: 10px; }
.platform-work-copy { min-width: 0; }
.platform-work-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.platform-work-heading h3 { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.platform-work-copy > p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.platform-work-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.platform-work-meta span { overflow-wrap: anywhere; }
.platform-work-form small { color: var(--muted); line-height: 1.5; }
.platform-borrower-fields { display: grid; gap: 16px; margin: 0; padding: 16px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; }
.platform-borrower-fields legend { padding: 0 7px; font-size: 13px; font-weight: 600; color: var(--text); }
.platform-borrower-options:not([hidden]) { display: grid; gap: 16px; }
.platform-borrower-fields .platform-checkbox { padding: 0; }
.platform-work-form [hidden] { display: none !important; }
.platform-work-form .form-grid:has([data-team-assignment-field][hidden]) { grid-template-columns: minmax(0,1fr); }
.platform-work-form textarea { min-height: 76px; }
.platform-work-form input[type="date"] { height: 40px; min-height: 40px; }
.platform-work-notes { border-top: 1px solid var(--line); padding-top: 12px; }
.platform-work-notes summary { width: fit-content; cursor: pointer; color: var(--muted); font-size: 12px; }
.platform-work-notes summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 3px; }
.platform-work-notes[open] summary { margin-bottom: 12px; }
.platform-work-description h3 { margin: 0 0 8px; font-size: 17px; }
.platform-work-description p { margin: 0; color: var(--muted); font-size: 14px; white-space: pre-line; line-height: 1.6; }
.platform-checkbox { display: flex !important; align-items: center; gap: 10px; padding: 12px 0; min-height: 44px; }
.platform-checkbox input { width: 18px; height: 18px; margin: 0; }
.platform-comment-history { border-top: 1px solid var(--line); padding-top: 20px; }
.platform-comment-history h3 { margin: 0 0 16px; font-size: 14px; }
.platform-comment-history article { padding: 0 0 14px; }
.platform-comment-history strong { font-size: 13px; }
.platform-comment-history span { margin-left: 10px; color: var(--dim); font-size: 12px; }
.platform-comment-history p { font-size: 14px; line-height: 1.6; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; margin: 6px 0 0; }
.platform-pricing-context { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; margin-bottom: 20px; border: 1px solid var(--blue); background: var(--blue-soft); border-radius: 10px; }
.platform-pricing-context > div { min-width: 0; display: grid; gap: 6px; }
.platform-pricing-context strong { font-size: 14px; overflow-wrap: anywhere; }
.platform-pricing-context span { font-size: 13px; line-height: 1.6; color: var(--muted); }
.platform-pricing-context > button { flex-shrink: 0; }
.borrower-account-transition { max-width: 540px; padding-top: 64px; }
.borrower-account-transition .borrower-hero { padding: 32px; }
.borrower-account-transition h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.03em; }
.borrower-account-transition p { font-size: 15px; line-height: 1.7; }
.borrower-account-transition .borrower-account-help { color: var(--muted); margin: 20px 0 24px; font-size: 14px; }
.borrower-account-transition .button { min-height: 46px; }
@media (max-width: 1000px) {
  .platform-request-grid { grid-template-columns: 1fr; }
  .platform-work-row { align-items: flex-start; flex-wrap: wrap; }
  .platform-work-copy { flex: 1 1 250px; }
}
@media (max-width: 600px) {
  .platform-stat { padding: 12px; }
  .platform-work-head, .platform-pricing-context { flex-direction: column; gap: 14px; }
  .platform-work-row { padding: 16px; }
  .platform-work-heading { align-items: flex-start; }
  .platform-work-row > .button, .platform-work-row > .platform-actions { width: 100%; }
  .platform-work-row > .platform-actions .button { flex: 1; }
  .platform-users .button, .platform-loans .button, .platform-loan-work .button, .platform-pricing-context .button { min-height: 44px; }
  .platform-page-controls { align-items: flex-start; }
}

/* A desktop width basis must not become a 420px height in the stacked header. */
@media (max-width: 940px) {
  .loan-workspace-hero { min-height: 0; justify-content: flex-start; }
  .loan-workspace-title { flex: 0 1 auto; width: 100%; min-width: 0; }
  .loan-title-line { flex-wrap: wrap; align-items: flex-start; }
  .loan-title-line h1 { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
  .loan-workspace-title .record-workspace-meta { overflow-wrap: anywhere; }
}
@media (max-width: 680px) {
  .loan-workspace-hero { gap: 18px; }
  .loan-workspace-hero .page-actions { flex: 0 1 auto; gap: 8px; }
  .loan-workspace-hero .button { min-height: 44px; }
}

/* Loan detail: matched to Xoan AI's financing-active components. */
.loan-detail-workspace { --active-gutter: clamp(18px,1.5vw,24px); --loan-progress-green: #6ed9ae; --loan-progress-purple: #b4b9ff; min-width: 0; gap: 16px; font-size: 14px; line-height: 1.45; }
.loan-summary-card { position: relative; margin: 0; min-width: 0; overflow: hidden; border: 1px solid var(--line-subtle); border-radius: var(--radius-lg); background: radial-gradient(650px 220px at 0 0, rgba(97,105,202,.14), transparent 62%), radial-gradient(520px 220px at 100% 0, rgba(73,176,138,.08), transparent 68%), var(--panel); }
.loan-summary-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 1px rgba(255,255,255,.025); }
.loan-summary-overview { min-width: 0; padding: 16px var(--active-gutter); display: grid; grid-template-columns: minmax(285px,1fr) auto; align-items: center; column-gap: 24px; }
.loan-summary-identity { min-width: 0; padding: 0; display: flex; flex-direction: column; justify-content: center; }
.loan-summary-eyebrow { color: #aeb3f3; font-size: 8px; font-weight: 680; letter-spacing: .11em; text-transform: uppercase; }
.loan-summary-identity h1 { margin: 6px 0 0; overflow-wrap: anywhere; color: #f5f5f7; font-size: clamp(21px,2vw,27px); font-weight: 650; line-height: 1.08; letter-spacing: -.04em; }
.loan-summary-identity p { margin: 5px 0 0; overflow: hidden; color: #858894; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.loan-summary-status { width: max-content; min-width: 0; justify-self: end; display: grid; grid-template-columns: max-content max-content; overflow: hidden; border: 1px solid var(--line-subtle); border-radius: 10px; background: rgba(255,255,255,.018); }
.loan-summary-status > div { min-width: 0; padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px; }
.loan-summary-status > div + div { border-left: 1px solid var(--line-subtle); }
.loan-summary-status > div > span { color: var(--dim); font-size: 8px; font-weight: 570; letter-spacing: .035em; }
.loan-work-progress { min-width: 0; min-height: 23px; display: inline-flex; align-items: center; gap: 10px; color: #858894; font-size: 10px; white-space: nowrap; }
.loan-work-progress > strong { color: var(--loan-progress-green); font-weight: 620; font-variant-numeric: tabular-nums; }
.loan-work-progress > strong + span { padding-left: 10px; border-left: 1px solid #3a3c45; }
.loan-summary-status .badge, .loan-detail-workspace .platform-work-state .badge { width: max-content; min-height: 23px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 9px; font-weight: 650; line-height: 1.45; }
.loan-summary-status .badge::before, .loan-detail-workspace .platform-work-state .badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.loan-summary-status .badge.blue, .loan-summary-status .badge.amber, .loan-detail-workspace .platform-work-state .badge.blue { color: var(--loan-progress-purple); border-color: rgba(112,120,229,.28); background: rgba(112,120,229,.09); }
.loan-summary-status .badge.green, .loan-detail-workspace .platform-work-state .badge.green { color: var(--loan-progress-green); border-color: rgba(76,194,148,.3); background: rgba(76,194,148,.09); }
.loan-summary-status .loan-stage-field { position: relative; display: inline-flex; align-items: center; width: max-content; margin: 0; color: var(--loan-progress-purple); }
.loan-summary-status .loan-stage-field::before { content: ''; position: absolute; z-index: 1; left: 9px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; pointer-events: none; }
.loan-summary-status .loan-stage-field select { appearance: none; width: auto; max-width: 180px; height: 23px; min-height: 23px; margin: 0; padding: 0 22px 0 22px; color: inherit; border: 1px solid rgba(112,120,229,.28); border-radius: 7px; background: rgba(112,120,229,.09); line-height: 1.45; font-family: inherit; font-size: 9px; font-weight: 650; cursor: pointer; }
.loan-summary-status .loan-stage-field select:hover { background: var(--blue-soft); }
.loan-summary-status .loan-stage-field > .ui-icon { position: absolute; right: 7px; top: 7px; width: 9px; height: 9px; pointer-events: none; }
.loan-summary-status .loan-stage-field.green { color: var(--loan-progress-green); }
.loan-summary-status .loan-stage-field.green select { border-color: rgba(76,194,148,.3); background: rgba(76,194,148,.09); }
.loan-summary-status .loan-stage-field small { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loan-summary-facts { min-width: 0; margin: 0; padding: 0 var(--active-gutter); display: grid; grid-template-columns: minmax(68px,.78fr) minmax(150px,1.28fr) minmax(90px,1fr) minmax(64px,.68fr) minmax(150px,1.18fr); border-top: 1px solid var(--line-subtle); }
.loan-summary-facts.is-operational { grid-template-columns: .78fr 1.28fr 1fr 1.18fr; }
.loan-summary-facts > div { min-width: 0; min-height: 68px; padding: 12px 18px 13px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line-subtle); }
.loan-summary-facts > div:first-child { padding-left: 0; border-left: 0; }
.loan-summary-facts > div:last-child { padding-right: 0; }
.loan-summary-facts dt { overflow: hidden; color: var(--dim); text-overflow: ellipsis; white-space: nowrap; font-size: 8px; font-weight: 570; letter-spacing: .035em; }
.loan-summary-facts dd { min-width: 0; margin: 6px 0 0; overflow: hidden; color: #ececf0; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 620; font-variant-numeric: tabular-nums; }
.loan-summary-facts > div:nth-child(2) dd { display: -webkit-box; white-space: normal; line-height: 1.15; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.loan-summary-facts:not(.is-operational) > div:is(:nth-child(3),:nth-child(4)) dd { font-size: 14px; }
.loan-summary-contact { display: flex; align-items: center; gap: 8px; }
.loan-summary-contact .assignee-avatar { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border: 1px solid rgba(137,145,242,.34); border-radius: 24%; color: #e0e2ff; background: linear-gradient(145deg, rgba(110,119,221,.42), rgba(68,76,161,.26)); font-size: 8px; font-weight: 680; letter-spacing: .03em; }
.loan-summary-contact > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loan-progress-panel { position: relative; margin: 0; padding: 13px var(--active-gutter) 15px; overflow: hidden; border-top: 1px solid var(--line-subtle); background: rgba(255,255,255,.006); }
.loan-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.loan-progress-heading h2 { margin: 0; color: var(--dim); font-size: 8px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; line-height: 1.45; }
.loan-progress-position { padding: 4px 7px; border: 1px solid var(--line-subtle); border-radius: 6px; color: #9296b8; background: rgba(255,255,255,.018); font-size: 8px; font-weight: 650; letter-spacing: .01em; }
.loan-progress-scroll { overflow-x: auto; overflow-y: hidden; padding: 2px 0 0; scrollbar-width: none; }
.loan-progress-scroll::-webkit-scrollbar { display: none; }
.loan-progress-track { position: relative; min-width: 650px; min-height: 41px; margin: 0; padding: 0; list-style: none; }
.loan-progress-track > li { position: absolute; top: 0; left: var(--stage-left,11px); width: 0; min-width: 0; display: grid; grid-template-rows: 22px auto; justify-items: start; gap: 7px; color: #696b75; font-size: 8px; font-weight: 570; }
.loan-progress-track > li:not(:last-child)::before { content: ''; position: absolute; z-index: 0; top: 10px; left: 0; width: var(--stage-segment,0); height: 1px; border-radius: 999px; background: #353740; pointer-events: none; }
.loan-progress-track > li.is-past::before { background: var(--loan-progress-green); }
.loan-progress-track > li.is-past:has(+ .is-current)::before { background: linear-gradient(90deg, var(--loan-progress-green), var(--loan-progress-purple)); }
.loan-progress-label { position: relative; z-index: 1; width: max-content; justify-self: start; white-space: nowrap; text-align: center; transform: translateX(-50%); }
.loan-progress-node { position: relative; z-index: 1; width: 22px; height: 22px; margin-top: -1px; display: grid; place-items: center; justify-self: start; border: 1px solid #3a3c46; border-radius: 50%; background: var(--panel); color: transparent; font-size: 7px; transform: translateX(-50%); }
.loan-progress-node .ui-icon { width: 10px; height: 10px; }
.loan-progress-track > li.is-past { color: var(--loan-progress-green); }
.loan-progress-track > li.is-past .loan-progress-node { color: var(--loan-progress-green); border-color: rgba(76,194,148,.3); background: linear-gradient(rgba(76,194,148,.09), rgba(76,194,148,.09)), var(--panel); }
.loan-progress-track > li.is-current { color: var(--loan-progress-purple); font-weight: 640; }
.loan-progress-track > li.is-current .loan-progress-node { color: #fff; border-color: var(--loan-progress-purple); background: linear-gradient(rgba(112,120,229,.72), rgba(112,120,229,.72)), var(--panel); box-shadow: 0 0 0 4px rgba(112,120,229,.1); }
.loan-progress-track > li.is-upcoming .loan-progress-node { border-color: transparent; background: transparent; }
.loan-progress-track > li.is-upcoming .loan-progress-node::after { content: ''; width: 8px; height: 8px; border: 1px solid #464852; border-radius: 50%; background: #24262e; }
.loan-detail-workspace .loan-workspace-main { min-height: 0; overflow: visible; }
.loan-workspace-tabbar { display: flex; min-height: 50px; align-items: stretch; justify-content: space-between; gap: 15px; padding-right: 18px; border-bottom: 1px solid var(--line-subtle); }
.loan-detail-workspace .loan-workspace-tabs { min-width: 0; min-height: 49px; padding: 0 18px; display: flex; align-items: stretch; gap: 25px; overflow-x: auto; overflow-y: hidden; border: 0; scrollbar-width: none; }
.loan-detail-workspace .loan-workspace-tabs .tab-button { position: relative; min-width: max-content; min-height: 0; padding: 0; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 0; color: #858791; background: transparent; font-size: 10px; font-weight: 610; line-height: 1.45; }
.loan-detail-workspace .loan-workspace-tabs .tab-button::after { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; border-radius: 999px 999px 0 0; background: transparent; }
.loan-detail-workspace .loan-workspace-tabs .tab-button:hover { color: #cfd0d6; }
.loan-detail-workspace .loan-workspace-tabs .tab-button.active { color: #e8e8ed; box-shadow: none; }
.loan-detail-workspace .loan-workspace-tabs .tab-button.active::after { background: linear-gradient(90deg,#6974df,#9699ef); }
.loan-tab-count { min-width: 19px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; border: 1px solid #393b47; border-radius: 999px; color: #a8aab6; background: rgba(255,255,255,.025); font-size: 8px; font-weight: 650; }
.loan-detail-workspace .tab-button.active .loan-tab-count { color: #cfd2ff; border-color: rgba(112,121,224,.35); background: rgba(101,111,210,.1); }
.loan-actions-menu { position: relative; flex: 0 0 auto; align-self: center; }
.loan-actions-menu summary { list-style: none; height: 28px; min-height: 28px; padding: 0 8px; border: 1px solid var(--line-subtle); border-radius: 7px; background: rgba(255,255,255,.018); color: var(--muted); font-size: 9px; font-weight: 600; cursor: pointer; }
.loan-actions-menu summary::-webkit-details-marker { display: none; }
.loan-actions-menu summary .ui-icon { width: 10px; height: 10px; }
.loan-actions-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 25; display: grid; min-width: 215px; gap: 3px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); box-shadow: var(--shadow); }
.loan-actions-popover .button { justify-content: flex-start; padding: 10px; border-color: transparent; background: transparent; color: var(--text); box-shadow: none; font-size: 11px; }
.loan-actions-popover .button:hover { background: var(--panel-hover); }
.loan-detail-workspace .loan-workspace-content { min-height: 0; padding: 0; outline: 0; }
.loan-detail-workspace .loan-workspace-content[data-section="activity"] { padding: 18px; }
.loan-detail-workspace .loan-overview-grid { display: block; }
.loan-detail-workspace .loan-overview-grid > .panel { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.loan-detail-workspace .loan-overview-grid .panel-head { min-height: 50px; padding: 10px 18px; border-top: 1px solid var(--line-subtle); border-bottom: 1px solid var(--line-subtle); }
.loan-detail-workspace .loan-overview-grid > .panel:first-child .panel-head { border-top: 0; }
.loan-detail-workspace .loan-overview-grid > .panel:first-child .panel-head h3 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loan-detail-workspace .loan-overview-grid .panel-head h3 { font-size: 10px; font-weight: 610; }
.loan-detail-workspace .loan-overview-grid .panel-head p { margin-top: 3px; color: var(--dim); font-size: 9px; }
.loan-detail-workspace .loan-overview-grid .panel-head > .ui-icon { display: none; }
.loan-detail-workspace .loan-overview-grid .panel-body { padding: 0; }
.loan-detail-workspace .loan-fact-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.loan-detail-workspace .loan-fact-list > div { min-width: 0; min-height: 78px; padding: 15px 18px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; border-right: 1px solid var(--line-subtle); border-bottom: 1px solid var(--line-subtle); }
.loan-detail-workspace .loan-fact-list > div:nth-child(4n) { border-right: 0; }
.loan-detail-workspace .loan-fact-list dt { color: var(--dim); font-size: 9px; }
.loan-detail-workspace .loan-fact-list dd { max-width: 100%; margin: 7px 0 0; overflow-wrap: anywhere; color: var(--text); text-align: left; font-size: 16px; font-weight: 630; line-height: 1.35; }
.loan-detail-workspace .loan-fact-list .assignee-detail { justify-content: flex-start; gap: 7px; }
.loan-detail-workspace .loan-fact-list .assignee-avatar { width: 24px; height: 24px; flex: 0 0 24px; font-size: 8px; }
.loan-detail-workspace .loan-connected-work-card .borrower-action-stack { gap: 0; }
.loan-detail-workspace .loan-connected-work-card .action-row { min-height: 58px; padding: 10px 14px; gap: 10px; border-radius: 0; border-bottom: 1px solid var(--line-subtle); }
.loan-detail-workspace .loan-connected-work-card .action-icon { width: 28px; height: 28px; border-radius: 8px; }
.loan-detail-workspace .loan-connected-work-card .action-copy strong { font-size: 10px; }
.loan-detail-workspace .loan-connected-work-card .action-copy > span { font-size: 8px; }
.loan-detail-workspace .loan-connected-work-card .ui-icon { width: 13px; height: 13px; }
.loan-people-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.loan-detail-workspace .loan-people-grid { padding: 0 18px 18px; }
.loan-detail-workspace .platform-work-head { min-height: 50px; padding: 10px 18px; margin: 0; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line-subtle); }
.loan-detail-workspace .platform-work-head h2 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loan-detail-workspace .platform-work-head p { margin: 0; color: var(--dim); font-size: 9px; line-height: 1.45; }
.loan-detail-workspace .platform-work-head .platform-actions { flex: 0 0 auto; gap: 6px; }
.loan-detail-workspace .platform-work-head .button { min-height: 28px; height: 28px; padding: 0 8px; border-radius: 7px; font-size: 9px; }
.loan-detail-workspace .platform-work-head .button .ui-icon { width: 11px; height: 11px; }
.loan-work-filter.segmented { flex: 0 0 auto; width: auto; height: 28px; padding: 2px; border-radius: 7px; }
.loan-work-filter.segmented button { flex: 0 0 auto; min-height: 22px; height: 22px; padding: 0 9px; border: 0; background: transparent; font-size: 10px; white-space: nowrap; }
.loan-work-filter.segmented button.active { background: var(--panel-hover); color: var(--text); }
.loan-work-filter button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.loan-work-filter button:disabled { opacity: .5; cursor: wait; }
.loan-work-add-menu { position: relative; flex: 0 0 auto; }
.loan-work-add-menu > summary { display: inline-flex; align-items: center; gap: 5px; list-style: none; cursor: pointer; }
.loan-work-add-menu > summary::-webkit-details-marker { display: none; }
.loan-work-add-options { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; display: grid; min-width: 160px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); box-shadow: 0 10px 30px #0004; }
.loan-work-add-options button { min-height: 32px; padding: 7px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.loan-work-add-options button:hover, .loan-work-add-options button:focus-visible { background: var(--panel-hover); }

.loan-detail-workspace .platform-work-list { display: grid; gap: 0; }
.loan-detail-workspace .platform-work-row { min-height: 58px; margin: 0; padding: 10px 14px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line-subtle); border-radius: 0; background: transparent; }
.loan-detail-workspace .platform-work-trigger { min-width: 0; margin: -5px 0; padding: 5px 7px 5px 0; display: grid; grid-template-columns: minmax(0,1fr); align-items: center; gap: 10px; border: 0; border-radius: 8px; color: inherit; background: transparent; text-align: left; font: inherit; cursor: pointer; }
.loan-detail-workspace .platform-work-trigger:focus-visible { outline: 1px solid rgba(142,149,242,.78); outline-offset: 2px; }
.loan-detail-workspace .platform-work-trigger:not(.platform-document-trigger) { grid-template-columns: minmax(0,1fr) minmax(110px,155px); }
.loan-detail-workspace .platform-work-row:not(.platform-document-row) { grid-template-columns: 30px minmax(0,1fr) 105px; }
.loan-detail-workspace .platform-work-row:not(.platform-document-row) > .platform-work-state { justify-self: end; }
.platform-work-assignee { min-width: 0; display: flex; align-items: center; gap: 8px; color: #c8cad3; font-size: 10px; font-weight: 550; }
.platform-work-assignee-copy { min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.platform-work-assignee-copy small { color: var(--muted); font-size: 9px; font-weight: 400; }
@media (max-width:700px) {
  .loan-detail-workspace .platform-work-row:not(.platform-document-row) { grid-template-columns: 30px minmax(0,1fr) auto; }
  .loan-detail-workspace .platform-work-trigger:not(.platform-document-trigger) { grid-template-columns: minmax(0,1fr); gap: 7px; }
  .loan-detail-workspace .platform-work-trigger:not(.platform-document-trigger) > .platform-work-copy { grid-column: 1; grid-row: 1; }
  .platform-work-assignee { grid-column: 1; grid-row: 2; font-size: 10px; }
}
.loan-detail-workspace .platform-work-subtitle { display: block; margin-top: 4px; color: var(--dim); font-size: 8px; line-height: 1.45; }
.loan-detail-workspace .platform-work-row:last-child { border-bottom: 0; }
.loan-detail-workspace .platform-work-row:hover { background: rgba(255,255,255,.012); }
.loan-detail-workspace .platform-work-check { position: relative; width: 38px; height: 38px; margin: -4px; display: grid; place-items: center; }
.loan-detail-workspace .platform-work-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.loan-detail-workspace .platform-work-check input:disabled { cursor: default; }
.loan-detail-workspace .platform-work-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #3a3c46; border-radius: 50%; color: #898d9d; background: var(--panel-2); transition: border-color .15s ease, background .15s ease; }
.loan-detail-workspace .platform-work-check input:enabled:hover + .platform-work-icon { border-color: #898d9d; background: rgba(137,141,157,.09); }
.loan-detail-workspace .platform-work-check input:focus-visible + .platform-work-icon { outline: 2px solid #8e95f2; outline-offset: 3px; }
.loan-detail-workspace .platform-work-check input[aria-busy="true"] + .platform-work-icon { border-color: #898d9d; border-top-color: transparent; animation: work-completion-spin .8s linear infinite; }
@keyframes work-completion-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .loan-detail-workspace .platform-work-check input[aria-busy="true"] + .platform-work-icon { animation: none; border-style: dashed; } }
.loan-detail-workspace [data-work-error]:empty { display: none; }
.loan-detail-workspace [data-work-error]:not(:empty) { margin: 0; padding: 12px 18px; }
.loan-detail-workspace .platform-work-icon.is-complete { color: var(--loan-progress-green); border-color: rgba(76,194,148,.3); background: rgba(76,194,148,.09); }
.loan-detail-workspace .platform-work-icon .ui-icon { width: 13px; height: 13px; }
.loan-detail-workspace .platform-work-copy { min-width: 0; }
.loan-detail-workspace .platform-work-copy > p { display: none; }
.loan-detail-workspace .platform-work-heading { margin: 0; display: block; overflow: hidden; color: #e1e2e6; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; line-height: 1.45; }
.loan-detail-workspace .platform-work-heading h3 { margin: 0; overflow: hidden; color: #e1e2e6; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; line-height: 1.45; }
.loan-detail-workspace .platform-work-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 3px 10px; color: var(--dim); font-size: 8px; line-height: 1.45; }
.loan-detail-workspace .platform-work-actions { display: flex; width: auto; align-items: center; gap: 10px; }
.loan-detail-workspace .platform-work-open { width: auto; min-height: 28px; height: 28px; padding: 0 8px; color: #a0a2ad; border: 1px solid #343741; border-radius: 7px; background: rgba(255,255,255,.015); font-size: 8px; }
.loan-detail-workspace .platform-work-open .ui-icon { width: 10px; height: 10px; color: #858894; }
.loan-detail-workspace .platform-document-list { margin: 0; padding: 0; list-style: none; }
.loan-detail-workspace .platform-document-row { grid-template-columns: minmax(0,1fr) auto; gap: 0; padding: 0; }
.loan-detail-workspace .platform-document-trigger { min-height: 58px; width: 100%; margin: 0; padding: 10px 14px; grid-template-columns: 30px minmax(0,1fr) auto; border-radius: 0; }
.loan-detail-workspace .platform-document-trigger[aria-disabled="true"] { grid-template-columns: 30px minmax(0,1fr) auto; cursor: default; }
.loan-detail-workspace .platform-document-trigger:focus-visible { outline-offset: -3px; }
.loan-detail-workspace .platform-document-icon { border-radius: 8px; }
.loan-detail-workspace .platform-document-icon .ui-icon { width: 18px; height: 18px; }
.loan-detail-workspace .platform-document-row .platform-work-meta { gap: 2px 0; }
.loan-detail-workspace .platform-document-row .platform-work-meta > span { overflow-wrap: anywhere; }
.loan-detail-workspace .platform-document-row .platform-work-meta > span + span::before { content: '·'; padding: 0 6px; color: #555967; }
.loan-detail-workspace .platform-document-download { width: 28px; min-height: 28px; height: 28px; margin-right: 14px; padding: 0; border-radius: 7px; }
.loan-detail-workspace .platform-document-download .ui-icon { width: 13px; height: 13px; }
.loan-detail-workspace .platform-document-feedback { display: block; overflow-wrap: anywhere; margin-top: 6px; color: var(--muted); font-size: 9px; }
.loan-detail-workspace .platform-loan-work > .form-hint { margin: 0; padding: 9px 18px; color: var(--dim); font-size: 9px; border-bottom: 1px solid var(--line-subtle); }
.loan-detail-workspace [data-documents-error]:empty { display: none; }
.loan-detail-workspace [data-documents-more] { min-height: 28px; height: 28px; margin: 12px 18px; padding: 0 8px; border-radius: 7px; font-size: 9px; }
.detail-drawer[data-variant="loan-work"] { inset: 0 0 0 auto; width: min(500px,calc(100vw - 32px)); height: 100dvh; display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: #1d1f26; }
.detail-drawer[data-variant="loan-work"].open { box-shadow: -18px 0 60px rgba(0,0,0,.38); }
.detail-drawer[data-variant="loan-work"] .drawer-head { min-height: 74px; padding: 18px 24px; gap: 16px; border-bottom: 1px solid var(--line); background: radial-gradient(390px 150px at 12% 0,rgba(107,116,219,.11),transparent 72%),#202229; }
.detail-drawer[data-variant="loan-work"] .drawer-head > div { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.detail-drawer[data-variant="loan-work"] #drawerTitle { margin: 0; color: #f4f4f6; letter-spacing: -.03em; font-size: 22px; line-height: 1.2; font-weight: 650; overflow-wrap: anywhere; }
.detail-drawer[data-variant="loan-work"] #drawerEyebrow { display: none; }
.detail-drawer[data-variant="loan-work"] #drawerClose { width: 36px; height: 36px; min-height: 36px; flex: 0 0 36px; border: 1px solid rgba(255,255,255,.045); border-radius: 9px; }
.detail-drawer[data-variant="loan-work"] .drawer-body { min-height: 0; height: auto; padding: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #3a3d47 transparent; }
.loan-work-drawer-content { min-height: 100%; display: flex; flex-direction: column; }
.loan-work-section { padding: 20px 24px; border-bottom: 1px solid var(--line-subtle); }
.loan-work-section h3 { margin: 0; color: #e8e8ec; font-size: 13px; font-weight: 630; }
.loan-work-section > p { margin: 10px 0 0; color: #aaacb6; white-space: pre-line; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; }
.loan-work-section > small { display: block; margin-top: 9px; color: var(--dim); font-size: 9px; line-height: 1.45; }
.loan-work-section > .button { min-height: 32px; margin-top: 12px; padding: 0 10px; border-radius: 8px; font-size: 10px; }
.loan-work-section .form-hint { font-size: 10px; line-height: 1.45; }
.loan-work-section [data-work-upload-form] { display: grid; gap: 10px; margin: 14px 0; }
.loan-work-section [data-work-upload-form] label { display: grid; gap: 8px; font-size: 12px; }
.loan-work-section [data-work-upload-form] input { width: 100%; min-width: 0; }
.loan-work-section [data-work-upload-form] .button { justify-self: start; }
.loan-work-section [data-work-upload-form] p { margin: 0; }
.loan-work-section [data-work-upload-form] p:empty { display: none; }
.loan-work-drawer-status { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.loan-work-drawer-status .badge { min-height: 23px; padding: 0 8px; gap: 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 9px; font-weight: 650; }
.loan-work-drawer-status .badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.loan-work-drawer-status .badge.blue { color: #b4b9ff; border-color: rgba(112,120,229,.28); background: rgba(112,120,229,.09); }
.loan-work-drawer-status .badge.green { color: #6ed9ae; border-color: rgba(76,194,148,.3); background: rgba(76,194,148,.09); }
.loan-work-drawer-status .badge.red { color: #f1aeb7; border-color: rgba(218,111,128,.28); background: rgba(218,111,128,.09); }
.loan-work-drawer-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 24px; border-bottom: 1px solid var(--line-subtle); color: var(--dim); font-size: 10px; }
.loan-work-provenance { margin: 0; padding: 12px 24px; border-bottom: 1px solid var(--line-subtle); color: var(--dim); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.loan-work-files { display: grid; gap: 8px; margin-top: 12px; }
.loan-work-file { min-width: 0; min-height: 48px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #30333c; border-radius: 10px; background: rgba(255,255,255,.018); }
.loan-work-file > div { min-width: 0; flex: 1; }
.loan-work-file > span { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; color: #b9bdf8; border-radius: 8px; background: rgba(111,120,219,.12); }
.loan-work-file > span .ui-icon { width: 15px; height: 15px; }
.loan-work-file strong { display: block; color: #e3e4e9; overflow-wrap: anywhere; font-size: 10px; font-weight: 610; }
.loan-work-file small { display: block; margin-top: 3px; color: #858894; font-size: 9px; }
.loan-work-file .button { min-height: 28px; padding: 0 8px; border-radius: 7px; font-size: 9px; }
.loan-work-message-list { display: grid; gap: 14px; margin-top: 18px; }
.loan-work-message { max-width: 100%; padding: 14px; border: 1px solid #30333c; border-radius: 15px 15px 15px 5px; background: #23252c; }
.loan-work-message p { margin: 0; color: #dfe0e6; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.48; }
.loan-work-message footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; color: #858894; font-size: 9px; }
.loan-work-empty { color: var(--dim); font-size: 11px; line-height: 1.5; }
.loan-work-drawer-footer { margin-top: auto; padding: 16px 24px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.loan-work-drawer-footer .button { min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 11px; }
.loan-detail-workspace :is(.loan-progress-scroll,[role="tabpanel"],.tab-button):focus-visible { outline: 1px solid #8e95f2; outline-offset: -2px; }
@media (max-width:1040px) {
  .loan-summary-overview { grid-template-columns: 1fr; row-gap: 14px; column-gap: 0; }
  .loan-summary-status { width: 100%; max-width: 560px; min-height: 72px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .loan-summary-facts { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .loan-detail-workspace .loan-fact-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .loan-detail-workspace .loan-fact-list > div:nth-child(2n) { border-right: 0; }
}
@media (max-width:700px) {
  .loan-detail-workspace { --active-gutter: 14px; }
  .loan-summary-status > div { padding: 12px 14px; }
  .loan-summary-facts, .loan-summary-facts.is-operational { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 18px; }
  .loan-summary-facts > div { min-height: 64px; padding-right: 0; padding-left: 0; border-top: 1px solid var(--line-subtle); border-left: 0; }
  .loan-summary-facts > div:nth-child(-n+2) { border-top: 0; }
  .loan-summary-facts > div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line-subtle); }
  .loan-summary-facts:not(.is-operational) > div:last-child { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
  .loan-progress-track { min-width: 700px; }
  .loan-workspace-tabbar { padding-right: 14px; gap: 0; }
  .loan-detail-workspace .loan-workspace-tabs { padding: 0 14px; gap: 20px; }
  .loan-detail-workspace .loan-overview-grid, .loan-people-grid { grid-template-columns: minmax(0,1fr); }
  .loan-detail-workspace .loan-fact-list { grid-template-columns: minmax(0,1fr); }
  .loan-detail-workspace .loan-fact-list > div { border-right: 0; }
  .loan-detail-workspace .platform-work-head { flex-wrap: wrap; gap: 8px; }
  .loan-detail-workspace .platform-work-head .platform-actions { margin-left: auto; }
  .loan-detail-workspace .platform-work-row { grid-template-columns: 30px minmax(0,1fr) auto; }
  .loan-detail-workspace .platform-work-row.platform-document-row { grid-template-columns: minmax(0,1fr) auto; }
  .loan-detail-workspace .platform-document-trigger { grid-template-columns: 30px minmax(0,1fr) auto; gap: 8px; padding-right: 10px; }
  .loan-detail-workspace .platform-document-row .platform-work-heading { white-space: normal; overflow-wrap: anywhere; }
  .loan-detail-workspace .platform-document-row .platform-work-state { align-self: start; }
}
@media (max-width:540px) {
  .loan-summary-status { grid-template-columns: 1fr; }
  .loan-summary-status > div + div { border-top: 1px solid var(--line-subtle); border-left: 0; }
  .loan-work-progress { flex-wrap: wrap; white-space: normal; }
  .detail-drawer[data-variant="loan-work"] { width: 100%; }
  .detail-drawer[data-variant="loan-work"] .drawer-head, .loan-work-section { padding-left: 18px; padding-right: 18px; }
}
:root[data-theme="light"] .loan-detail-workspace { --loan-progress-green: #126a4d; --loan-progress-purple: #4f58b6; }
:root[data-theme="light"] .loan-detail-workspace :is(.loan-summary-eyebrow,.loan-progress-position,.loan-workspace-tabs .tab-button.active) { color: var(--accent-text); }
:root[data-theme="light"] .loan-detail-workspace :is(.loan-summary-identity h1,.loan-summary-facts dd,.platform-work-heading h3) { color: var(--text); }
:root[data-theme="light"] .loan-detail-workspace :is(.loan-summary-identity p,.loan-work-progress,.loan-workspace-tabs .tab-button,.loan-tab-count,.loan-progress-label) { color: var(--muted); }
:root[data-theme="light"] .detail-drawer[data-variant="loan-work"], :root[data-theme="light"] .detail-drawer[data-variant="loan-work"] .drawer-head { background: var(--panel); }
:root[data-theme="light"] .detail-drawer[data-variant="loan-work"] :is(#drawerTitle,.loan-work-section h3,.loan-work-file strong,.loan-work-message p) { color: var(--text); }
:root[data-theme="light"] .detail-drawer[data-variant="loan-work"] :is(.loan-work-section > p,.loan-work-file small,.loan-work-message footer) { color: var(--muted); }
:root[data-theme="light"] .detail-drawer[data-variant="loan-work"] :is(.loan-work-file,.loan-work-message) { background: var(--panel-2); border-color: var(--line); }
:root[data-theme="light"] .loan-work-drawer-status .badge.blue { color: var(--accent-text); }
:root[data-theme="light"] .loan-work-drawer-status .badge.green { color: #126a4d; }
:root[data-theme="light"] .loan-work-drawer-status .badge.red { color: #a7344c; }
@media (prefers-reduced-motion:reduce) {
  .detail-drawer[data-variant="loan-work"] { transition: none; }
}

/* Private document preview: independent right drawer, with bounded PDF canvases. */
.detail-drawer[data-variant="document-preview"] {
  width: min(1000px, calc(100vw - 48px));
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #202126;
  color: #f2f2f5;
  border-left: 1px solid #363740;
  box-shadow: -20px 0 70px #0007;
}
.detail-drawer[data-variant="document-preview"] .drawer-head {
  flex: 0 0 auto;
  min-height: 64px;
  padding: 12px 20px;
  border-bottom: 1px solid #363740;
  background: #25262c;
}
.detail-drawer[data-variant="document-preview"] .drawer-head > div { min-width: 0; }
.detail-drawer[data-variant="document-preview"] #drawerEyebrow { display: none; }
.detail-drawer[data-variant="document-preview"] #drawerTitle {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: #f2f2f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-drawer[data-variant="document-preview"] #drawerClose {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: #e2e2e8;
}
.detail-drawer[data-variant="document-preview"] .drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: hidden;
}
.document-preview { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; container-type: inline-size; }
.document-preview-review { flex: 0 0 auto; max-height: 45%; overflow: auto; padding: 12px 16px; border-top: 1px solid #3a3b46; background: #24252e; color: #eeeeF3; font-size: 12px; }
.document-preview-review-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.document-preview-review-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.document-preview-review-meta strong { font-size: 13px; font-weight: 600; }
.document-preview-review-meta small { color: #a8a9b6; font-size: 11px; }
.document-preview-review-meta :empty, .document-preview-review-message:empty { display: none; }
.document-preview-review-actions, .document-preview-correction > div { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.document-preview-review .button { min-height: 34px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.document-preview-review .button:focus-visible, .document-preview-review textarea:focus-visible { outline: 2px solid #aaa0ff; outline-offset: 3px; }
.document-preview-review .button:disabled { opacity: .45; cursor: default; }
.document-preview-feedback { margin: 9px 0 0; color: #d1d1db; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-preview-correction { display: grid; gap: 9px; margin-top: 12px; }
.document-preview-correction[hidden], .document-preview-feedback[hidden], .document-preview-review [hidden] { display: none; }
.document-preview-correction label { display: grid; gap: 6px; font-size: 12px; }
.document-preview-correction textarea { width: 100%; min-height: 64px; max-height: 130px; resize: vertical; border: 1px solid #515260; border-radius: 7px; background: #1b1c24; color: #f2f2f7; font: inherit; padding: 8px 10px; }
.document-preview-review-message { margin: 9px 0 0; color: #c5c5d1; font-size: 12px; }
.document-preview-review-message[role="alert"] { color: #ffadae; }
.document-preview-review [data-preview-review-reload] { margin-top: 8px; }
@container (max-width: 500px) {
  .document-preview-review { padding: 10px 12px; }
  .document-preview-review-row { align-items: flex-start; }
  .document-preview-review-actions { width: 100%; justify-content: flex-start; }
  .document-preview-review .button { min-height: 40px; }
}
.document-preview [hidden] { display: none !important; }
.document-preview-body { display: grid; grid-template-columns: 112px minmax(0,1fr); flex: 1; min-height: 0; min-width: 0; overflow: hidden; }
.document-preview-file { flex: 1 1 150px; min-width: 0; }
.document-preview-thumbnails { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 14px 8px; border-right: 1px solid #ffffff0b; background: #202126; scrollbar-width: thin; scrollbar-color: #42434d transparent; }
.document-preview-thumbnail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; width: 100%; margin: 0 0 10px; padding: 8px 5px 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #92939f; font: inherit; font-size: 11px; cursor: pointer; }
.document-preview-thumbnail:hover { background: #ffffff06; color: #eeeeF5; }
.document-preview-thumbnail.is-selected { border-color: #8d91ed66; background: #8589eb14; color: #c6c8ff; }
.document-preview-thumbnail:focus-visible { outline: 2px solid #a5a8f4; outline-offset: -2px; }
.document-preview-thumbnail-paper { flex: 0 0 auto; border-radius: 2px; }
.document-preview-thumbnail-paper .document-preview-placeholder { padding: 4px; font-size: 10px; }
.document-preview-thumbnail-canvas { display: block; max-width: 80px; height: auto; background: #fff; box-shadow: 0 1px 5px #0004; }
.document-preview[data-thumbnails="hidden"] .document-preview-body, .document-preview-body:has(> .document-preview-thumbnails[hidden]) { grid-template-columns: minmax(0,1fr); }
.document-preview[data-thumbnails="hidden"] .document-preview-thumbnails { display: none; }
@container (max-width: 650px) {
  .document-preview:not([data-thumbnails="shown"]) .document-preview-body { grid-template-columns: minmax(0,1fr); }
  .document-preview:not([data-thumbnails="shown"]) .document-preview-thumbnails { display: none; }
  .document-preview .document-preview-toolbar { gap: 6px; }
  .document-preview .document-preview-control-group { gap: 2px; }
  .document-preview .document-preview-page-field { gap: 4px; margin: 0 2px; }
  .document-preview .document-preview-page-field input { width: 34px; }
  .document-preview-file { flex-basis: 100%; }
}

.document-preview-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 50px;
  padding: 8px 14px;
  border-bottom: 1px solid #363740;
  background: #25262c;
}
.document-preview-control-group { display: flex; align-items: center; gap: 4px; }
.document-preview-toolbar .button, .document-preview-state .button, .document-preview-placeholder .button {
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #42434f;
  border-radius: 7px;
  background: #303139;
  color: #ededf3;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}
.document-preview-toolbar .button:hover:not(:disabled), .document-preview-state .button:hover, .document-preview-placeholder .button:hover { background: #3b3c46; border-color: #656572; }
.document-preview-toolbar .button:disabled { opacity: .35; cursor: default; }
.document-preview-toolbar .button svg { width: 15px; height: 15px; }
.document-preview-toolbar :is(input,button,a):focus-visible, .document-preview-viewport:focus-visible,
.document-preview-state .button:focus-visible, .document-preview-placeholder .button:focus-visible {
  outline: 2px solid #bab1ff;
  outline-offset: 3px;
}
.document-preview-toolbar .button { border-color: transparent; background: transparent; }
.document-preview-toolbar .button:hover:not(:disabled) { border-color: transparent; background: #ffffff0b; }
.document-preview-toolbar .document-preview-zoom-button { min-width: 52px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.document-preview-toolbar .document-preview-download { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; }
.document-preview-toolbar .document-preview-download span { display: none; }
.document-preview-page-field { display: flex; align-items: center; gap: 7px; margin: 0 4px; color: #a9aab5; font-size: 12px; font-weight: 400; white-space: nowrap; }
.document-preview-page-field input {
  width: 45px;
  min-width: 0;
  height: 33px;
  min-height: 0;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #ffffff06;
  color: #f2f2f5;
  font: inherit;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}
.document-preview-page-field input::-webkit-inner-spin-button, .document-preview-page-field input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.document-preview-page-field b { color: #ddddE5; font-weight: 500; }
.document-preview-zoom-button { min-width: 46px; text-align: center; font-size: 12px; color: #d1d1db; font-variant-numeric: tabular-nums; }
.document-preview-viewport {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #191a1f;
  scrollbar-color: #4a4b57 #191a1f;
  outline-offset: -3px !important;
}
.document-preview-pages { display: flex; flex-direction: column; align-items: center; gap: 24px; width: max-content; min-width: 100%; padding: 20px; box-sizing: border-box; }
.document-preview-page { flex: 0 0 auto; margin: 0; max-width: none; }
.document-preview-paper { position: relative; width: 100%; overflow: hidden; background: #fff; box-shadow: 0 2px 12px #0003; }
.document-preview-paper canvas { position: absolute; inset: 0; display: block; max-width: none; }
.document-preview-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; color: #757783; font-size: 13px; }
.document-preview-page-label { margin: 8px 0 0; height: 16px; color: #92939f; font-size: 11px; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.document-preview-image { display: block; flex: 0 0 auto; height: auto; max-width: none; background: #fff; box-shadow: 0 2px 12px #0003; }
.document-preview-status { min-height: 100%; display: grid; place-items: center; padding: 40px 24px; outline: none; }
.document-preview-state { display: flex; flex-direction: column; align-items: center; gap: 13px; max-width: 370px; text-align: center; }
.document-preview-state > svg { width: 30px; height: 30px; color: #9899a9; }
.document-preview-state h3 { margin: 0; font-size: 17px; font-weight: 600; color: #eeeeF5; }
.document-preview-state p { margin: 0; font-size: 13px; line-height: 1.7; color: #a7a8b5; }
.document-preview-state .button { margin-top: 4px; padding-inline: 17px; }
.document-preview-spinner { width: 25px; height: 25px; margin-bottom: 5px; border: 2px solid #42434c; border-top-color: #c3baff; border-radius: 50%; animation: document-preview-spin .9s linear infinite; }
@keyframes document-preview-spin { to { transform: rotate(360deg); } }
@media (max-width: 650px) {
  .detail-drawer[data-variant="document-preview"] { width: 100vw; }
  .detail-drawer[data-variant="document-preview"] .drawer-head { min-height: 64px; padding: 12px 16px; }
  .detail-drawer[data-variant="document-preview"] #drawerTitle { font-size: 15px; }
  .document-preview-toolbar { gap: 8px; padding: 9px 12px; }
  .document-preview-toolbar .button { min-height: 40px; min-width: 36px; }
  .document-preview-page-field input { height: 38px; width: 40px; }
  .document-preview-toolbar .document-preview-download span { display: none; }
  .document-preview-toolbar { gap: 6px; justify-content: space-between; }
  .document-preview-control-group { gap: 2px; }
  .document-preview-toolbar .document-preview-zoom-button { min-width: 48px; }
  .document-preview-pages { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .document-preview-spinner { animation-duration: 2s; }
  .detail-drawer[data-variant="document-preview"] { transition: none; }
}

/* Keep task context beside the submitted file while reviewing loan work. */
.loan-work-layout { min-height: 100%; }
.loan-work-layout [hidden] { display: none !important; }
.loan-work-details-pane { min-height: 100%; }
.loan-work-files-status { margin: 6px 0 0; color: var(--dim); font-size: 10px; }
.loan-work-files-status:empty, [data-work-files-error]:empty { display: none; }
.loan-work-pane-switch { display: none; }
.detail-drawer[data-variant="loan-work"].has-document-preview { width: min(1440px,calc(100vw - 32px)); }
.detail-drawer[data-variant="loan-work"].has-document-preview .drawer-body { overflow: hidden; }
.has-document-preview .loan-work-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 440px; grid-template-rows: minmax(0,1fr); }
.has-document-preview .loan-work-details-pane { min-width: 0; min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #3a3d47 transparent; }
.loan-work-preview-pane { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #191a1f; }
.loan-work-preview-head { min-width: 0; display: flex; align-items: center; gap: 8px; }
.loan-work-preview-head > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: #ececf1; }
.loan-work-preview-head > span { display: none; }
.loan-work-preview-head label { min-width: 0; flex: 1; margin: 0; }
.loan-work-preview-head select { width: 100%; min-width: 0; min-height: 32px; padding: 5px 28px 5px 10px; overflow: hidden; text-overflow: ellipsis; color: #ececf1; border: 1px solid transparent; border-radius: 6px; background-color: transparent; font-size: 12px; }
.loan-work-preview-host { flex: 1; min-height: 0; min-width: 0; overflow: hidden; }
.loan-work-preview-pane .document-preview-toolbar { min-height: 48px; padding: 8px 12px; gap: 6px 12px; }
.loan-work-preview-pane .document-preview-toolbar .button { min-width: 32px; min-height: 32px; padding: 5px 7px; font-size: 12px; }
.loan-work-preview-pane .document-preview-download span { display: none; }
.loan-work-preview-pane .document-preview-zoom-button { min-width: 52px; font-size: 12px; }
.loan-work-preview-pane .document-preview-page-field { font-size: 11px; }
.loan-work-preview-pane .document-preview-page-field input { width: 38px; height: 30px; }
@media (max-width:900px) {
  .detail-drawer[data-variant="loan-work"].has-document-preview { width: 100vw; }
  .has-document-preview .loan-work-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
  .has-document-preview .loan-work-pane-switch { grid-column: 1; grid-row: 1; display: flex; gap: 5px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
  .loan-work-pane-switch button { flex: 1; min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
  .loan-work-pane-switch button[aria-pressed="true"] { color: #c4c6ff; background: rgba(112,120,229,.12); border-color: rgba(112,120,229,.28); }
  .loan-work-pane-switch button:focus-visible { outline: 2px solid #8e95f2; outline-offset: 1px; }
  .has-document-preview .loan-work-preview-pane, .has-document-preview .loan-work-details-pane { grid-column: 1; grid-row: 2; }
  .loan-work-preview-pane { border-right: 0; }
  .loan-work-layout[data-mobile-pane="details"] .loan-work-preview-pane, .has-document-preview .loan-work-layout[data-mobile-pane="preview"] .loan-work-details-pane { display: none; }
}

/* Account outreach shares the Leads controls while retaining account timestamps. */
.platform-users .platform-users-table { min-width: 1180px; }
.platform-users-window-note { margin: 12px 0 0; font-size: 12px; line-height: 1.6; }
.platform-users .filter-bar .segmented { flex-shrink: 0; }

/* Compact admin-only lead options use the browser top layer to avoid table clipping. */
.lead-options { display: inline-flex; }
.lead-options-trigger.button { width: 30px; height: 30px; min-height: 30px; padding: 5px; border-color: transparent; }
.lead-options-trigger.button:hover { border-color: var(--line); }
.lead-options-heading, .lead-options-cell { position: sticky; right: 0; width: 46px; text-align: right; background: var(--panel); }
.lead-directory-table .lead-options-cell { padding-inline: 8px; }
.lead-options-popover { position: fixed; inset: auto; width: 224px; max-width: calc(100vw - 16px); margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); box-shadow: var(--shadow); }
.lead-options-popover .button { width: 100%; justify-content: flex-start; border: 0; background: transparent; }
.lead-options-popover .button:hover { background: var(--panel-hover); }
@media (max-width: 760px) {
  .lead-directory-table tbody tr { position: relative; }
  .lead-directory-table:has(.lead-options-cell) .lead-contact-cell { padding-right: 48px; }
  .lead-directory-table .lead-options-cell { position: absolute; right: 5px; top: 8px; padding: 0; }
  .lead-directory-table .lead-options-cell::before { content: none; }
}

.lead-reply-status-cell { white-space: nowrap; }
.lead-campaign-cell, .lead-directory-table th:has([data-lead-sort="campaign"]) { position: sticky; right: 0; white-space: nowrap; background: var(--panel); }
/* Sticky cells share the row's animated fill during both hover and fade-out. */
@media (min-width: 761px) {
  .lead-directory-table tbody tr { background-color: var(--panel); }
}
.lead-directory-table tbody tr > :is(.lead-campaign-cell, .lead-options-cell) {
  background: inherit;
}
.lead-directory-table:has(.lead-options-cell) .lead-campaign-cell,
.lead-directory-table:has(.lead-options-cell) th:has([data-lead-sort="campaign"]) { right: 46px; }
.notification-copy .button { margin: 8px 6px 0 0; }
.notification-item.is-unread .activity-dot { color: var(--accent-text); background: var(--blue-soft); }
@media (max-width: 760px) {
  .lead-directory-table .lead-reply-status-cell { position: static; grid-column: 1 / -1; border-top: 1px solid var(--line-subtle); }
}


/* New arrivals use an inset left strip until this viewer opens them. */
.lead-directory-table tr.lead-is-new > td:first-child,
.record-card.lead-is-new {
  position: relative;
}
.lead-directory-table tr.lead-is-new > td:first-child::after,
.record-card.lead-is-new::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--blue-bright);
  pointer-events: none;
}
.lead-new-label {
  display: inline-block;
  margin-left: 8px;
  color: var(--blue-bright);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .02em;
  vertical-align: middle;
}
@media (max-width: 680px) {
  .lead-directory-table tbody tr.lead-is-new {
    position: relative;
  }
  .lead-directory-table tbody tr.lead-is-new::after {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    border-radius: 3px;
    background: var(--blue-bright);
    pointer-events: none;
  }
  .lead-directory-table tr.lead-is-new > td:first-child::after {
    content: none;
  }
}

.lead-conversation-count { color: var(--dim); font-size: 12px; white-space: nowrap; }

/* Reply-linked Campaign belongs to Leads; the Users directory retains its layout. */
.lead-directory-table .lead-campaign-cell { white-space: nowrap; }
@media (max-width: 680px) {
  .lead-directory-table .lead-campaign-cell { position: static; grid-column: 1 / -1; border-top: 1px solid var(--line-subtle); }
}

.lead-edit-form > h3 { margin: 22px 0 12px; }
.lead-edit-form > [data-edit-status] { margin-top: 16px; }

/* Selection aligns with the contact header and uses the same fill as search fields. */
.lead-select-contact { display:flex; align-items:center; gap:12px; min-width:0; }
.lead-select-contact .lead-contact-button { flex:1; min-width:0; }
input.lead-select-checkbox {
  appearance:none; display:inline-grid; place-content:center; background:var(--field);
  border:1px solid var(--line); border-radius:5px; width:18px; height:18px; min-width:18px;
  min-height:18px; margin:0; padding:0; cursor:pointer; flex-shrink:0; color:var(--accent-text);
  box-shadow:none; transition:border-color .15s ease;
}
input.lead-select-checkbox::after { content:""; width:8px; height:5px; border:solid currentColor; border-width:0 0 2px 2px; transform:translateY(-1px) rotate(-45deg); opacity:0; }
input.lead-select-checkbox:checked, input.lead-select-checkbox:indeterminate { border-color:var(--blue-bright); background:var(--field); }
input.lead-select-checkbox:checked::after { opacity:1; }
input.lead-select-checkbox:indeterminate::after { width:8px; height:0; border-width:0 0 2px; transform:none; opacity:1; }
input.lead-select-checkbox:hover { border-color:var(--muted); }
input.lead-select-checkbox:focus-visible { outline:2px solid var(--blue-bright); outline-offset:3px; }
input.lead-select-checkbox:disabled { cursor:wait; opacity:.6; }
.lead-select-all { display:inline-flex; align-items:center; gap:10px; margin:0; cursor:pointer; }
.lead-select-all-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.lead-bulk-actions { display:inline-flex; align-items:center; gap:10px; flex-shrink:0; }
.lead-selection-count { font-size:11px; color:var(--muted); white-space:nowrap; }
.lead-bulk-trigger.button { width:auto; height:34px; min-height:34px; padding:0 12px; gap:8px; border-color:var(--line); }
.lead-bulk-trigger svg { width:13px; height:13px; }
.lead-kanban-select, .lead-empty-select { padding:4px 12px 12px; }
.lead-kanban-select .lead-select-all-label, .lead-empty-select .lead-select-all-label { position:static; width:auto; height:auto; clip-path:none; color:var(--muted); font-size:11px; }
@media (max-width:680px) {
  .lead-directory-table:has(#selectAllLeads) thead { display:block; position:static; width:auto; height:auto; overflow:visible; clip-path:none; padding-bottom:8px; }
  .lead-directory-table:has(#selectAllLeads) thead tr { display:block; }
  .lead-directory-table:has(#selectAllLeads) thead th { display:none; }
  .lead-directory-table:has(#selectAllLeads) thead th:first-child { display:block; padding:4px 11px; border:0; }
  .lead-directory-table:has(#selectAllLeads) thead .table-sort-button { display:none; }
  .lead-directory-table .lead-select-all-label { position:static; width:auto; height:auto; clip-path:none; }
}
@media (prefers-reduced-motion: reduce) { input.lead-select-checkbox { transition:none; } }

/* Staff discussion: one continuous thread, quiet chrome, persistent composer. */
.detail-drawer[data-variant="team-discussion"] { inset:0 0 0 auto; width:min(510px,100vw); height:100dvh; display:grid; grid-template-rows:auto minmax(0,1fr); overflow:hidden; border-radius:0; background:var(--panel); transition:transform 220ms cubic-bezier(.2,.8,.2,1); }
.detail-drawer[data-variant="team-discussion"] .drawer-head { padding:24px; background:var(--panel); border-bottom:1px solid var(--line); }
.detail-drawer[data-variant="team-discussion"] #drawerTitle { font-size:21px; letter-spacing:-.025em; }
.detail-drawer[data-variant="team-discussion"] .drawer-body { padding:0; min-height:0; overflow:hidden; }
.team-discussion-shell { height:100%; min-height:0; display:flex; flex-direction:column; position:relative; }
.team-discussion-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:20px 24px; border-bottom:1px solid var(--line); }
.team-discussion-bar > div { display:grid; gap:5px; }.team-discussion-bar strong {font-size:14px}.team-discussion-bar > div > span {font-size:11px;color:var(--muted)}
.team-follow { display:flex; gap:6px; align-items:center; background:transparent; color:var(--muted); border:1px solid var(--line); border-radius:8px; padding:7px 9px; font-size:11px; cursor:pointer; }.team-follow svg {width:13px;height:13px}.team-follow[aria-pressed="true"] { color:var(--accent,#9998fa);background:rgba(123,121,223,.1); }
.team-discussion-scroll { flex:1; min-height:0; overflow-y:auto; padding:10px 22px 24px; overscroll-behavior:contain; scrollbar-width:none; }.team-discussion-scroll::-webkit-scrollbar {display:none}
.team-message {display:flex;gap:12px;padding:18px 0}.team-avatar {flex-shrink:0;display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--line);border-radius:10px;background:var(--panel-2);color:var(--muted);font-size:11px;font-weight:600}.team-message.is-self .team-avatar {background:rgba(123,121,223,.12);border-color:rgba(123,121,223,.25);color:#bcbafa}
.team-message-content {flex:1;min-width:0}.team-message header {display:flex;align-items:center;gap:8px;min-height:21px}.team-message header strong {font-size:12px}.team-message time {font-size:10px;color:var(--muted);white-space:nowrap}.team-message p {margin:5px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;color:var(--text)}
.team-reply-button {margin-left:auto;padding:3px;background:transparent;color:var(--muted);border:0;cursor:pointer;opacity:0;font-size:10px;display:flex;gap:4px;align-items:center}.team-reply-button svg {width:12px;height:12px}.team-message:hover .team-reply-button,.team-reply-button:focus-visible {opacity:1}.team-message.is-pending {opacity:.6}.team-message.is-highlighted {background:rgba(123,121,223,.08);border-radius:10px}
.team-mention {color:#a6a4ff;font-weight:550}.team-reply-reference {display:grid;gap:3px;max-width:100%;text-align:left;background:var(--panel-2);border:0;border-left:2px solid #7774d4;border-radius:0 6px 6px 0;padding:8px 10px;margin:8px 0;color:var(--muted);font-size:11px;cursor:pointer}.team-reply-reference strong {font-size:10px;color:var(--text)}.team-reply-reference span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.team-empty {text-align:center;margin:clamp(30px,12vh,130px) auto 25px;max-width:285px}.team-empty > span {display:grid;place-items:center;margin:0 auto 17px;width:48px;height:48px;border-radius:14px;background:rgba(123,121,223,.1);color:#a6a4ed}.team-empty h3 {font-size:15px;margin:0 0 8px}.team-empty p {font-size:12px;line-height:1.7;color:var(--muted)}
.team-discussion-footer {padding:0 20px 12px;background:var(--panel)}.team-discussion-status {font-size:11px;color:var(--muted);margin:0 0 8px;line-height:1.5}.team-discussion-status:empty {display:none}
.team-composer {position:relative;border:1px solid var(--line);border-radius:13px;background:var(--panel-2);transition:border-color .15s,box-shadow .15s}.team-composer:focus-within {border-color:#7774cf;box-shadow:0 0 0 2px rgba(119,116,207,.09)}.team-composer textarea {display:block;width:100%;min-height:70px;max-height:150px;background:transparent!important;border:0!important;box-shadow:none!important;outline:none;resize:none;padding:14px 14px 6px;color:var(--text);font:inherit;font-size:13px;line-height:1.6;scrollbar-width:none}.team-composer textarea::-webkit-scrollbar {display:none}
.team-composer-tools {display:flex;align-items:center;gap:8px;padding:8px 11px}.team-mention-trigger {width:28px;height:28px;border:0;border-radius:7px;color:var(--muted);background:transparent;font-size:20px;cursor:pointer}.team-mention-trigger:hover {background:var(--line);color:var(--text)}.team-send {display:grid;place-items:center;width:32px;height:32px;margin-left:auto;border:0;border-radius:9px;color:white;background:#6664d5;cursor:pointer}.team-send svg {width:16px;height:16px}.team-send:disabled {background:transparent;color:var(--muted);opacity:.45;cursor:default}
.team-mention-menu {position:absolute;bottom:calc(100% + 8px);left:0;right:0;z-index:2;max-height:245px;overflow-y:auto;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:6px;box-shadow:0 12px 36px #0004;scrollbar-width:none}.team-mention-menu button {display:flex;gap:10px;align-items:center;text-align:left;width:100%;border:0;border-radius:8px;padding:9px;background:transparent;color:var(--text);cursor:pointer}.team-mention-menu button:hover,.team-mention-menu button[aria-selected="true"] {background:var(--panel-2)}.team-mention-menu button > span:last-child {display:grid;gap:3px}.team-mention-menu strong {font-size:12px}.team-mention-menu small {font-size:10px;color:var(--muted);text-transform:capitalize}.team-mention-menu p {padding:8px;font-size:12px;color:var(--muted)}
.team-reply-preview {display:flex;align-items:center;gap:10px;padding:11px 14px;border-bottom:1px solid var(--line);font-size:11px}.team-reply-preview > div {min-width:0;display:grid;gap:4px;flex:1}.team-reply-preview span {color:var(--muted);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.team-reply-preview button {border:0;background:transparent;color:var(--muted);padding:4px;cursor:pointer}.team-reply-preview svg {width:14px;height:14px}
.team-load-older {display:block;margin:8px auto;padding:6px 10px;border:0;background:transparent;color:var(--muted);font-size:11px;cursor:pointer}.team-new-messages {position:absolute;bottom:205px;left:50%;transform:translateX(-50%);padding:8px 12px;border:1px solid var(--line);border-radius:20px;background:var(--panel-2);color:var(--text);box-shadow:0 4px 12px #0003;font-size:11px;cursor:pointer}.team-new-messages svg {width:12px;height:12px;vertical-align:middle}.team-unread-divider {display:flex;align-items:center;gap:12px;color:#a6a4ff;font-size:10px;padding:12px 0}.team-unread-divider::before,.team-unread-divider::after {content:'';height:1px;background:rgba(123,121,223,.3);flex:1}.team-unread-dot {width:6px;height:6px;border-radius:50%;background:#9c99ff}.team-discussion-shell [hidden],.team-unread-dot[hidden] {display:none!important}
@media(hover:none){.team-reply-button{opacity:1}}
@media(prefers-reduced-motion:reduce){.detail-drawer[data-variant="team-discussion"]{transition:none}}
.detail-drawer[data-variant="team-discussion"] .drawer-body { height:auto; }
.team-discussion-bar,.team-discussion-footer { flex-shrink:0; }

/* Keep notification inbox actions within the drawer header. */
.detail-drawer[data-variant="notifications"] .drawer-head > div { flex: 1; min-width: 0; }
.notification-read-all { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 480px) {
  .detail-drawer[data-variant="notifications"] .drawer-head { flex-wrap: wrap; }
  .detail-drawer[data-variant="notifications"] .drawer-head > div { flex-basis: calc(100% - 64px); }
  .detail-drawer[data-variant="notifications"] #drawerClose { order: 1; }
  .notification-read-all { order: 2; }
}
