/* ──────────────────────────────────────────────────────────────────────────
   polish.css — the one place for the spacing / type / radius rhythm.
   Loaded LAST on every page (public + app), so it settles the stacks that
   older files nudged by a pixel or two. Rules here only set spacing,
   alignment and type size from the tokens below; no colour, no content.

   Spacing  4 · 8 · 12 · 16 · 24 · 32 · 48
   Type     12 · 13 · 14 · 16 · 20 · 28 · 40
   Radius   6 (badge, input) · 8 (button, chip) · 12 (card) · 999 (pill)
   Card     16 inside (compact) · 24 inside (roomy)
   ────────────────────────────────────────────────────────────────────────── */
:root{
  --sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;--sp-5:24px;--sp-6:32px;--sp-7:48px;
  --t-12:12px;--t-13:13px;--t-14:14px;--t-16:16px;--t-20:20px;--t-28:28px;--t-40:40px;
  --rad-sm:6px;--rad-md:8px;--rad-lg:12px;--rad-pill:999px;
  --card-pad:var(--sp-4);--card-pad-lg:var(--sp-5);
}

/* ── global: headings never leave one word alone, icons sit on the text ── */
html:root :is(h1,h2,h3){text-wrap:balance}
html:root :is(p,li){text-wrap:pretty}
html:root :is(p,li,span,a,button,label,strong,small)>i[class*="fa-"]{vertical-align:-0.125em}

/* Collapsed FAQ answers stay out of the layout and the reading order. */
html:root :is(.ds-faq-a,.sp-faq-a):not(.open){visibility:hidden;padding-bottom:0}
html:root :is(.ds-faq-a,.sp-faq-a).open p{padding-top:var(--sp-3)}
html:root .sp-faq-a.open{padding-bottom:var(--sp-4)}
html:root .ds-faq-q>i{align-self:center;flex:none}

/* ── app shell: side nav on one 8px rhythm ── */
html:root body .ms-side{gap:var(--sp-2)}
html:root body .ms-side>.ms-logo{margin:0!important}
html:root body .ms-side>*{margin-top:0!important;margin-bottom:0!important}
html:root body .ms-nav{gap:var(--sp-1)!important}

/* ── board: one 12px gap between every block ── */
html:root body #pg-deals.active{display:flex!important;flex-direction:column;gap:var(--sp-3)!important}
html:root body #pg-deals.active>*{margin-top:0!important;margin-bottom:0!important}

