/* qa-t180u: sitewide QA fixes (preview build t180u). Loaded last on every page.
   Source of truth: tools/_t180u/qa-t180u.css -> public/assets/qa-t180u.<hash>.css (tools/fix_t180u_qa.py). */

/* ---------- Skip link (keyboard users) ---------- */
.skip-link{position:absolute;left:12px;top:-120px;z-index:2000;background:#fff;color:var(--navy);padding:12px 18px;border-radius:10px;font-family:var(--f-display);font-weight:700;font-size:15px;text-decoration:none;box-shadow:0 6px 22px #1838503d}
.skip-link:focus,.skip-link:focus-visible{top:10px;outline:3px solid var(--cyan);outline-offset:2px}

/* ---------- In-page anchors land below the sticky header ---------- */
[id]{scroll-margin-top:96px}
@media(max-width:1199px){[id]{scroll-margin-top:84px}}

/* ---------- Program cards: values were white on white (Non-QM on /loan-programs/) ---------- */
.prog{color:var(--ink)}
.prog dd{color:var(--navy)}
.prog dt{color:var(--slate)}

/* ---------- Program-page prose: nested <section> picked up the 100px section padding ---------- */
.prose section,.prose.legal section{padding:0;margin:0;border:0;background:none;min-height:0}
.prose section > h2:first-child{margin-top:44px}
.prose > dl.speclist + section > h2:first-child{margin-top:28px}
.split > .prose{max-width:none}
/* Prose inside .legal inherited the footer's pale legal colour (#9fb6c6): FAQ questions looked disabled */
.prose.legal{color:var(--ink-soft)}
.prose.legal summary,.prose.legal details summary,.faq-list summary{color:var(--navy)}
.prose.legal h2,.prose.legal h3{color:var(--navy)}
@media(min-width:1024px){
  .split > .rail{position:sticky;top:92px;align-self:start}
}
@media(min-width:1024px) and (max-height:820px){
  .split > .rail{position:static}
}
.lp-cta{display:none}
@media(max-width:1023px){
  .lp-cta{display:block;margin:6px 0 26px;padding:18px 18px 16px;background:var(--wash);border:1px solid var(--border);border-radius:14px}
  .lp-cta h2,.lp-cta .lp-cta-h{font-family:var(--f-display);font-size:19px;line-height:1.25;margin:0 0 6px;color:var(--navy);letter-spacing:-.01em}
  .lp-cta p{margin:0 0 12px;font-size:15px;color:var(--ink-soft)}
  .lp-cta .lp-cta-acts{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
  .lp-cta .lp-cta-acts a.btn{min-height:48px;display:inline-flex;align-items:center}
  .lp-cta .lp-cta-acts a.lp-call{color:var(--navy);font-weight:700;min-height:44px;display:inline-flex;align-items:center}
}

/* ---------- Pagehead uses the same content edge as the page body ---------- */
.pagehead .wrap{max-width:1180px}
.pagehead h1{max-width:22ch}
.pagehead p,.pagehead .answer{max-width:68ch}
/* Narrow single-column bodies (legal, short pages) keep their column, aligned to the same left edge */
main > section > .wrap.prose[style*="max-width:760px"],
main > section > .wrap.prose[style*="max-width: 760px"]{margin-left:max(0px,calc((100% - 1180px) / 2))}
.process .sec-head,.sec-head{margin-left:0}
.process .sec-head{max-width:64ch;margin-right:auto}

/* ---------- Reviewed-by line is its own line, never inside the paragraph flow ---------- */
.reviewed-by{display:block;clear:both;margin:14px 0 18px;font-size:13.5px;line-height:1.5}
.pagehead .reviewed-by{margin:16px 0 0;padding-top:12px;border-top:1px solid #18385021;max-width:68ch}

/* ---------- State-page hero: copy sits on a readable panel, photo kept clear of the text ---------- */
.state-head.has-photo{display:block;min-height:0;background:var(--wash)}
.state-head.has-photo .state-scrim{display:none}
.state-head.has-photo .state-bg{object-position:72% 40%}
.state-head.has-photo .wrap{position:relative;z-index:2;padding-top:clamp(36px,4.5vw,60px);padding-bottom:clamp(36px,4.5vw,60px)}
.state-head.has-photo .state-panel{background:#fffffff5;border:1px solid #dbe9f2;border-radius:18px;box-shadow:0 18px 44px #1838502e;padding:clamp(22px,2.6vw,34px);max-width:640px}
.state-head.has-photo .state-panel p{max-width:none}
.state-head.has-photo .state-panel h1{max-width:18ch}
@media(min-width:1024px){
  .state-head.has-photo .state-bg{left:auto;right:0;width:62%;object-position:62% 38%}
  .state-head.has-photo:after{content:"";position:absolute;top:0;bottom:0;left:0;width:46%;background:linear-gradient(90deg,var(--wash) 72%,#f4fafd00);z-index:1;pointer-events:none}
}
@media(max-width:1023px){
  .state-head.has-photo .state-bg{position:relative;inset:auto;display:block;width:100%;height:clamp(150px,34vw,260px);object-position:70% 34%}
  .state-head.has-photo .wrap{padding-top:0;margin-top:-34px}
  .state-head.has-photo .state-panel{max-width:none}
}
@media(max-width:900px){
  .state-head.has-photo .state-bg{height:132px}
  .state-head.has-photo .wrap{margin-top:-22px;padding-bottom:14px}
  .state-head.has-photo .state-panel{padding:16px 16px 14px;border-radius:14px}
}

/* ---------- Link rows: no empty tinted cells at the end of a row ---------- */
.state-list,.county-grid{gap:10px;background:none;border:0;border-radius:0;overflow:visible}
.state-list li,.county-grid li{background:#fff;border:1px solid var(--border);border-radius:10px;overflow:hidden}
.county-grid a{min-height:44px;display:flex;align-items:center}

/* ---------- County pages: spacing after the form; "by the numbers" readable on phones ---------- */
.leadform + h2,.leadform + .prose,.wrap > .leadform{margin-bottom:28px}
.prose .leadform{margin-bottom:34px}
@media(max-width:600px){
  .speclist .r{grid-template-columns:1fr;gap:4px}
  .speclist dd{text-align:left}
  .speclist.bythe dd,.speclist dd{font-size:14px;line-height:1.5;word-break:normal;overflow-wrap:anywhere}
}

/* ---------- Lead form on phones: intro wraps, fields stack, no clipped selects ---------- */
.lf-intro-sm{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;line-height:1.4!important}
.lf-row{align-items:end}
.lf-row > label{display:flex;flex-direction:column;justify-content:flex-end;min-width:0}
@media(max-width:480px){
  .leadform .lf-row,.lf .lf-row,.cm-form .lf-row,form .lf-row{grid-template-columns:minmax(0,1fr)!important}
  .hero2 .lf fieldset[data-step="1"] .lf-row[data-show="Purchase"]{grid-template-columns:minmax(0,1fr)!important}
}
.lf select{text-overflow:ellipsis}

/* ---------- Realtor hub: second hero action visible on navy ---------- */
.rh-hero .rh-text-link{display:inline-flex;align-items:center;min-height:48px;padding:12px 22px;border:1.5px solid #ffffffb3;border-radius:999px;color:#fff;font-family:var(--f-display);font-weight:700;font-size:15.5px;text-decoration:none;background:transparent}
.rh-hero .rh-text-link:hover,.rh-hero .rh-text-link:focus-visible{background:#ffffff1a;color:#fff;border-color:#fff}
.rh-ico svg{width:28px;height:28px;stroke:var(--cyan-ink);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;display:block}

/* ---------- Commercial breadcrumb on the navy hero ---------- */
.cm-hero .crumb,.hero.cm-hero .crumb,section.hero .crumb{color:#c9d6e0}
.cm-hero .crumb a,.hero.cm-hero .crumb a,section.hero .crumb a{color:#cfe6f3}

/* ---------- Footer: tap targets, Equal Housing mark ---------- */
footer .eho .ehl-foot{width:30px;height:auto;flex:none;display:block}
@media(max-width:900px){
  footer .fgrid li{margin-bottom:0}
  footer .fgrid ul a{display:inline-flex;align-items:center;min-height:44px}
  footer .f-states{gap:8px}
  footer .f-states a{min-width:44px;min-height:44px}
  footer .fphone a,footer .flogo{display:inline-flex;align-items:center;min-height:44px}
  footer .legal a{display:inline-flex;align-items:center;min-height:44px}
  footer .f-lang a{display:inline-flex;align-items:center;min-height:44px}
}

/* ---------- Phone tap targets in content ---------- */
@media(max-width:900px){
  main details > summary{min-height:44px;display:flex;align-items:center;padding-top:10px;padding-bottom:10px}
  .rail a,.rail .rail-call a{display:inline-flex;align-items:center;min-height:44px}
  .lf label:has(input[type=checkbox]),.lf .lf-consent{min-height:44px}
  .lf input[type=checkbox]{width:22px;height:22px;min-height:22px}
}

/* ---------- Mobile drawer backdrop ---------- */
@media(max-width:1199px){
  body:has(#mainnav.open)::after{content:"";position:fixed;inset:0;background:#18385059;z-index:40;pointer-events:none}
  header.mh{z-index:1000}
}

/* ---------- Translated headers (RU/UK/ES): no overlap at desktop, Menu button never clipped ---------- */
@media(min-width:1200px) and (max-width:1599px){
  html:not([lang|=en]) header.mh .mh-row .mh-tel small{display:none}
  html:not([lang|=en]) header.mh .mh-row nav>ul{gap:10px}
  html:not([lang|=en]) header.mh .mh-row nav a,
  html:not([lang|=en]) header.mh .mh-row nav .mh-parent{font-size:14px}
  html:not([lang|=en]) header.mh .mh-row .mh-realtors{font-size:13px;padding:8px 4px}
  html:not([lang|=en]) header.mh .mh-row{gap:10px 12px}
}
@media(min-width:1200px) and (max-width:1319px){
  html:not([lang|=en]) header.mh .mh-row nav a,
  html:not([lang|=en]) header.mh .mh-row nav .mh-parent{font-size:13px}
  html:not([lang|=en]) header.mh .mh-row nav>ul{gap:8px}
  html:not([lang|=en]) header.mh .mh-row .mh-caret{width:20px}
  html:not([lang|=en]) header.mh .mh-row .mh-tel{font-size:14px;padding:8px 4px}
  html:not([lang|=en]) header.mh .mh-apply{padding:9px 13px;font-size:13.5px}
}
@media(max-width:480px){
  html:not([lang|=en]) header.mh .mh-row{gap:8px}
  html:not([lang|=en]) header.mh .mh-row .mh-realtors{white-space:normal;max-width:96px;line-height:1.15;font-size:12.5px;text-align:center;padding:4px 2px}
  html:not([lang|=en]) header.mh .menu-toggle{padding:10px 12px;flex:none}
  html:not([lang|=en]) header.mh .mh-logo img{max-width:44vw;height:auto}
}

/* ---------- Thank-you page: no "apply again" band ---------- */
.ty-next{margin:0}

/* ---------- Team photos: never upscale small sources ---------- */
.lohero .lo-photo img,.lo-hero-photo img{max-width:100%;height:auto}

/* ---------- Refinance: section head sits on the content edge; balanced program grid ---------- */
.programs.programs-4{grid-template-columns:repeat(2,1fr)}
@media(max-width:600px){.programs.programs-4{grid-template-columns:1fr}}

/* ---------- DSCR investor form: hint on its own line, normal case ---------- */
.lf label .lf-hint,.cm-form label small,.lf label small{display:block;margin-top:3px;text-transform:none;letter-spacing:0;font-weight:500;font-size:13px;color:var(--slate)}
.lf textarea{min-height:120px;width:100%}

/* ---------- Translated pages: visible language switch at the top ---------- */
.lang-strip{background:var(--wash);border-bottom:1px solid var(--border);font-family:var(--f-display);font-size:13.5px}
.lang-strip .wrap{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:0 18px;padding-top:2px;padding-bottom:2px}
.lang-strip a,.lang-strip span{display:inline-flex;align-items:center;min-height:40px;font-weight:700;text-decoration:none}
.lang-strip a{color:var(--cyan-ink)}
.lang-strip a:hover{text-decoration:underline}
.lang-strip span[aria-current]{color:var(--navy)}
@media(max-width:900px){.lang-strip a,.lang-strip span{min-height:44px}.lang-strip .wrap{justify-content:flex-start;gap:0 16px}}

/* ---------- ".legal" is also the footer class: in page bodies keep the wrap's side padding ---------- */
main .wrap.legal{padding-left:var(--gut);padding-right:var(--gut);border-top:0}
main .legal{border-top:0}
section.sec-tight{padding-top:0}

/* ---------- State hero panel: paragraph rhythm; CTA visible on phones (form is further down) ---------- */
.state-head.has-photo .state-panel p + p{margin-top:12px}
@media(max-width:900px){
  .state-head.has-photo .state-panel p{font-size:15px;line-height:1.5}
  .state-head.has-photo .hero-cta{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px!important}
  .state-head.has-photo .hero-cta .btn{min-height:48px;display:inline-flex;align-items:center}
}
.prognav + section,.prognav + section > .wrap.split{padding-top:0}
.prognav + section .split > .prose{padding-top:32px}
.prognav + section .split > .rail{margin-top:32px}

/* ---------- One content edge per page: narrow single-column wraps start at the same left edge ---------- */
main section > .wrap[style*="max-width"],
main .faqhub > .wrap{margin-left:max(0px,calc((100% - 1180px) / 2));margin-right:auto}
main section.hero.pt-hero > .wrap{max-width:1180px}
/* "by the numbers" lists with long sourced values: label column wide enough, values left-aligned */
.speclist.bythe .r{grid-template-columns:minmax(11em,32%) minmax(0,1fr);gap:6px 18px}
.speclist.bythe dd{text-align:left}
@media(max-width:600px){.speclist.bythe .r{grid-template-columns:1fr}}
@media(max-width:900px){
  .prognav a{display:inline-flex;align-items:center;min-height:44px}
  .rh-link,.rh-bigtel,.lo-more,.rh-favbtn,.lo-contact a,.lohero-contact a,.lohero-social a,.team-contact a{display:inline-flex;align-items:center;min-height:44px}
  .rail li a,.rail ul a{display:inline-flex;align-items:center;min-height:44px}
}
.lp-cta.lp-cta-top{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px;margin:28px 0 0;padding:18px 22px;background:var(--wash);border:1px solid var(--border);border-radius:14px}
.lp-cta-top .lp-cta-h{font-family:var(--f-display);font-size:19px;margin:0;color:var(--navy)}
.lp-cta-top p{margin:0;color:var(--ink-soft);font-size:15px;flex:1 1 300px}
.lp-cta-top .lp-cta-acts{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-left:auto}
.lp-cta-top .lp-cta-acts a.btn{min-height:48px;display:inline-flex;align-items:center}
.lp-cta-top .lp-cta-acts a.lp-call{color:var(--navy);font-weight:700;min-height:44px;display:inline-flex;align-items:center}
/* 4-card program grids: 2 x 2 instead of 3 + 1 lone card */
@media(min-width:961px){.programs:has(> .prog:nth-child(4):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}}

/* section-head intro paragraph starts at the heading edge, not centred under it */
main .sec-head{margin-left:0;margin-right:0}
main .sec-head > p{margin-left:0!important;margin-right:0!important}

/* ---------- Phones/tablets: 44px tap targets for stand-alone links and controls ---------- */
@media(max-width:900px){
  .fgrid a,.rail a,.prognav a,.official li>a,main section>ul>li>a,.ca-list a,main td>a,.hp-links a,.lo-bd h3 a,
  .rh-mlo-bd h2 a,.rh-mcontact a,.rh-mlo-acts a,.faq-group-links a,.faq-pills button,.faq-share a,.legal-toc a,
  .pick-c h3 a,.lend-grid a,main .crumb a,.home-more a,.ca-person h3 a,.rh-ophone,.lang-strip a,.sec-head p>a:last-child:not(:first-child),
  main .btn{display:inline-flex;align-items:center;min-height:44px;min-width:44px}
  .lend-grid ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px}
  .hero2-stats a{display:inline-block;padding:13px 0;margin:-13px 0}
  .lend-grid li,.official li,.ca-list li{margin-top:0;margin-bottom:0}
}
@media(max-width:900px){
  #lo-search{min-height:44px}
  .rh-steve h3 a,.rh-olead strong a,.truststrip a,.speclist dd>a:only-child{display:inline-flex;align-items:center;min-height:44px}
  label.consent,label.rh-check,.lf-consent label{min-height:44px}
}

/* FAQ section nested in program prose: no tinted strip above the heading */
.prose > section,.prose > section#faq{background:transparent;border-top:0}

/* lead-form intro: never cut to one line with an ellipsis */
.leadform .lf-copy > p:not(.lf-trust),.lf-copy > p:not(.lf-trust){white-space:normal!important;max-height:none!important;overflow:visible!important;text-overflow:clip!important;line-height:1.4!important}

/* Realtor hub sub-navigation: 44px tap targets on phones */
@media(max-width:900px){.rh-subnav a{display:inline-flex;align-items:center;min-height:44px}}

/* Spec lists on desktop: label column wide enough that labels don't break one word per line */
@media(min-width:769px){.speclist:not(.bythe) .r{grid-template-columns:minmax(11em,34%) minmax(0,1fr)}}

/* Translated lead forms in a narrow column (e.g. /es/comprar-casa/ at 1366): stack the two-up rows so selects aren't clipped */
html:not([lang="en"]) main .leadform form[data-leadform]{container-type:inline-size}
@container (max-width:520px){html:not([lang="en"]) .leadform .lf-row{grid-template-columns:minmax(0,1fr)!important}}

/* Commercial inquiry selects on small phones: slightly smaller text so long options fit */
@media(max-width:420px){.cm-form select{font-size:15px;padding-left:12px;padding-right:30px}}

/* County grid: counties without their own page sit on the same padding/type as linked ones, muted */
.county-grid li:not(:has(a)){display:flex;align-items:center;min-height:44px;padding:0 16px;font-family:var(--f-display);font-weight:500;font-size:15px;color:var(--slate);border-style:dashed}

/* Program pages (prose + rail template): tighter vertical rhythm between sections (was ~200px of empty space) */
main:has(> section .split > .rail) > section{padding-top:clamp(40px,4.5vw,60px);padding-bottom:clamp(40px,4.5vw,60px)}

/* ======================= t184u ======================= */
/* Program pages: form box directly under the top section (same as bank-statement) */
.wrap.lf-top{margin-top:28px;margin-bottom:8px}
/* Home-purchase trust strip: official Equal Housing mark */
.eho-mark-img{display:inline-block;width:14px;height:16px;vertical-align:-2px;margin-right:4px}
/* County top block: the moved sentences open the first body section */
.county-lead{font-size:16.5px;line-height:1.6;color:var(--ink-soft);margin:0 0 22px}
/* Refinance: form in the top section (desktop: right half; phones: directly under the copy) */
.pagehead.ph-split .wrap{display:grid;grid-template-columns:minmax(0,1fr);gap:28px}
.pagehead.ph-split .ph-form .leadform{margin:0}
@media(min-width:1024px){
  .pagehead.ph-split .wrap{grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:48px;align-items:center}
  .pagehead.ph-split h1{max-width:18ch}
}
/* Commercial hub: phones keep DOM order (form after the six program cards); desktop lifts step 1 into the hero's right half */
@media(min-width:1024px){
  main.cm-main{display:grid;grid-template-columns:minmax(20px,1fr) minmax(0,1180px) minmax(20px,1fr)}
  main.cm-main > *{grid-column:1 / -1;min-width:0}
  main.cm-main > .cm-hero{grid-row:1;display:flex;align-items:center;min-height:100%}
  main.cm-main > .cm-hero > .wrap{width:100%}
  main.cm-main > .cm-hero > .wrap > *{max-width:min(560px,48%)}
  main.cm-main > .cm-form-sec{grid-row:1;grid-column:2;justify-self:end;align-self:center;width:min(500px,44%);padding:48px 0;margin:0;background:none;border:0;z-index:1}
  main.cm-main > .cm-form-sec > .wrap{max-width:none!important;padding:0;margin:0}
  main.cm-main > .cm-form-sec .sec-head{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  main.cm-main > .cm-form-sec .leadform{margin:0;box-shadow:0 18px 50px #0000004d}
}
/* State pages on phones: form section right after the top panel */
@media(max-width:767px){
  main.m-form-early{display:flex;flex-direction:column}
  main.m-form-early > *{order:3}
  main.m-form-early > .lang-strip{order:0}
  main.m-form-early > .pagehead{order:1}
  main.m-form-early > section:has(#start){order:2}
}

/* t188u: refinance-goal row stacks so long goal options are not clipped in narrow (hero) forms */
.lf-row:has(select[name=refi_goal]){grid-template-columns:minmax(0,1fr)}
