/* Portal accounts V1 (/portal/), served by includes/hq-portal-accounts.php. Colors and type from BRAND.md. */
:root {
	--navy: #02203A; --navy-hover: #0C2E4D; --accent: #3E6E9E; --accent-light: #9DBBDB;
	--tint: #F3F6FA; --white: #FFFFFF; --wash: #F0F0ED; --paper: #FAFAF8;
	--text: #1C1C1C; --text-mid: #454545; --text-light: #6B6B6B;
	--border: #E3E5E4; --border-light: #ECEDEC; --border-strong: #D3D6D4;
	--amber: #B7791F; --amber-line: #D9A441; --amber-wash: #FFF8EB; --green: #2E7D5B; --green-wash: #ECFDF5; --red: #B42318; --red-wash: #FEF3F2;
	--serif: Georgia, "Times New Roman", serif;
	--sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--wash); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.55; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--navy); margin: 0; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }

.ra-top { background: var(--white); border-bottom: 1px solid var(--border); padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.ra-top-in { max-width: 860px; margin: 0 auto; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ra-logo { font-family: var(--serif); font-size: 19px; letter-spacing: 0.06em; color: var(--navy); text-decoration: none; white-space: nowrap; }
.ra-logo span { font-family: var(--sans); font-size: 10px; letter-spacing: 0.2em; color: var(--text-light); margin-left: 6px; font-weight: 600; }
.ra-me { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-mid); min-width: 0; }
.ra-me b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

.ra-main { padding: 32px max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left)); }
.ra-wrap { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.ra-signin { max-width: 400px; margin: 40px auto 0; background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; align-items: stretch; text-align: center; }
.ra-signin h1 { font-size: 27px; }
.ra-signin p { margin: 0; color: var(--text-mid); font-size: 14px; }
.ra-gbtn { display: flex; justify-content: center; min-height: 44px; }
.ra-fine { font-size: 12px !important; color: var(--text-light) !important; }
.ra-or { display: flex; align-items: center; gap: 10px; color: var(--text-light); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.ra-or::before, .ra-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.ra-code { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.ra-lab { font-size: 13px; font-weight: 600; color: var(--text); }
.ra-in { width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 12px; height: 44px; font: inherit; font-size: 16px; color: var(--text); background: var(--white); }
.ra-in:focus { outline: 2px solid var(--accent-light); outline-offset: 0; border-color: var(--accent); }
.ra-otp { font-size: 24px; letter-spacing: 0.4em; text-align: center; font-weight: 600; }
.ra-btn.ra-wide { justify-content: center; height: 44px; width: 100%; font-size: 14.5px; }
.ra-btn[disabled] { opacity: 0.6; cursor: default; }
.ra-link[disabled] { color: var(--text-light); cursor: default; font-weight: 500; }
.ra-msg { border-radius: 6px; padding: 10px 12px; font-size: 13.5px; text-align: left; }
.ra-msg.err { background: var(--red-wash); color: var(--red); }
.ra-msg.warn { background: var(--amber-wash); color: var(--text); }

.ra-hello { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.ra-hello h1 { font-size: clamp(26px, 4vw, 32px); letter-spacing: -0.01em; }
.ra-hello p { margin: 4px 0 0; color: var(--text-mid); font-size: 14px; }
.ra-btn { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 6px; background: var(--navy); color: #fff; font-weight: 600; font-size: 13.5px; text-decoration: none; border: 0; cursor: pointer; white-space: nowrap; }
.ra-btn:hover { background: var(--navy-hover); }
.ra-btn.out { background: var(--white); color: var(--navy); border: 1px solid var(--border-strong); }
.ra-btn.out:hover { background: var(--paper); }
.ra-btn[aria-disabled="true"] { background: var(--border); color: var(--text-light); pointer-events: none; }

.ra-loan { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ra-loan-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: start; }
.ra-addr { font-family: var(--serif); font-size: 19px; color: var(--navy); }
.ra-meta { font-size: 12.5px; color: var(--text-light); margin-top: 2px; }
.ra-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--tint); color: var(--accent); }
.ra-pill.funded { background: var(--green-wash); color: var(--green); }
.ra-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ra-track i { height: 5px; border-radius: 3px; background: var(--border); display: block; }
.ra-track i.on { background: var(--navy); }
.ra-track-l { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; font-size: 11px; color: var(--text-light); }
.ra-track-l .cur { color: var(--navy); font-weight: 600; }
.ra-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border-light); padding-top: 12px; font-size: 13px; color: var(--text-mid); }

.ra-empty { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ra-empty p { margin: 0; color: var(--text-mid); max-width: 460px; }
.ra-new { border: 1px dashed var(--border-strong); background: var(--paper); border-radius: 10px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-mid); }
.ra-new b { display: block; color: var(--navy); font-size: 14.5px; }
.ra-loading { text-align: center; color: var(--text-light); padding: 60px 0; }
@media (max-width: 520px) { .ra-track-l { font-size: 10px; } .ra-me .ra-email { display: none; } }

/* new deal flow (new-deal.js) */
.nd { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.nd-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--text-light); }
.nd-prog { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.nd-prog i { height: 5px; border-radius: 3px; background: var(--border); display: block; }
.nd-prog i.on { background: var(--navy); }
.nd-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.nd-q { font-size: 24px; }
.nd-sub { color: var(--text-mid); font-size: 13.5px; margin: 0; }
.nd-opts { display: flex; flex-direction: column; gap: 8px; }
.nd-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; background: var(--white); border: 1px solid var(--border-strong); border-radius: 8px; padding: 12px 14px; font: inherit; color: var(--text); cursor: pointer; }
.nd-opt b { display: block; font-weight: 600; font-size: 14.5px; }
.nd-opt small { color: var(--text-light); font-size: 12.5px; }
.nd-opt:hover { background: var(--paper); }
.nd-opt.on { border: 2px solid var(--navy); background: var(--tint); padding: 11px 13px; }
.nd-tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); background: var(--green-wash); border-radius: 4px; padding: 3px 7px; white-space: nowrap; }
.nd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nd-chip { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--white); color: var(--text-mid); font: inherit; font-size: 13.5px; cursor: pointer; }
.nd-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.nd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nd-grid.three { grid-template-columns: 2fr 1.4fr 1fr; }
@media (max-width: 560px) { .nd-grid, .nd-grid.three { grid-template-columns: 1fr; } }
.nd-fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.nd-fld label { font-size: 12.5px; font-weight: 600; color: var(--text-mid); }
.nd-fld label i { font-weight: 400; font-style: normal; color: var(--text-light); }
.nd-fld input, .nd-fld select, .nd-fld textarea { width: 100%; min-width: 0; border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 11px; height: 42px; font: inherit; font-size: 15px; color: var(--text); background: var(--white); }
.nd-fld textarea { height: auto; padding: 10px 11px; resize: vertical; }
.nd-fld input:disabled { background: var(--paper); color: var(--text-light); }
.nd-fld small { font-size: 12px; color: var(--text-light); }
.nd-money { position: relative; }
.nd-money span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.nd-money input { padding-left: 24px; font-variant-numeric: tabular-nums; }
.nd-fld.bad input, .nd-fld.bad select { border-color: var(--red); }
.nd-err { font-size: 12px; color: var(--red); }
.nd-note { font-size: 13px; border-radius: 6px; padding: 10px 12px; }
.nd-note.amber { background: var(--amber-wash); border-left: 3px solid var(--amber-line); }
.nd-box { border: 1px solid var(--border); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.nd-h { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); }
.nd-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text-mid); }
.nd-kv b { color: var(--text); font-weight: 600; text-align: right; }
.nd-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; align-self: flex-start; }
.nd-acts { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border-light); padding-top: 16px; }
.nd-acts .ra-btn[disabled] { opacity: 0.6; cursor: default; }
.nd-fine { font-size: 12px; color: var(--text-light); text-align: center; margin: 0; }
.nd-done { align-items: center; text-align: center; }
.nd-done p { margin: 0; color: var(--text-mid); }
.nd-check { width: 52px; height: 52px; border-radius: 50%; background: var(--green-wash); color: var(--green); display: grid; place-items: center; }
.nd-check svg { width: 26px; height: 26px; }