/* deal card: 8 between rows, 16 before the footer (both widths) */
html:root body .deal-card.dx-card{gap:var(--sp-2)!important}
html:root body .deal-card.dx-card>*{margin-top:0!important;margin-bottom:0!important}
html:root body .deal-card.dx-card .dx-verdict{margin:0!important;padding-bottom:var(--sp-2)}
html:root body .deal-card.dx-card>.dx-foot{margin-top:var(--sp-2)!important;padding-top:var(--sp-3)!important}
html:root body .deal-card.dx-card .dx-addr,html:root body .deal-card.dx-card .dx-sub{line-height:1.4}
html:root body .dx-fig{gap:var(--sp-1)}
html:root body .dx-when{gap:var(--sp-1) var(--sp-2)!important}
@media (max-width:640px){
  html:root body :is(#deal-grid,#more-deal-grid,#nearby-grid,#unscored-grid) .deal-card.dx-card{padding:var(--sp-3) var(--sp-4)!important;gap:var(--sp-2)!important}
  html:root body .deal-card.dx-card>.dx-foot{padding-top:var(--sp-2)!important}
  /* the when-line is two clean lines on a phone: sale type over the date */
  html:root body .deal-card.dx-card .dx-foot .dx-when{flex-direction:column;align-items:flex-start;flex-wrap:nowrap;gap:0!important;line-height:1.35}
}

/* picked for you: 8 everywhere, numbers on one line */
html:root body #picked-for-you{display:flex;flex-direction:column;gap:var(--sp-2)}
html:root body #picked-for-you>*{margin-top:0!important;margin-bottom:0!important}
html:root body #picked-for-you .pfy-row{gap:var(--sp-2)!important}
html:root body #picked-for-you .pfy-card{gap:var(--sp-2)!important;padding:var(--sp-3) var(--sp-4)!important}
html:root body #picked-for-you .pfy-card>*{margin-top:0!important;margin-bottom:0!important}
html:root body #picked-for-you .pfy-nums{flex-wrap:nowrap!important;gap:var(--sp-4)!important;margin-top:0!important}
html:root body #dxf-status{gap:var(--sp-2)}
@media (max-width:768px){
  html:root body #picked-for-you .pfy-card{row-gap:var(--sp-1)!important;padding:var(--sp-2) var(--sp-3)!important}
  html:root body #dxm-bar{flex-wrap:nowrap}
}

/* ── deal page ── */
html:root body .dph-verdict-line a.dph-link{display:inline-block}
html:root body .dph-sub2{display:flex;align-items:center;flex-wrap:wrap;gap:var(--sp-1) var(--sp-2)}
html:root body .dph-sub2>span{display:inline-flex;align-items:center;gap:var(--sp-1)}
html:root body .dph-sub2 i{margin-right:0}
html:root body .td-total{gap:var(--sp-2)}

/* ── watchlist card ── */
html:root body .wl-card2 .wl-card-info{gap:var(--sp-2)}
html:root body .wl-card2 .wl-card-info>*{margin-top:0!important;margin-bottom:0!important}
html:root body .wl-card2 .wl-fig{gap:var(--sp-1)}

/* ── compare empty state: icon 12, title 8, text, actions 24 (block flow keeps the sentence whole) ── */
html:root body .cmp-empty i{margin:0 0 var(--sp-3)!important}
html:root body .cmp-empty strong{margin:0 0 var(--sp-2)!important}
html:root body .cmp-empty-acts{margin-top:var(--sp-5)!important;display:flex;flex-wrap:wrap;justify-content:center;gap:var(--sp-3)}
html:root body .cmp-empty-acts a{margin-top:0!important}

/* ── calendar ── */
html:root body #pg-calendar.active{display:flex;flex-direction:column;gap:var(--sp-5)}
html:root body #pg-calendar.active>*{margin-top:0!important;margin-bottom:0!important}
html:root body .cal-nav{flex-wrap:nowrap!important;gap:var(--sp-2)}
html:root body .cal-day-chips{gap:var(--sp-1)}
html:root body .cal-day,html:root body #pg-calendar .cal-day{gap:var(--sp-1)!important}

/* ── account: 24 between cards, 16 inside, forms 16 / label 8 ── */
html:root body .account-layout{gap:var(--sp-5)!important}
html:root body .account-layout>*{margin-top:0!important;margin-bottom:0!important}
html:root body .account-card{display:flex;flex-direction:column;gap:var(--sp-4)}
html:root body .account-card>*{margin-top:0!important;margin-bottom:0!important}
html:root body .account-card .card-head{margin-bottom:0}
html:root body .account-card form{display:flex;flex-direction:column;gap:var(--sp-4)}
html:root body .account-card form>*{margin-top:0!important;margin-bottom:0!important}
html:root body .account-card .form-group{display:flex;flex-direction:column;gap:var(--sp-2)}
html:root body .account-card .form-group>*{margin:0!important}
html:root body .account-card .info-item{display:flex;flex-direction:column;gap:var(--sp-1)}
html:root body .account-card .info-item>*{margin:0!important}
html:root body .account-card details{display:flex;flex-direction:column;gap:var(--sp-4)}

/* ── public pages: one type scale ── */
html:root body:not(.ms-on) :is(.ds-hero,.ds-section,.ds-page,.sp-section,.pr-sec) :is(p,li){font-size:var(--t-16)}
html:root body:not(.ms-on) :is(.ds-hero,.ds-section,.ds-page,.sp-section,.pr-sec) :is(small,.muted,.ds-note){font-size:var(--t-14)}
html:root body:not(.ms-on) :is(.ds-section,.ds-page,.sp-section,.pr-sec) h2{font-size:var(--t-28)}
html:root body:not(.ms-on) :is(.ds-section,.ds-page,.sp-section,.pr-sec) h3{font-size:var(--t-20)}
@media (max-width:640px){
  html:root body:not(.ms-on) :is(.ds-section,.ds-page,.sp-section,.pr-sec) h2{font-size:var(--t-20)}
  html:root body:not(.ms-on) :is(.ds-section,.ds-page,.sp-section,.pr-sec) h3{font-size:var(--t-16)}
}

/* home hero: one 16px rhythm; the CTA row and the stats open a new group (32) */
html:root body .ds-hero{display:flex;flex-direction:column;align-items:center;gap:var(--sp-4)}
html:root body .ds-hero>*{margin-top:0!important;margin-bottom:0!important;max-width:100%}
html:root body .ds-hero>:is(ul,a.df-hero-verdict,.dff-stats,.ds-hero-stats){width:100%}
html:root body .ds-hero>:is(.ds-hero-ctas,.dff-stats,.ds-hero-stats,a.df-hero-verdict){margin-top:var(--sp-4)!important}
html:root body .ds-hero ul{gap:var(--sp-2)!important}
html:root body .ds-hero ul>li{margin:0!important}
html:root body a.df-hero-verdict{display:flex!important;flex-direction:column;gap:var(--sp-2)}
html:root body a.df-hero-verdict>*{margin:0!important}

/* cards on public pages */
html:root body :is(.ds-feature,.tp-card,.ds-price-card,.dff-card,.pr-card){display:flex;flex-direction:column;gap:var(--sp-2)}
html:root body :is(.ds-feature,.tp-card,.ds-price-card,.dff-card,.pr-card)>*{margin-top:0!important;margin-bottom:0!important}
html:root body :is(.ds-feature,.tp-card,.ds-price-card,.dff-card,.pr-card)>:is(.btn,a.btn,button,.ds-btn):last-child{margin-top:auto!important}
html:root body :is(.ds-price-card,.pr-card)>:is(ul,.pr-feats){margin-top:var(--sp-2)!important}
html:root body .tp-grid{gap:var(--sp-4)}
html:root body .tp-reviews .tp-head{margin-bottom:var(--sp-5)}
html:root body .wt-text{display:flex;flex-direction:column;gap:var(--sp-2)}
html:root body .wt-text>*{margin:0!important}
html:root body .wt-snapshot a{display:inline-block}
html:root body .dm-video{display:flex;flex-direction:column;gap:var(--sp-3)}
html:root body .dm-video>*{margin:0!important}
html:root body .dff-wrap{gap:var(--sp-4)}

/* pricing */
html:root body .pr-hero{display:flex;flex-direction:column;align-items:center;gap:var(--sp-3)}
html:root body .pr-hero>*{margin-top:0!important;margin-bottom:0!important}
html:root body :is(.pr-sec,.pr-table-wrap){display:flex;flex-direction:column;gap:var(--sp-4)}
html:root body :is(.pr-sec,.pr-table-wrap)>*{margin-top:0!important;margin-bottom:0!important}
html:root body .pr-cards{gap:var(--sp-5)}

/* footer: brand + three even link columns; links never collide */
html:root body .ds-footer-inner{grid-template-columns:2fr repeat(3,minmax(0,1fr));gap:var(--sp-6)}
html:root body .ds-footer-inner>:nth-child(n+5){grid-column:1 / -1}
html:root body .ds-footer-col{display:flex;flex-direction:column;gap:var(--sp-2)}
html:root body .ds-footer-col>*{margin:0!important}
html:root body .ds-footer-col :is(h3,h4){margin-bottom:var(--sp-1)!important}
html:root body .ds-footer-col a{padding:var(--sp-1) 0;line-height:1.4}
@media (max-width:900px){
  html:root body .ds-footer-inner{grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--sp-5)}
  html:root body .ds-footer-inner>:first-child{grid-column:1 / -1}
}

