/* Scroll UI (2026-12-04): mobile sticky Get Started bar + tablet/desktop back-to-top with progress */

/* --- Mobile bar (reuses the site's .sticky-cta look; scroll-direction controlled by scroll-ui.js) --- */
.sticky-cta--generic { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gutter, 16px) calc(10px + env(safe-area-inset-bottom)); background: rgba(5,14,21,.96); border-top: 1px solid var(--line-d, #21405A);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--on-dark, #EAF2F4); }
.sticky-cta--generic .sticky-cta__amount { flex: 1; min-width: 0; line-height: 1.2; }
.sticky-cta--generic .sticky-cta__amount span { display: block; font-size: .72rem; font-weight: 700; color: var(--on-dark-2, #A3B8C4); }
.sticky-cta--generic .sticky-cta__amount strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.sticky-cta--generic .btn { min-height: 48px; }

@media (max-width: 767.98px) {
  html.ssb .ssb-bar, html.ssb .ssb-bar[hidden] { display: flex !important; transform: translateY(110%); visibility: hidden;
    transition: transform .28s ease, visibility 0s linear .28s; }
  html.ssb[data-ssb="show"] .ssb-bar { transform: none; visibility: visible; transition: transform .28s ease, visibility 0s; }
  html.ssb[data-ssb="show"] body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  html.ssb.has-sticky-cta body, html.ssb body.has-sticky { padding-bottom: 0; }
  html.ssb[data-ssb="show"].has-sticky-cta body, html.ssb[data-ssb="show"] body.has-sticky { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (min-width: 768px) { .sticky-cta, .sticky-cta[hidden] { display: none !important; } html.has-sticky-cta body, body.has-sticky { padding-bottom: 0 !important; } }
@media (prefers-reduced-motion: reduce) { html.ssb .ssb-bar { transition: none !important; } }

/* --- Back to top (tablet and desktop) --- */
.to-top { position: fixed; right: clamp(16px, 2.4vw, 32px); bottom: 24px; z-index: 45; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%;
  display: none; place-items: center; cursor: pointer; color: var(--on-dark, #EAF2F4);
  background: rgba(10,26,38,.92); box-shadow: 0 14px 30px -12px rgba(0,0,0,.55), inset 0 0 0 1px var(--line-d, #21405A);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s, background-color .18s ease; }
@media (min-width: 768px) { .to-top { display: grid; } }
.to-top.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .22s ease, transform .22s ease, visibility 0s, background-color .18s ease; }
.to-top:hover { background: #0E2231; }
.to-top:focus-visible { outline: 3px solid var(--mint, #5BE3B4); outline-offset: 3px; }
.to-top__ring { position: absolute; inset: 2px; width: 52px; height: 52px; transform: rotate(-90deg); }
.to-top__track { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 3; }
.to-top__bar { fill: none; stroke: var(--mint, #5BE3B4); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .12s linear; }
/* V31: arrow and % are one stack, centred in the ring as a unit */
.to-top__inner { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1; transform: translateY(-1px); }
.to-top__arrow { display: block; width: 16px; height: 16px; color: var(--mint, #5BE3B4); }
.to-top__pct { display: block; min-width: 3.4ch; text-align: center; font: 800 .58rem/1 var(--font-ui, Manrope, sans-serif); letter-spacing: 0; margin-top: -1.5px;   /* V33.1: the arrow's viewBox has ~3px empty space below the stroke; pull the % up to it */ color: var(--on-dark-2, #A3B8C4); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .to-top, .to-top.is-on { transition: none; } .to-top__bar { transition: none; } }

/* --- V31: full-screen mobile menu, Get Started (or the /debt-help/ note) pinned to the bottom --- */
@media (max-width: 1099.98px) {
  /* lock the page on <html> only: overflow:hidden on <body> (templates.css body.menu-open) turns it into a scroll box,
     which unsticks the header and sends it to the top of the document */
  html.menu-open { overflow: hidden; }
  html.menu-open body, html.menu-open body.menu-open { overflow-x: clip !important; overflow-y: visible !important; }
  /* backdrop-filter would make the header the containing block of the fixed menu */
  html.menu-open .site-header { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background-color: var(--abyss, #050E15) !important; transition: none !important; }
  html.menu-open .menu-toggle[aria-expanded="true"] { border-color: var(--mint, #5BE3B4); color: var(--mint, #5BE3B4); }
  html.menu-open .mobile-nav:not([hidden]) { position: fixed; left: 0; right: 0; top: var(--mnav-top, 64px); bottom: 0; z-index: 60;
    display: flex; flex-direction: column; max-height: none; overflow: hidden; padding: 0; margin: 0; background: var(--abyss, #050E15); }
  html.menu-open .mobile-nav > .container { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
    padding-top: 16px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  html.menu-open .mobile-nav ul { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; margin: 0 0 16px; }
  html.menu-open .mobile-nav > .container > .btn,
  html.menu-open .mobile-nav > .container > .menu-note { flex: none; margin-top: auto; margin-bottom: 0; }
  html.menu-open .ssb-bar, html.menu-open .to-top { visibility: hidden !important; opacity: 0 !important; }
}
/* V31: sticky-bar label stays on one line (fits from 320px; ellipsis only as a safety net) */
.ssb-bar .sticky-cta__amount { min-width: 0; }
.ssb-bar .sticky-cta__amount span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* V32: homepage sticky bar, option B (headline + loan range). Wraps to two lines on 320px screens; compact button */
#sticky-amount[hidden] { display: none !important; }
.ssb-bar .sticky-cta__amount--pitch .sticky-cta__title { display: block; font: 800 .92rem/1.18 var(--font-display, var(--font-ui, sans-serif)); letter-spacing: -.01em; color: var(--on-dark, #EAF2F4); }
.ssb-bar .sticky-cta__amount--pitch .sticky-cta__sub { display: block; margin-top: 3px; font: 600 .7rem/1.25 var(--font-ui, sans-serif); color: var(--on-dark-2, #A3B8C4); white-space: normal; overflow: visible; }
#sticky-cta.ssb-bar { gap: 10px; }
#sticky-cta.ssb-bar .btn { flex: none; min-height: 46px; padding: 0 18px; font-size: .95rem; }
@media (max-width: 359.98px) { #sticky-cta.ssb-bar .btn { padding: 0 16px; } #sticky-cta.ssb-bar .btn .arrow { display: none; } }
@media (max-width: 359.98px) { html.ssb[data-ssb="show"].has-sticky-cta body, html.ssb[data-ssb="show"] body:has(#sticky-cta) { padding-bottom: calc(92px + env(safe-area-inset-bottom)); } }   /* two-line bar on 320px */