/* Google address suggestions under the street field (new-deal.js) */
.nd-fld { position: relative; }
.nd-addr { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 4px 0 0; padding: 4px 0; list-style: none; background: var(--white); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(2,32,58,0.12); }
.nd-addr li[role=option] { padding: 9px 12px; font-size: 14px; color: var(--text); cursor: pointer; }
.nd-addr li[role=option] small { display: block; font-size: 12px; color: var(--text-light); }
.nd-addr li[role=option]:hover, .nd-addr li.on { background: var(--tint); }
.nd-addr .nd-addr-by { padding: 6px 12px 4px; font-size: 10.5px; color: var(--text-light); text-align: right; border-top: 1px solid var(--border-light); }

/* funded loan page (servicing.js) */
.sv { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.sv h1 { font-size: clamp(24px, 3.4vw, 30px); }
.sv h2 { font-size: 17px; margin-bottom: 10px; }
.sv-eye { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.sv-meta { margin: 4px 0 0; font-size: 13.5px; color: var(--text-mid); }
.sv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sv-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sv-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sv-pill.green { background: var(--green-wash); color: var(--green); }
.sv-pill.blue { background: var(--tint); color: var(--accent); }
.sv-pill.amber { background: var(--amber-wash); color: var(--amber); }
.sv-pill.red { background: var(--red-wash); color: var(--red); }
.sv-tiles { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .sv-tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .sv-tiles { grid-template-columns: 1fr; } }
.sv-tile { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sv-tile.hero { background: var(--navy); border-color: var(--navy); }
.sv-tile .lab { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); }
.sv-tile.hero .lab { color: var(--accent-light); }
.sv-tile .val { font-family: var(--serif); font-size: 24px; color: var(--navy); line-height: 1.2; }
.sv-tile.hero .val { color: #fff; font-size: 30px; }
.sv-tile .sub { font-size: 12.5px; color: var(--text-mid); }
.sv-tile.hero .sub { color: rgba(255,255,255,0.8); }
.sv-bar { height: 7px; border-radius: 4px; background: var(--border); overflow: hidden; display: flex; margin-top: 6px; }
.sv-bar i { display: block; height: 100%; }
.sv-bar .used { background: var(--navy); }
.sv-bar .pend { background: var(--accent-light); }
.sv-two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 860px) { .sv-two { grid-template-columns: 1fr; } }
.sv-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px; min-width: 0; }
.sv-card p { margin: 0 0 8px; font-size: 14px; color: var(--text-mid); }
.sv-card p:last-child { margin-bottom: 0; }
.sv-fine { font-size: 12.5px !important; color: var(--text-light) !important; }
.sv-tbl { overflow-x: auto; }
.sv table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.sv th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sv td { padding: 10px 8px; border-bottom: 1px solid var(--border-light); color: var(--text-mid); vertical-align: top; white-space: nowrap; }
.sv td.b { color: var(--text); font-weight: 600; }
.sv td.r, .sv th.r { text-align: right; }
.sv-kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13.5px; color: var(--text-mid); }
.sv-kv:last-child { border-bottom: 0; }
.sv-kv b { color: var(--text); font-weight: 600; text-align: right; }
.sv-doc { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13.5px; }
.sv-doc:last-child { border-bottom: 0; }
.sv-doc a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sv-empty { text-align: center; padding: 32px; }
.sv-empty p { max-width: 520px; margin: 10px auto 0 !important; }