/* county page */
html:root body .cpg-rules-card{display:flex;flex-direction:column;gap:var(--sp-3)}
html:root body .cpg-rules-card>p{margin:0!important}
html:root body .cpg-rules-card>p>strong{display:inline}

/* login / Flexy setup */
html:root body .fx-setup-head{display:flex;flex-direction:column;gap:var(--sp-2);margin-bottom:var(--sp-5)}
html:root body .fx-setup-head>*{margin:0!important}
html:root body .fx-setup-grid{gap:var(--sp-5)}
html:root body .fx-chat-head .who{display:flex;flex-direction:column;gap:var(--sp-1)}
html:root body .fx-chat-head .who span{font-size:var(--t-13)}

/* pricing details */
html:root body .pr-proof{gap:var(--sp-5)}
html:root body .pr-ent h2{margin:0 0 var(--sp-2)!important}
html:root body .ds-footer-cards{margin:var(--sp-4) 0 0!important}

/* ── type scale: older rem-based components land on the 12/13/14/16/20/28/40 steps ── */
html:root body :is(.sp-stars span,.sp-blog-cat,.dftools-label,.dftools-card .free,.dfb-eyebrow,.acs-soon){font-size:var(--t-12)!important}
html:root body :is(.sp-proof-card>div,.dfb-micro,.acs-crumbs,.acs-crumbs a,.acs-hero-stat .label,.acs-rules span,.acs-rules a,.acs-links a,.acs-cta-link,.pr-badge,.si-hero-stat .label,.si-card-row .label,.si-card-row .value){font-size:var(--t-13)!important}
html:root body :is(.df-rs-cta,.df-rs-cta a,.df-rs-cta span,.pr-freenote,.pr-freenote *,.acs-date,td.acs-date,.si-filter-btn,.ds-footer-bottom,.ds-footer-bottom *){font-size:var(--t-14)!important}
html:root body :is(.sp-listing-card .dx-addr,.sp-listing-card .dx-word,.sp-listing-card .dx-fig .v,.rule-detail,.rule-detail strong,.coverage-banner>div,.verdict-vocab dt,.verdict-vocab dd,.dftools-cta,.dftools-cta a,.dftools-card b,.dfb-cta,.cpg-faq summary,.ds-faq-q,.acs-section h2){font-size:var(--t-16)!important}
html:root body :is(.rule-value,.dftools-card .ic){font-size:var(--t-20)!important}
html:root body :is(.acs-hero-stat .num,.si-hero-stat .num){font-size:var(--t-28)!important}
html:root body :is(.sp-hero h1,.acs-hero h1,.si-hero h1){font-size:var(--t-40)!important}
html:root body .pr-price .amt{font-size:var(--t-40)!important}
@media (max-width:640px){
  html:root body :is(.sp-hero h1,.acs-hero h1,.si-hero h1){font-size:var(--t-28)!important}
}
html:root body .ds-faq-q{align-items:center}
html:root body .ds-faq-q>i{line-height:1;margin-top:0!important}

