/* /css/lg-rate-card.css
   The rate card (drawn by /scripts/lg-rate-card.js), shared by the buyer and lender dashboards.
   Put class "lgrc" on the element holding the cards for the desktop card (opens sideways, twice as
   wide, over the next card), or "lgrc-m" for the phone card (opens down). The block keeps its own
   grid layout (columns and gap). */

.lgrc, .lgrc-m { --bd-green:#2f9e44; --bd-green-d:#166534; --bd-green-l:#ebf8ee; --bd-ink:#14181f; --bd-muted:#5b6472; --bd-line:#e3e7ec; --bd-bg:#f5f7f9; --bd-blue:#1a56db;
    font-family:Poppins, sans-serif; color:var(--bd-ink); }
.lgrc *, .lgrc *::before, .lgrc *::after, .lgrc-m *, .lgrc-m *::before, .lgrc-m *::after { box-sizing:border-box; }
.lgrc button, .lgrc-m button { font-family:inherit; text-transform:none; letter-spacing:normal; }
.lgrc [hidden], .lgrc-m [hidden] { display:none !important; }
.lgrc .bd-card:focus-visible, .lgrc-m .bd-card:focus-visible { outline:3px solid var(--bd-blue); outline-offset:2px; }

/* ===== Desktop card (.lgrc) ===== */