/* funded loan page requests (servicing.js, phase 2) */
.sv-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sv-req { display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--navy); }
.sv-req-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sv-req-h h2 { margin: 0; }
.sv-h3 { font-size: 13px !important; font-weight: 600; color: var(--text) !important; margin: 4px 0 0 !important; }
.sv-h3 i { font-weight: 400; font-style: normal; color: var(--text-light); }
.sv-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.sv-check input { margin-top: 4px; flex: none; }
.sv-auth { background: var(--paper); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.nd-fld label i { font-style: normal; font-weight: 400; color: var(--text-light); }
.sv-est { background: var(--paper); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.sv-total { border-top: 1px solid var(--border); border-bottom: 0 !important; font-size: 15px; }
.sv-total b { font-family: var(--serif); font-size: 19px; color: var(--navy); font-weight: 400; }
.ra-msg.ok { background: var(--green-wash); color: var(--green); }
.sv-req .nd-acts { border-top: 1px solid var(--border-light); }
.sv-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text); }
.sv-h2link { float: right; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; margin-top: 4px; }
.sv-h2link:hover { text-decoration: underline; }
.sv-h2link { background: none; border: 0; padding: 0; cursor: pointer; }
/* insurance (2026-10-18): the banner when a policy is close to expiring, the mortgagee clause box */
.sv-alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--amber-wash); color: var(--text); border: 1px solid var(--amber-line); border-radius: 10px; padding: 12px 16px; font-size: 14px; font-weight: 600; }
.sv-alert.red { background: var(--red-wash); color: var(--red); border-color: var(--red); }
.sv-clause { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; background: var(--paper); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 12px 0 8px; }
.sv-clause pre { margin: 4px 0 0; font-family: var(--sans); font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.sv-link { color: var(--accent) !important; font-weight: 600; text-decoration: none; }
.ra-btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* navy header tabs (account.js, 2026-10-18): Home figures, your loans, For you; Payments, Draws and Documents tabs */
.ra-wrap.ph { max-width: 1080px; gap: 20px; }
.ph .sv { max-width: none; }
.ph-eye { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-light); }
.ph-figs { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--paper); border-top: 2px solid var(--navy); border-bottom: 1px solid var(--navy); }
.ph-figs > div { padding: 14px 18px; border-left: 1px solid var(--border); min-width: 0; }
.ph-figs > div:first-child { border-left: 0; }
.ph-figs dt { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); }
.ph-figs dd { margin: 4px 0 2px; font-family: var(--serif); font-size: 25px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-figs small { display: block; font-size: 12.5px; color: var(--text-light); }
@media (max-width: 760px) { .ph-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ph-figs > div:nth-child(3) { border-left: 0; } .ph-figs > div:nth-child(n+3) { border-top: 1px solid var(--border); } }
.ph-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .ph-two { grid-template-columns: 1fr; } }
.ph-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ph-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border-light); font-size: 14px; }
.ph-eye + .ph-row { border-top: 0; }
.ph-addr { min-width: 0; }
.ph-addr b { display: block; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-addr span { display: block; font-size: 12.5px; color: var(--text-light); }
.ph-pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.ph-pill.g { background: var(--green-wash); color: var(--green); }
.ph-pill.b { background: var(--tint); color: var(--accent); }
.ph-pill.n { background: var(--paper); color: var(--text-light); }
.ph-go { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; cursor: pointer; white-space: nowrap; }
.ph-go:hover { color: var(--navy); }
.ph-go.off { color: var(--text-light); cursor: default; }
.ph-todo { display: block; border-left: 3px solid var(--accent); background: var(--tint); padding: 10px 14px; border-radius: 0 6px 6px 0; text-decoration: none; cursor: pointer; }
.ph-todo + .ph-todo { margin-top: 8px; }
.ph-todo b { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.ph-todo span { display: block; font-size: 13px; color: var(--text-mid); }
.ph-todo.amber { border-left-color: var(--amber-line); background: var(--amber-wash); }
.ph-todo.red { border-left-color: var(--red); background: var(--red-wash); }
.ph-todo.g { border-left-color: var(--green); background: var(--green-wash); cursor: default; }
.ph-todo:focus-visible, .ph-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph-wait { margin: 0; font-size: 13px; color: var(--text-light); }
.ph-block { display: flex; flex-direction: column; gap: 10px; }
.ph-lh { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ph-lh h2 { font-size: 22px; }
.ph-lh .ph-eye { margin-bottom: 2px; color: var(--accent); }
.ph-dl { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 12px 18px; font-size: 14px; color: var(--text-mid); }
.ph-dl b { font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--navy); }
.ph-docs { display: flex; flex-direction: column; }
/* phone: the address gets its own line, the stage and Open sit under it */
@media (max-width: 520px) {
	.ph-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
	.ph-addr { grid-column: 1 / -1; }
	.ph-addr b { white-space: normal; }
	.ph-pill { justify-self: start; }
}

/* draw invoices on the Draws tab (account.js) */
.ph-drop { border: 2px dashed var(--border-strong); background: var(--paper); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; text-align: center; }
.ph-drop:hover { border-color: var(--accent); }
.ph-drop b { color: var(--navy); font-size: 14.5px; }
.ph-drop span { font-size: 12.5px; color: var(--text-light); }
.ph-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ph-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph-invlist .sv-doc span b { font-weight: 600; color: var(--text); }

/* new-draw panel and draw rows on the Draws tab (2026-10-18) */
.ph-newdraw { gap: 14px; }
.ph-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 16px; }
.ph-steps > li { counter-increment: st; position: relative; padding-left: 38px; display: flex; flex-direction: column; gap: 8px; }
.ph-steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--white); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ph-steps h3 { margin: 2px 0 0; font-family: var(--serif); font-weight: 400; font-size: 17px; color: var(--navy); }
.ph-steps h3 i { font-family: var(--sans); font-style: normal; font-size: 13px; color: var(--text-light); }
.ph-steps .sv-fine { margin: 0; }
.ph-steps .nd-acts { border-top: 0; padding-top: 0; justify-content: flex-start; flex-wrap: wrap; }
.ph-invbox { display: flex; flex-direction: column; gap: 10px; }
.ph-invbox select { width: 100%; height: 42px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 10px; font: inherit; font-size: 15px; background: var(--white); color: var(--text); }
.ph-draws { display: flex; flex-direction: column; }
.ph-draw { border-top: 1px solid var(--border-light); padding: 10px 0; }
.ph-draw:first-child { border-top: 0; }
.ph-drawrow { display: grid; grid-template-columns: minmax(0, 1fr) 100px 150px; gap: 12px; align-items: start; }
.ph-drawrow > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ph-drawrow b { font-weight: 600; color: var(--text); font-size: 14.5px; }
.ph-drawamt { text-align: right; font-size: 14.5px; }
.ph-rowinv { margin-top: 10px; background: var(--paper); border: 1px solid var(--border-light); border-radius: 10px; padding: 12px; }
.ph-rowinv .ph-drop { background: var(--white); }
@media (max-width: 520px) {
	.ph-drawrow { grid-template-columns: minmax(0, 1fr) auto; }
	.ph-drawrow > span:last-child { grid-column: 1 / -1; }
}