/* home sections */
html:root body .ds-feature>ul{gap:var(--sp-2)!important}
html:root body .ds-section>.ds-features{margin-top:var(--sp-6)!important}
html:root body .ds-text-center>.ds-features{margin-top:var(--sp-5)!important}
html:root body .ds-text-center>.ds-features+p{margin-top:var(--sp-4)!important}
html:root body .ds-text-center>.ds-section-label{margin-bottom:var(--sp-2)!important}
html:root body .tp-head .tp-sub{margin-top:var(--sp-2)!important}
html:root body .tp-reviews .tp-foot{margin-top:var(--sp-5)!important}
html:root body ul.ds-price-card-features>li{align-items:baseline}
html:root body ul.ds-price-card-features>li>i{margin-top:0!important;flex:none}
html:root body .ds-section-sm>div>*+*{margin-top:var(--sp-2)!important}
html:root body .ds-section-sm>div>a:last-child{margin-top:var(--sp-4)!important}
html:root body .dff-wrap>:is(.wt-head,.wt-chips){margin-bottom:var(--sp-4)!important}
html:root body .dff-stat .label{margin-top:var(--sp-2)!important}
html:root body details.dm-video>video{display:block}
html:root body details.dm-video[open]>*+*{margin-top:var(--sp-3)!important}
@media (max-width:640px){
  html:root body .ds-hero-ctas{flex-direction:column;align-items:stretch;width:100%}
  html:root body .ds-hero-ctas>a{width:100%;justify-content:center;margin:0!important}
}