.lgrc .bd-cell { position:relative; display:flex; }
.lgrc .bd-cell.bd-open { z-index:20; }
.lgrc .bd-card { position:relative; flex:1; display:flex; flex-direction:column; background:#fff; border:1px solid var(--bd-line); border-radius:18px; padding:16px 20px 18px; box-shadow:0 1px 3px rgba(0,0,0,.05); transition:box-shadow .2s; outline:none; }
/* Subscribers with Listing Highlight: same green as the cards on the full search page. */
.lgrc .bd-card.bd-highlight { background:linear-gradient(135deg, #E8F8E8 0%, #CDF3CD 100%); border-color:#a5d6a7; }
.lgrc .bd-sum { flex:1; display:flex; flex-direction:column; min-width:0; }
.lgrc .bd-more, .lgrc .bd-wide { display:none; min-width:0; }

/* Opened, the card becomes one box twice as wide (over the next card, to the right or to the
   left from the last column) and as tall as its details need. The summary keeps its place and
   size; the details fill the other half; a full-width strip runs along the bottom. The script
   pins the cell's height first, so the grid underneath never moves. */
.lgrc .bd-cell.bd-open .bd-card { position:absolute; top:0; width:calc(200% + var(--bd-gap, 22px)); min-height:100%; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); column-gap:calc(var(--bd-gap, 22px) + 40px); align-content:start; box-shadow:0 22px 50px rgba(20,24,31,.24); }
.lgrc .bd-cell.bd-open-right .bd-card { left:0; }
.lgrc .bd-cell.bd-open-left .bd-card { right:0; }
.lgrc .bd-cell.bd-open .bd-more, .lgrc .bd-cell.bd-open .bd-wide { display:block; }
.lgrc .bd-cell.bd-open-right .bd-sum { grid-column:1; grid-row:1; }
.lgrc .bd-cell.bd-open-right .bd-more { grid-column:2; grid-row:1; }
.lgrc .bd-cell.bd-open-left .bd-sum { grid-column:2; grid-row:1; }
.lgrc .bd-cell.bd-open-left .bd-more { grid-column:1; grid-row:1; }
.lgrc .bd-cell.bd-open .bd-wide { grid-column:1 / -1; grid-row:2; border-top:1px solid var(--bd-line); margin-top:16px; padding-top:14px; }
.lgrc .bd-cell.bd-open-down .bd-card { left:0; width:100%; grid-template-columns:minmax(0,1fr); }
.lgrc .bd-cell.bd-open-down .bd-sum { grid-column:1; grid-row:1; }
.lgrc .bd-cell.bd-open-down .bd-more { grid-column:1; grid-row:2; margin-top:16px; }
.lgrc .bd-cell.bd-open-down .bd-wide { grid-row:3; }

/* Card head: small logo top-left; badge, bookmark and the star score top-right. */
/* Logo, name and NMLS sit close together at the top of a block of fixed height (room for the
   large logo and a two-line name); what is left over falls below them, so the APR and
   everything under it line up across a row whatever the logo, badge or name length. */
.lgrc .bd-id { height:140px; margin-bottom:10px; overflow:hidden; }
.lgrc .bd-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; min-height:60px; margin-bottom:6px; }
.lgrc .bd-logo { flex:0 1 175px; display:flex; align-items:center; justify-content:flex-start; height:60px; min-width:0; }
.lgrc .bd-logo img { display:block; max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; object-position:left center; }
.lgrc .bd-logo.bd-logo-lg { flex-basis:200px; height:72px; }
.lgrc .bd-head-r { display:flex; flex-direction:column; align-items:flex-end; gap:6px; min-width:0; }
.lgrc .bd-flags { display:flex; flex-wrap:nowrap; justify-content:flex-end; align-items:center; gap:6px; }
/* The bookmark: a quiet grey icon on a soft, see-through white circle, so it still reads on the
   green Listing Highlight cards without pulling the eye. It turns blue on hover, and solid blue
   once bookmarked. */
.lgrc .bd-bookmark, .lgrc-m .bd-bookmark { flex:none; display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; padding:0; margin:0;
    border:0; border-radius:50%; background:rgba(255,255,255,.7); color:#8a939e; cursor:pointer; line-height:0;
    transition:color .15s, background .15s; }
.lgrc .bd-bookmark svg, .lgrc-m .bd-bookmark svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linejoin:round; }
.lgrc .bd-bookmark:hover, .lgrc-m .bd-bookmark:hover { color:var(--bd-blue); background:#fff; }
.lgrc .bd-bookmark:focus-visible, .lgrc-m .bd-bookmark:focus-visible { outline:3px solid var(--bd-blue); outline-offset:2px; }
.lgrc .bd-bookmark[aria-pressed="true"], .lgrc-m .bd-bookmark[aria-pressed="true"] { color:var(--bd-blue); }
.lgrc .bd-bookmark[aria-pressed="true"] svg, .lgrc-m .bd-bookmark[aria-pressed="true"] svg { fill:currentColor; }
.lgrc .bd-score { display:flex; align-items:center; gap:6px; min-height:20px; }
.lgrc .bd-stars { position:relative; display:inline-block; font-size:17px; line-height:1; letter-spacing:1px; color:#d6dbe1; white-space:nowrap; }
.lgrc .bd-stars::before { content:"★★★★★"; }
.lgrc .bd-stars::after { content:"★★★★★"; position:absolute; left:0; top:0; width:calc(var(--bd-score) / 5 * 100%); overflow:hidden; color:#f5a524; }
.lgrc .bd-score-num { font-size:13px; font-weight:600; color:var(--bd-muted); }
.lgrc .bd-badge { font-size:11px; font-weight:600; color:var(--bd-green-d); background:#fff; border:1px solid #bfe5c8; border-radius:999px; padding:3px 9px; white-space:nowrap; }
.lgrc .bd-badge-promo { color:#5b6472; border-color:var(--bd-line); }

.lgrc .bd-name { font-size:16px; font-weight:600; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.lgrc .bd-name a { color:var(--bd-ink); text-decoration:none; }
.lgrc .bd-name a:hover { text-decoration:underline; }
.lgrc .bd-verified { width:16px; height:16px; vertical-align:-2px; }
.lgrc .bd-nmls { font-size:12px; color:var(--bd-muted); margin-top:2px; }
.lgrc .bd-nmls a { color:inherit; text-decoration:underline dotted; }
.lgrc .bd-apr-label { font-size:13px; font-weight:500; color:var(--bd-muted); }
.lgrc .bd-apr { font-size:48px; font-weight:600; line-height:1.05; letter-spacing:-1px; }
/* Change since the lender's previous publication of the same rate: green down, red up
   (the Up/Down chart's colors), grey unchanged. Filled in after the cards draw. */
.lgrc .bd-apr { display:flex; align-items:center; flex-wrap:nowrap; gap:10px; }
.lgrc .bd-chg-slot:empty { display:none; }
.lgrc .bd-chg { display:inline-flex; flex-direction:column; justify-content:center; padding:4px 9px; border-radius:9px; letter-spacing:0; line-height:1.2; white-space:nowrap; cursor:default; }
.lgrc .bd-chg b { font-size:13px; font-weight:700; }
.lgrc .bd-chg small { font-size:11px; font-weight:500; opacity:.8; }
.lgrc .bd-chg-down { background:hsl(120,50%,94%); color:hsl(120,62%,28%); }
.lgrc .bd-chg-up { background:hsl(0,80%,96%); color:hsl(0,62%,40%); }
.lgrc .bd-chg-same { background:#f1f3f5; color:var(--bd-muted); }
.lgrc .bd-sr { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.lgrc .bd-type { font-size:13px; font-weight:500; color:var(--bd-muted); margin:4px 0 14px; }
.lgrc .bd-kv { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:6px; }
.lgrc .bd-kv > div { background:var(--bd-bg); border-radius:10px; padding:9px 12px; }
.lgrc .bd-card.bd-highlight .bd-kv > div { background:rgba(255,255,255,.75); }
.lgrc .bd-kv small, .lgrc .bd-pay small { display:block; font-size:12px; color:var(--bd-muted); }
.lgrc .bd-kv b { font-size:20px; font-weight:600; }
.lgrc .bd-kv > div:first-child b { font-size:26px; line-height:1.15; } /* the rate itself */
.lgrc .bd-kv em { font-style:normal; font-size:12px; color:var(--bd-muted); margin-left:6px; }
.lgrc .bd-kv .bd-credit { color:var(--bd-green-d); }
/* "Your rate ≈ 6.375%": the visitor's estimated rate under the published one, in the estimate's
   orange (lg-rate-card.js yourRateHtml). "No estimate" in grey where the LLPA matrix doesn't apply. */
.lgrc .bd-kv .bd-yours, .lgrc-m .bd-kv .bd-yours { display:block; margin-top:3px; font-size:12px; font-weight:600; line-height:1.3; color:#e65100; white-space:nowrap; cursor:help; }
.lgrc .bd-kv .bd-yours-v, .lgrc-m .bd-kv .bd-yours-v { font-size:16px; }
.lgrc .bd-kv .bd-yours-na, .lgrc-m .bd-kv .bd-yours-na { font-weight:400; color:var(--bd-muted); }
/* Phone cards are one per row, so the line may wrap: it exactly fills the box at 375px wide. */
.lgrc-m .bd-kv .bd-yours { white-space:normal; }
.lgrc .bd-fine { font-size:11px; line-height:1.35; color:var(--bd-muted); margin-bottom:10px; }
.lgrc .bd-pay { margin-top:auto; padding-top:4px; }
.lgrc .bd-pay b { font-size:28px; font-weight:600; }
.lgrc .bd-pay span { font-size:14px; color:var(--bd-muted); }
.lgrc .bd-pay .bd-fine { margin:2px 0 0; }

.lgrc .bd-more-title { font-size:14px; font-weight:600; margin:16px 0 4px; }
.lgrc .bd-narrative { font-size:13px; line-height:1.55; color:#39414d; margin:0; }
.lgrc .bd-lender-links { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.lgrc .bd-lender-link { font-size:13px; font-weight:600; border:2px solid var(--bd-green); color:var(--bd-green-d); border-radius:999px; padding:4px 12px; text-decoration:none; background:#fff; }
.lgrc .bd-actions { display:flex; gap:8px; align-items:stretch; }
.lgrc .bd-actions > * { flex:1; }
.lgrc .bd-btn { display:flex; align-items:center; justify-content:center; text-align:center; border-radius:10px; padding:11px; font-size:15px; font-weight:600; text-decoration:none; border:2px solid var(--bd-ink); color:var(--bd-ink); background:#fff; }
.lgrc .bd-btn-primary { background:#fff; border-color:var(--bd-green); color:var(--bd-green-d); }
.lgrc .bd-btn-primary:hover { background:hsl(120,50%,94%); border-color:var(--bd-green-d); color:var(--bd-green-d); }
/* Three buttons share one row; the labels wrap onto two lines instead. Each button is at
   least as wide as its longest word, so no label breaks into three lines. */
.lgrc .bd-actions { gap:6px; }
.lgrc .bd-actions > * { flex:1 1 auto; min-width:min-content; }
.lgrc .bd-actions .bd-btn { padding:8px 4px; font-size:13px; line-height:1.2; }
.lgrc .bd-btn-dash:hover { background:#f1f3f5; color:var(--bd-ink); text-decoration:none; }
/* The owner's Stop Display button (lg-rate-card.js adds it for the owner only), and a stopped card. */
.lgrc .bd-owner { margin-top:8px; }
.lgrc .bd-btn-stop { width:100%; padding:8px 4px; font-size:13px; line-height:1.2; border-color:#c92a2a; color:#c92a2a; cursor:pointer; font-family:inherit; }
.lgrc .bd-btn-stop:hover { background:#fff5f5; }
.lgrc .bd-btn-stop:disabled { cursor:default; opacity:.7; }
.lgrc .bd-cell.bd-stopped .bd-card { opacity:.55; }
.lgrc .bd-estimate .estimate-rate-wrapper { margin:0; height:100%; }
.lgrc .bd-estimate .estimate-rate-btn { width:100%; height:100%; border:2px solid #e65100; border-radius:10px; padding:8px 4px; font-size:13px; line-height:1.2; white-space:normal; text-align:center; color:#e65100; background:#fff; }
.lgrc .bd-estimate .estimate-rate-btn:hover { background:#fff3e8; text-decoration:none; }
/* An unopened estimate popup still lives inside the card; keep it out of the layout. The
   estimator moves it to the page body when it opens. */
.lgrc .bd-card .estimate-modal:not(.show) { display:none; }

.lgrc .bd-source { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.lgrc .bd-src-btn { display:inline-flex; align-items:center; border:2px solid var(--bd-green); color:var(--bd-green-d); background:#fff; border-radius:999px; padding:6px 14px; font-size:13px; font-weight:600; cursor:pointer; text-decoration:none; }
.lgrc .bd-src-btn:hover { background:var(--bd-green); color:#fff; }
.lgrc .bd-src-panel { margin-bottom:12px; }
.lgrc .bd-src-panel img { display:block; width:100%; height:auto; border:1px solid var(--bd-line); border-radius:8px; cursor:zoom-in; }
.lgrc .bd-src-status { font-size:13px; color:var(--bd-muted); padding:8px 0; }
.lgrc .bd-about-title { font-size:14px; font-weight:600; }
.lgrc .bd-about-hq { font-size:12px; color:var(--bd-muted); margin:2px 0 6px; }
.lgrc .bd-about-hq:empty { display:none; }

/* Full-screen source-page viewer (added to the page body by the script). */
.bd-lightbox { position:fixed; inset:0; z-index:100000; display:none; overflow:auto; background:rgba(0,0,0,.9); padding:52px 16px 24px; box-sizing:border-box; }
.bd-lightbox.open { display:block; }
.bd-lightbox img { display:block; margin:0 auto; max-width:100%; height:auto; background:#fff; border-radius:4px; }
.bd-lightbox-close { position:fixed; top:8px; right:18px; z-index:1; font-size:34px; line-height:1; color:#fff; background:none; border:none; cursor:pointer; padding:4px 10px; }
.bd-lightbox-hint { position:fixed; top:18px; left:18px; color:#ccc; font-size:13px; font-family:Poppins, sans-serif; }

/* ===== Phone card (.lgrc-m) ===== */
.lgrc-m .bd-card { background:#fff; border:1px solid var(--bd-line); border-radius:18px; padding:14px 16px 16px; box-shadow:0 1px 3px rgba(0,0,0,.05); outline:none; cursor:pointer; }
/* Subscribers with Listing Highlight: same green as the cards on the full search page. */
.lgrc-m .bd-card.bd-highlight { background:linear-gradient(135deg, #E8F8E8 0%, #CDF3CD 100%); border-color:#a5d6a7; }
.lgrc-m .bd-cell.bd-open .bd-card { box-shadow:0 10px 28px rgba(20,24,31,.16); }
.lgrc-m .bd-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; min-height:46px; margin-bottom:8px; }
.lgrc-m .bd-logo { flex:0 1 120px; display:flex; align-items:center; justify-content:flex-start; height:46px; min-width:0; }
.lgrc-m .bd-logo img { display:block; max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; object-position:left center; }
.lgrc-m .bd-logo.bd-logo-lg { flex-basis:150px; height:56px; }
.lgrc-m .bd-head-r { display:flex; flex-direction:column; align-items:flex-end; gap:6px; min-width:0; }
.lgrc-m .bd-flags { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:6px; }
.lgrc-m .bd-score { display:flex; align-items:center; gap:6px; min-height:20px; }
.lgrc-m .bd-stars { position:relative; display:inline-block; font-size:17px; line-height:1; letter-spacing:1px; color:#d6dbe1; white-space:nowrap; }
.lgrc-m .bd-stars::before { content:"★★★★★"; }
.lgrc-m .bd-stars::after { content:"★★★★★"; position:absolute; left:0; top:0; width:calc(var(--bd-score) / 5 * 100%); overflow:hidden; color:#f5a524; }
.lgrc-m .bd-score-num { font-size:13px; font-weight:600; color:var(--bd-muted); }
.lgrc-m .bd-badge { font-size:11px; font-weight:600; color:var(--bd-green-d); background:#fff; border:1px solid #bfe5c8; border-radius:999px; padding:3px 9px; white-space:nowrap; }
.lgrc-m .bd-badge-promo { color:#5b6472; border-color:var(--bd-line); }
.lgrc-m .bd-name { font-size:16px; font-weight:600; line-height:1.3; }
.lgrc-m .bd-name a { color:var(--bd-ink); text-decoration:none; }
.lgrc-m .bd-verified { width:16px; height:16px; vertical-align:-2px; }
.lgrc-m .bd-nmls { font-size:12px; color:var(--bd-muted); margin-bottom:10px; }
.lgrc-m .bd-nmls a { color:inherit; text-decoration:underline dotted; }
.lgrc-m .bd-apr-label { font-size:13px; font-weight:500; color:var(--bd-muted); }
.lgrc-m .bd-apr { font-size:46px; font-weight:600; line-height:1.05; letter-spacing:-1px; }
/* Change since the lender's previous publication of the same rate: green down, red up
   (the Up/Down chart's colors), grey unchanged. Filled in after the cards draw. */
.lgrc-m .bd-apr { display:flex; align-items:center; flex-wrap:nowrap; gap:10px; }
.lgrc-m .bd-chg-slot:empty { display:none; }
.lgrc-m .bd-chg { display:inline-flex; flex-direction:column; justify-content:center; padding:4px 9px; border-radius:9px; letter-spacing:0; line-height:1.2; white-space:nowrap; cursor:default; }
.lgrc-m .bd-chg b { font-size:13px; font-weight:700; }
.lgrc-m .bd-chg small { font-size:11px; font-weight:500; opacity:.8; }
.lgrc-m .bd-chg-down { background:hsl(120,50%,94%); color:hsl(120,62%,28%); }
.lgrc-m .bd-chg-up { background:hsl(0,80%,96%); color:hsl(0,62%,40%); }
.lgrc-m .bd-chg-same { background:#f1f3f5; color:var(--bd-muted); }
.lgrc-m .bd-sr { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.lgrc-m .bd-type { font-size:13px; font-weight:500; color:var(--bd-muted); margin:4px 0 12px; }
.lgrc-m .bd-kv { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:6px; }
.lgrc-m .bd-kv > div { background:var(--bd-bg); border-radius:10px; padding:8px 10px; }
.lgrc-m .bd-card.bd-highlight .bd-kv > div { background:rgba(255,255,255,.75); }
.lgrc-m .bd-kv small, .lgrc-m .bd-pay small { display:block; font-size:12px; color:var(--bd-muted); }
.lgrc-m .bd-kv b { font-size:19px; font-weight:600; }
.lgrc-m .bd-kv > div:first-child b { font-size:25px; line-height:1.15; } /* the rate itself */
.lgrc-m .bd-kv em { font-style:normal; font-size:12px; color:var(--bd-muted); margin-left:6px; }
.lgrc-m .bd-kv .bd-credit { color:var(--bd-green-d); }
.lgrc-m .bd-fine { font-size:11px; line-height:1.35; color:var(--bd-muted); margin-bottom:10px; }
.lgrc-m .bd-pay b { font-size:26px; font-weight:600; }
.lgrc-m .bd-pay span { font-size:14px; color:var(--bd-muted); }
.lgrc-m .bd-pay .bd-fine { margin:2px 0 0; }
.lgrc-m .bd-pay::after { content:"Tap for details ▾"; display:block; text-align:center; font-size:12px; color:var(--bd-blue); margin-top:8px; }
.lgrc-m .bd-cell.bd-open .bd-pay::after { content:"Tap to close ▴"; }

.lgrc-m .bd-more, .lgrc-m .bd-wide { display:none; cursor:default; }
.lgrc-m .bd-cell.bd-open .bd-more, .lgrc-m .bd-cell.bd-open .bd-wide { display:block; }
.lgrc-m .bd-more { border-top:1px solid var(--bd-line); margin-top:12px; padding-top:14px; }
.lgrc-m .bd-wide { border-top:1px solid var(--bd-line); margin-top:14px; padding-top:12px; }
.lgrc-m .bd-more-title { font-size:14px; font-weight:600; margin:16px 0 4px; }
.lgrc-m .bd-narrative { font-size:13px; line-height:1.55; color:#39414d; margin:0; }
.lgrc-m .bd-lender-links { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.lgrc-m .bd-lender-link { font-size:14px; font-weight:600; border:2px solid var(--bd-green); color:var(--bd-green-d); border-radius:999px; padding:6px 14px; text-decoration:none; background:#fff; }
.lgrc-m .bd-actions { display:flex; flex-direction:column; gap:8px; }
.lgrc-m .bd-btn { display:block; text-align:center; border-radius:12px; padding:13px; font-size:16px; font-weight:600; text-decoration:none; border:2px solid var(--bd-ink); color:var(--bd-ink); background:#fff; }
.lgrc-m .bd-btn-primary { background:#fff; border-color:var(--bd-green); color:var(--bd-green-d); }
.lgrc-m .bd-estimate .estimate-rate-wrapper { margin:0; }
.lgrc-m .bd-card .estimate-modal:not(.show) { display:none; }
.lgrc-m .bd-estimate .estimate-rate-btn { width:100%; border:2px solid #e65100; border-radius:12px; padding:13px; font-size:16px; font-weight:600; text-align:center; color:#e65100; background:#fff; }
.lgrc-m .bd-source { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.lgrc-m .bd-src-btn { display:block; text-align:center; border:2px solid var(--bd-green); color:var(--bd-green-d); background:#fff; border-radius:12px; padding:10px 14px; font-size:14px; font-weight:600; cursor:pointer; text-decoration:none; }
.lgrc-m .bd-src-panel { margin-bottom:12px; }
.lgrc-m .bd-src-panel img { display:block; width:100%; height:auto; border:1px solid var(--bd-line); border-radius:8px; }
.lgrc-m .bd-src-status { font-size:13px; color:var(--bd-muted); padding:8px 0; }
.lgrc-m .bd-about-title { font-size:14px; font-weight:600; }
.lgrc-m .bd-about-hq { font-size:12px; color:var(--bd-muted); margin:2px 0 6px; }
.lgrc-m .bd-about-hq:empty { display:none; }


/* The source-page viewer on a phone: closer to the edges. */
@media (max-width: 767px) {
    .bd-lightbox { position:fixed; inset:0; z-index:100000; display:none; overflow:auto; background:rgba(0,0,0,.9); padding:52px 10px 24px; box-sizing:border-box; }
    .bd-lightbox.open { display:block; }
    .bd-lightbox img { display:block; margin:0 auto; max-width:100%; height:auto; background:#fff; border-radius:4px; }
    .bd-lightbox-close { position:fixed; top:8px; right:12px; z-index:1; font-size:34px; line-height:1; color:#fff; background:none; border:none; cursor:pointer; padding:4px 10px; }
    .bd-lightbox-hint { position:fixed; top:18px; left:14px; color:#ccc; font-size:13px; font-family:Poppins, sans-serif; }
}

/* Estimate-my-rate modal (built by /scripts/llpa-estimator.js; moved to the page body when opened).
   Same rules as MRRatesSearch, so it looks identical on pages without that block. */
.estimate-modal { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%) scale(.95); background:#fff; border:1px solid #ddd; border-radius:10px; box-shadow:0 8px 32px rgba(0,0,0,.25); width:490px; max-width:90vw; max-height:80vh; overflow-y:auto; z-index:10001; opacity:0; visibility:hidden; transition:opacity .2s ease, transform .2s ease, visibility .2s; font-family:Poppins, sans-serif; }
.estimate-modal.show { opacity:1 !important; visibility:visible !important; transform:translate(-50%,-50%) scale(1) !important; display:block !important; }
.estimate-modal-content { padding:18px; position:relative; }
.estimate-close-btn { position:absolute; top:8px; right:10px; background:transparent; border:none; font-size:24px; color:#999; cursor:pointer; width:28px; height:28px; display:flex; align-items:center; justify-content:center; border-radius:50%; z-index:10; }
.estimate-close-btn:hover { color:#333; background:#f0f0f0; }
.estimate-modal.expanded .estimate-initial-text { display:none; }
.estimate-initial-text p { margin:0 0 12px; font-size:15px; line-height:1.5; color:#333; padding-right:20px; }
.estimate-expand-btn { display:block; width:100%; margin:12px 0; background:linear-gradient(135deg,#ff6d00,#ff8f00) !important; color:#fff !important; border:none !important; border-radius:6px !important; padding:10px 20px !important; font-size:16px !important; font-weight:600 !important; cursor:pointer; }
.estimate-inputs { display:none; }
.estimate-modal.expanded .estimate-inputs { display:block; }
.estimate-field { margin-bottom:14px; }
.estimate-field label { display:block; font-size:15px; font-weight:600; color:#444; margin-bottom:6px; }
.estimate-field select { width:100%; padding:10px 12px; font-size:16px; border:1px solid #ccc; border-radius:6px; background:#fff; cursor:pointer; }
.estimate-result { display:flex; gap:20px; background:#f7f7f7; border:1px solid #e0e0e0; border-radius:8px; padding:16px; margin:16px 0; }
.estimate-result-col { flex:1; text-align:center; }
.estimate-result-label { font-size:14px; color:#666; text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px; }
.estimate-published-rate { font-size:32px; font-weight:700; color:#333; line-height:1.2; }
.estimate-rate-value { font-size:32px; font-weight:700; color:#e65100; line-height:1.2; }
.estimate-ltv-note { font-size:15px; color:#555; background:#f0f4f8; padding:10px 12px; border-radius:6px; margin-bottom:14px; }
.estimate-disclaimer { font-size:13px; color:#777; line-height:1.5; margin-top:12px; padding-top:12px; border-top:1px solid #eee; }
.estimate-disclaimer a { color:#1976d2; text-decoration:none; }

/* The same popup on a phone. */
@media (max-width: 767px) {
    .estimate-modal { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%) scale(.95); background:#fff; border:1px solid #ddd; border-radius:10px; box-shadow:0 8px 32px rgba(0,0,0,.25); width:420px; max-width:92vw; max-height:84vh; overflow-y:auto; z-index:10001; opacity:0; visibility:hidden; transition:opacity .2s ease, transform .2s ease, visibility .2s; font-family:Poppins, sans-serif; }
    .estimate-modal.show { opacity:1 !important; visibility:visible !important; transform:translate(-50%,-50%) scale(1) !important; display:block !important; }
    .estimate-modal-content { padding:18px; position:relative; }
    .estimate-close-btn { position:absolute; top:8px; right:10px; background:transparent; border:none; font-size:26px; color:#999; cursor:pointer; width:32px; height:32px; display:flex; align-items:center; justify-content:center; border-radius:50%; z-index:10; }
    .estimate-modal.expanded .estimate-initial-text { display:none; }
    .estimate-initial-text p { margin:0 0 12px; font-size:15px; line-height:1.5; color:#333; padding-right:24px; }
    .estimate-expand-btn { display:block; width:100%; margin:12px 0; background:linear-gradient(135deg,#ff6d00,#ff8f00) !important; color:#fff !important; border:none !important; border-radius:8px !important; padding:12px 20px !important; font-size:16px !important; font-weight:600 !important; cursor:pointer; }
    .estimate-inputs { display:none; }
    .estimate-modal.expanded .estimate-inputs { display:block; }
    .estimate-field { margin-bottom:14px; }
    .estimate-field label { display:block; font-size:15px; font-weight:600; color:#444; margin-bottom:6px; }
    .estimate-field select { width:100%; padding:12px; font-size:16px; border:1px solid #ccc; border-radius:8px; background:#fff; }
    .estimate-result { display:flex; gap:14px; background:#f7f7f7; border:1px solid #e0e0e0; border-radius:8px; padding:14px; margin:14px 0; }
    .estimate-result-col { flex:1; text-align:center; }
    .estimate-result-label { font-size:12px; color:#666; text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px; }
    .estimate-published-rate { font-size:26px; font-weight:700; color:#333; line-height:1.2; }
    .estimate-rate-value { font-size:26px; font-weight:700; color:#e65100; line-height:1.2; }
    .estimate-ltv-note { font-size:14px; color:#555; background:#f0f4f8; padding:10px 12px; border-radius:6px; margin-bottom:14px; }
    .estimate-disclaimer { font-size:12px; color:#777; line-height:1.5; margin-top:12px; padding-top:12px; border-top:1px solid #eee; }
    .estimate-disclaimer a { color:#1976d2; text-decoration:none; }
}

/* ===== "Compare Your Rates" pill =====
   On its own row just above a block's rate cards, left-aligned (buyer dashboard, Power Search); shown by lg-rate-card.js once the
   member has two or more rates bookmarked; links to Compare Rates. Same blue as the bookmark. */
.rc-compare { display:flex; width:fit-content; margin:0 0 14px; align-items:center; gap:8px; height:36px; padding:0 8px 0 14px; border-radius:999px; background:#1a56db; color:#fff !important;
    font:600 15px/1 Poppins, sans-serif; text-decoration:none !important; white-space:nowrap; box-shadow:0 4px 12px rgba(26,86,219,.25); transition:background .15s, transform .15s; }
.rc-compare[hidden] { display:none !important; }
/* The pill with its round x (clear all bookmarked rates) beside it, as on the lender dashboard. */
.rc-compare-wrap { display:flex; align-items:flex-start; gap:10px; }
.rc-compare-clear { display:inline-flex; align-items:center; justify-content:center; flex:none; width:30px; height:30px; margin-top:3px; padding:0; border:1px solid #e3e7ec; border-radius:999px;
    background:#fff; color:#5b6472; font:400 20px/1 Poppins, sans-serif; cursor:pointer; transition:color .15s, border-color .15s, background .15s; }
.rc-compare-clear[hidden] { display:none !important; }
.rc-compare-clear:hover { color:#c0392b; border-color:#e3a9a1; background:#fff5f4; }
.rc-compare-clear:focus-visible { outline:3px solid #1a56db; outline-offset:2px; }
.rc-compare:hover { background:#1747b8; transform:translateY(-1px); }
.rc-compare:focus-visible { outline:3px solid #1a56db; outline-offset:3px; }
.rc-compare svg { width:16px; height:16px; fill:currentColor; flex:none; }
.rc-compare .rc-compare-n { display:inline-flex; align-items:center; justify-content:center; min-width:22px; height:22px; padding:0 6px; border-radius:999px;
    background:#fff; color:#1a56db; font-size:13px; font-weight:700; }