/* broker teams (2026-10-20): Share with a colleague on a lead broker's loan, and Settings > Always share with */
.ra-foot-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ra-share { border-top: 1px solid var(--border-light); padding-top: 12px; display: grid; gap: 10px; }
.ra-share[hidden] { display: none; }
.ra-share-h { margin: 0; font-weight: 600; color: var(--navy); font-size: 14px; }
.ra-team { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ra-team li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--border-light); border-radius: 6px; padding: 8px 10px; font-size: 13.5px; min-width: 0; }
.ra-team li span { min-width: 0; overflow-wrap: anywhere; }
.ra-team small { display: block; color: var(--text-light); font-size: 12.5px; }
.ra-link { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px; }
.ra-link:disabled { color: var(--text-light); cursor: default; }
.ra-share-f { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ra-share-f.col { flex-direction: column; align-items: stretch; }
.ra-share-f.col .ra-btn { align-self: flex-start; }
.ra-share-f label { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-mid); font-weight: 500; flex: 1 1 180px; min-width: 0; }
.ra-share-f input, .ra-share-f textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--white); border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.ra-share-f input:focus-visible, .ra-share-f textarea:focus-visible, .ra-link:focus-visible, .ra-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Settings (2026-10-21, plan dev/active/portal-settings/plan.md): Your details, Language, Notifications */
.ra-set { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.ra-set fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ra-set legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.ra-set-row { display: flex; gap: 12px; flex-wrap: wrap; }
.ra-set label { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-mid); font-weight: 500; flex: 1 1 140px; min-width: 0; }
.ra-set label.w2 { flex: 2 1 240px; }
.ra-set input, .ra-set select { font: inherit; font-size: 14px; color: var(--text); background: var(--white); border: 1px solid var(--border-strong); border-radius: 6px; height: 38px; padding: 0 10px; min-width: 0; width: 100%; box-sizing: border-box; }
.ra-set input:focus-visible, .ra-set select:focus-visible, .ra-seg button:focus-visible, .ra-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ra-set-legal { display: grid; gap: 2px; padding: 10px 12px; border-radius: 6px; background: var(--paper); }
.ra-set-legal span { font-size: 12px; color: var(--text-light); }
.ra-set-legal b { font-size: 15px; color: var(--navy); font-weight: 600; }
.ra-set-legal small { font-size: 12px; color: var(--text-light); }
.ra-set-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ra-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; margin-top: 8px; align-self: flex-start; }
.ra-seg button { font: inherit; font-size: 13.5px; font-weight: 600; padding: 8px 18px; background: var(--white); color: var(--text-mid); border: 0; cursor: pointer; }
.ra-seg button + button { border-left: 1px solid var(--border-strong); }
.ra-seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.ra-set-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ra-set-line > div { display: grid; gap: 4px; min-width: 0; }
.ra-set-line b { font-size: 14px; color: var(--text); font-weight: 600; }
.ra-set-line small { font-size: 12.5px; color: var(--text-light); line-height: 1.45; }
.ra-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-mid); cursor: pointer; }
.ra-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.ra-confirm-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin: 12px 0 14px; }
.ra-confirm-dl div { min-width: 0; }
.ra-confirm-dl dt { font-size: 12px; color: var(--text-light); }
.ra-confirm-dl dd { margin: 2px 0 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
/* My entities (2026-10-29, hq-portal-entities.php) */
.ra-set textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--white); border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; min-width: 0; width: 100%; box-sizing: border-box; resize: vertical; }
.ra-set textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ra-ents { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 8px; }
.ra-ents li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; background: var(--paper); border: 1px solid var(--border-light); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.ra-ent-main { display: grid; gap: 3px; min-width: 0; }
.ra-ent-main b { font-size: 15px; color: var(--navy); font-weight: 600; overflow-wrap: anywhere; }
.ra-ent-main small { font-size: 12.5px; color: var(--text-light); overflow-wrap: anywhere; }
.ra-ent-loans { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ra-ent-act { display: flex; gap: 4px; flex-shrink: 0; }
.ra-ent-h { margin: 0; font-size: 15px; font-weight: 600; color: var(--navy); }
#ra-ent-f label, .ra-det label { align-content: start; }
/* My details for loans (2026-10-29, hq-portal-details.php): four parts, each its own form */
.ra-det + .ra-det { border-top: 1px solid var(--border-light); padding-top: 16px; margin-top: 4px; }
.ra-det input:disabled { background: var(--paper); color: var(--text-light); }
.ra-det .ra-set-row > span:empty { flex: 1 1 140px; }
.ra-det-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ra-ent-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin: 0 0 6px; }
.ra-ent-dl div { min-width: 0; }
.ra-ent-dl dt { font-size: 12px; color: var(--text-light); }
.ra-ent-dl dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
/* iPhone zooms into a box under 16px */
@media (max-width: 640px) { .ra-set input, .ra-set select { font-size: 16px; height: 44px; } .ra-set textarea { font-size: 16px; } .ra-set-line { flex-wrap: wrap; } }