/* sign up / sign in: 24 between blocks, 16 between fields, 8 label→input */
html:root body .auth-card>.auth-header{margin-bottom:var(--sp-5)!important}
html:root body .auth-card>details,html:root body .auth-card>.auth-footer{margin-top:var(--sp-5)!important}
html:root body .auth-header>h1{margin:0 0 var(--sp-2)!important}
html:root body .auth-header>div{margin-top:var(--sp-4)!important}
html:root body form.auth-form{gap:var(--sp-4)!important}
html:root body form.auth-form>*{margin-top:0!important;margin-bottom:0!important}
html:root body .auth-form .form-group{gap:var(--sp-2)!important}
html:root body .auth-form .form-group>*{margin-top:0!important;margin-bottom:0!important}
html:root body .auth-form label{font-size:var(--t-14)}

/* account details blocks */
html:root body .account-card details>*{margin-top:0!important;margin-bottom:0!important}
html:root body .account-card details[open]>*+*{margin-top:var(--sp-4)!important}
html:root body .df-plan-status,html:root body .danger-item>div>p{margin-top:var(--sp-1)!important}

/* hero checklist: text wraps under the text, not under the tick */
html:root body :is(.ds-hero ul,.ds-feature>ul)>li:has(>i:first-child){padding-left:26px;text-indent:-26px}
html:root body :is(.ds-hero ul,.ds-feature>ul)>li>i:first-child{width:18px;margin-right:8px!important;text-indent:0;text-align:center}
@media (max-width:640px){
  html:root body .ds-hero-ctas>a{padding:14px 16px;gap:8px}
}

/* deal cards in a row: the footer sits on the card's bottom edge, so every
   footer in the row lines up */
html:root body .deal-card.dx-card>.dx-foot{margin-top:auto!important}
html:root body .deal-card.dx-card>.dx-figs+.dx-foot,html:root body .deal-card.dx-card>.dx-foot{min-height:0}

/* county page alert and pricing terms on the scale */
html:root body .ds-page>.cpg-alert{margin-top:var(--sp-5)!important;margin-bottom:0!important}
html:root body .pr-cards+.pr-terms{margin-top:var(--sp-5)!important}
html:root body .pr-terms+.pr-terms{margin-top:var(--sp-2)!important}
html:root body .pr-freenote{padding-top:var(--sp-3)!important}

/* feature cards: the closing link sits on the card's bottom edge in both cards */
html:root body .ds-feature>ul{margin-top:var(--sp-2)!important}
html:root body .ds-feature>:last-child:not(:first-child):not(ul):not(p){margin-top:auto!important;padding-top:var(--sp-4)}
html:root body .ds-feature>ul~p:last-child{flex:0 0 auto;margin-top:auto!important;padding-top:var(--sp-4)}
html:root body .ds-feature>:last-child:not(:first-child){line-height:1.5}
html:root body .df-lookups-left>i:first-child{margin-right:var(--sp-2)}
html:root body .ds-feature>div:last-child:not(:first-child)>a{display:inline-flex;align-items:center;min-height:40px}