/* Latest message on a loan card (2026-10-22): who, one line, when, a dot while it is new */
.ra-latest { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding-top: 12px; border-top: 1px solid var(--border-light); color: inherit; text-decoration: none; }
.ra-latest:hover .ra-latest-t span { color: var(--text); }
.ra-latest-av { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #9DBBDB; color: #02203A; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ra-latest-av.is-b { background: #E7E7E3; color: var(--text-mid); }
.ra-latest-t { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--text-mid); }
.ra-latest-t b { display: block; color: var(--text); font-weight: 600; }
.ra-latest-t span { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ra-latest-when { flex: none; font-size: 12px; color: #6B6B6B; white-space: nowrap; }
.ra-latest-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #3E6E9E; }
.ra-latest.is-new .ra-latest-t span { color: var(--text); }

/* broker pipeline (2026-10-25): Needs you, then one row per loan; rows stack on a phone */
.bp-needs { display: grid; gap: 8px; margin-top: 18px; }
.bp-list { margin-top: 22px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 6px; }
.bp-list .ph-eye { margin: 0 0 6px; }
.bp-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) 115px 150px 100px 140px; gap: 12px; align-items: center; padding: 11px 6px; border-top: 1px solid var(--border-light); color: var(--text); text-decoration: none; font-size: 13.5px; }
a.bp-row:hover { background: var(--tint); }
/* broker rows (2026-10-26): the deal name is the link, stretched over the row, so Share can sit on the row */
.bp-link { position: relative; }
.bp-link:hover { background: var(--tint); }
.bp-link:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.bp-go { color: inherit; text-decoration: none; }
.bp-go:focus-visible { outline: none; }
.bp-go::after { content: ''; position: absolute; inset: 0; }
.bp-share-btn { position: relative; z-index: 1; display: table; margin-top: 4px; border: 1px solid var(--border-strong); background: var(--white); color: var(--accent); border-radius: 6px; padding: 3px 10px; font: 600 12px var(--sans); cursor: pointer; }
.bp-share-btn:hover { border-color: var(--accent); }
.bp-share { padding: 6px 6px 16px; border-top: 1px solid var(--border-light); }
a.bp-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bp-row.off { color: var(--text-mid); }
.bp-head { border-top: 0; padding-top: 4px; padding-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-light); }
.bp-head .num { text-align: right; }
.bp-deal small { font-variant-numeric: tabular-nums; }
.bp-deal, .bp-client { min-width: 0; overflow-wrap: anywhere; }
.bp-deal b { display: block; color: var(--navy); font-weight: 600; }
.bp-deal small, .bp-client small { display: block; color: var(--text-light); font-size: 12px; }
.bp-amt, .bp-close { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bp-close.prot small { color: var(--green); font-size: 12px; font-weight: 600; white-space: normal; }
.bp-more { margin: 8px 0 6px; }
.bp-w { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.bp-w.a { background: var(--amber-wash); color: var(--amber); }
.bp-w.g { background: var(--green-wash); color: var(--green); }
.bp-w.b { background: var(--tint); color: var(--accent); }
.bp-w.n { background: var(--paper); color: var(--text-light); }
@media (max-width: 760px) {
	.bp-head { display: none; }
	.bp-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
	.bp-deal { grid-column: 1; }
	.bp-amt { grid-column: 2; grid-row: 1; }
	.bp-client { grid-column: 1 / -1; }
	.bp-stage, .bp-wait { grid-row: 3; }
	.bp-stage { grid-column: 1; }
	.bp-wait { grid-column: 2; justify-self: end; }
	.bp-close { grid-column: 1 / -1; text-align: left; color: var(--text-light); font-size: 12px; }
	.bp-close:not(:empty)::before { content: 'Closing '; }
	.bp-close.prot::before { content: none; }
}

/* Your brand, broker Settings (2026-10-29, hq-portal-broker-brand.php). The preview uses the broker's color (--bb) the
   way a white-label term sheet does (BRAND.md White-label): their color for the rule, heading and button, ours for the rest */
.bp-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.bb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 12px; }
@media (max-width: 720px) { .bb-grid { grid-template-columns: minmax(0, 1fr); } }
.bb-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bb-fld { display: grid; gap: 6px; }
.bb-fld b { font-size: 14px; color: var(--text); font-weight: 600; }
.bb-fld small { font-size: 12.5px; color: var(--text-light); line-height: 1.45; }
.bb-file { position: relative; overflow: hidden; cursor: pointer; display: inline-flex; align-items: center; }
.bb-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bb-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.bb-color { display: flex; gap: 8px; align-items: center; }
.bb-color input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--white); cursor: pointer; }
.bb-color input[type="text"] { font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; text-transform: uppercase; width: 110px; height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; color: var(--text); background: var(--white); }
.bb-color input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bb-check.ok { color: var(--green) !important; }
.bb-check.bad { color: var(--red) !important; }
.bb-prev { min-width: 0; }
.bb-prev-eye { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-light); }
.bb-doc { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 18px; box-shadow: 0 1px 2px rgba(2, 32, 58, 0.06); }
.bb-doc-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 3px solid var(--bb); }
.bb-doc-top img { max-height: 40px; max-width: 160px; object-fit: contain; }
.bb-nologo { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 12px; border: 1px dashed var(--border-strong); border-radius: 4px; font-size: 12px; color: var(--text-light); }
.bb-doc-kind { font-size: 10px; letter-spacing: 0.16em; color: var(--text-light); font-family: Arial, Helvetica, sans-serif; }
.bb-doc h3 { margin: 14px 0 6px; font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--bb); }
.bb-doc p { margin: 0 0 12px; font-family: var(--serif); font-size: 13px; line-height: 1.55; color: var(--text-mid); }
.bb-doc-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 6px; background: var(--bb); color: var(--white); font-size: 13px; font-weight: 600; }
.bb-doc .bb-doc-foot { margin: 14px 0 0; padding-top: 8px; border-top: 1px solid var(--border); font-family: var(--serif); font-style: italic; font-size: 11.5px; color: var(--text-light); }
