/* Shared responsive layout for every page. */
@media (max-width: 900px) {
  .site-header { position: sticky; padding: 6px 10px; margin-bottom: 0; }
  .site-header .container { gap: 12px; }
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .header-actions > a.header-cta { display: none; }

  #nav-links.is-open {
    position: absolute;
    top: 100%;
    left: 10px;
    right: 10px;
    z-index: 150;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px;
    background: #fff;
    border: 1px solid rgba(14, 27, 62, .08);
    border-radius: 20px;
    box-shadow: 0 12px 24px rgba(14, 27, 62, .14);
  }

  #nav-links.is-open a {
    display: block;
    padding: 12px 0;
    color: #292a2d;
    border-bottom: 1px solid rgba(14, 27, 62, .08);
  }

  #nav-links.is-open li:last-child a { border-bottom: 0; }
}

@media (max-width: 768px) {
  html, body { max-width: 100%; }
  body { overflow-x: clip; }

  .container {
    width: 100%;
    padding-right: 20px;
    padding-left: 20px;
  }

  .site-header .container { min-height: 72px; padding: 6px 16px; }
  .mark.mark--header { width: 76px; height: 60px; }
  .header-actions { gap: 8px; }
  .nav-toggle { min-width: 42px; min-height: 42px; }

  section { padding-top: 52px; padding-bottom: 52px; }
  .container,
  .site-header .container,
  .footer-grid,
  .hero-grid,
  .hero-x .hx-wrap,
  .offer-grid,
  .why-grid,
  .trust-grid,
  .fee-grid,
  .brokers-grid,
  .story-columns,
  .calc-wrap,
  .reviews-grid,
  .ct-grid,
  .ct-cards,
  .v4-grid,
  .cv-grid,
  .cv-promise,
  .stats-grid,
  .values-grid,
  .tab-panel,
  .est-box,
  .fd-result,
  .mf,
  .jr-track,
  .sv-grid {
    min-width: 0;
  }

  .section-head { margin-bottom: 28px; }
  h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  h2 { font-size: clamp(1.5rem, 6.5vw, 2.1rem); }
  h3 { font-size: clamp(1.1rem, 4.8vw, 1.4rem); }
  p, li { overflow-wrap: anywhere; }

  .hero-grid,
  .hero-x .hx-wrap,
  .offer-grid,
  .why-grid,
  .trust-grid,
  .fee-grid,
  .brokers-grid,
  .story-columns,
  .calc-wrap,
  .reviews-grid,
  .ct-grid,
  .ct-cards,
  .v4-grid,
  .cv-grid,
  .cv-promise,
  .values-grid,
  .tab-panel,
  .est-box,
  .fd-result,
  .mf,
  .jr-track,
  .sv-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px;
  }

  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .hero-x .hx-wrap { gap: 28px; }
  .hero-x h1 { font-size: clamp(2.15rem, 10vw, 3.25rem); }
  .hx-visual { max-width: min(100%, 390px); margin: 0 auto; }
  .hx-card { max-width: 48%; }
  .hx-scroll { display: none; }

  .pg-hero { padding: 54px 0 64px; }
  .pg-hero h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .ct-card { min-width: 0; }
  .ct-card b.em { white-space: normal; overflow-wrap: anywhere; }
  .faq-hero-search input { min-width: 0; }

  .form-panel,
  .calc-card,
  .tab-panel,
  .est-form,
  .est-out,
  .fd-result,
  .cv-card,
  .v4-card { padding: 22px 18px; }

  .field-row { grid-template-columns: minmax(0, 1fr); }
  input, select, textarea, button { max-width: 100%; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-columns { text-align: left; }
  .story-photo { margin-right: auto; margin-left: auto; }

  .services-carousel .service-card { flex-basis: min(84vw, 340px); width: min(84vw, 340px); }
  .cta-band { padding: 56px 0; }
  .map-frame { max-width: 100%; }
  table { display: block; max-width: 100%; overflow-x: auto; }

  .footer-grid { gap: 24px; }
  .footer-links { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 480px) {
  .container { padding-right: 16px; padding-left: 16px; }
  .site-header .container { gap: 8px; }
  .mark.mark--header { width: 68px; height: 54px; }
  #nav-links.is-open { padding-right: 16px; padding-left: 16px; }
  .stats-grid { gap: 10px; }
  .stat { padding: 18px 10px; }
  .results-grid { grid-template-columns: minmax(0, 1fr); }
  .services-carousel .service-card { flex-basis: min(88vw, 340px); width: min(88vw, 340px); }
  .process-item { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .footer-links a { padding: 8px 10px; }
  .chat-bubble .pill { display: none; }
}

@media (max-width: 360px) {
  .container { padding-right: 12px; padding-left: 12px; }
  .site-header .container { gap: 4px; }
  .mark.mark--header { width: 62px; height: 50px; }
  .nav-toggle { min-width: 38px; min-height: 38px; padding: 6px 8px; }
  .hero-x h1 { font-size: 2rem; }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .services-carousel .card-row { animation: none; }
}

/* Keep the first content section clear of the sticky navbar on inner pages. */
body:not(:has(.hero-x)) .site-header + section { padding-top: 148px; }
body:not(:has(.hero-x)) .site-header + .pg-hero { padding-top: 128px; }
body:not(:has(.hero-x)) .site-header + .sv-hero { padding-top: 132px; }

@media (max-width: 900px) {
  body:not(:has(.hero-x)) .site-header + section { padding-top: 116px; }
  body:not(:has(.hero-x)) .site-header + .pg-hero { padding-top: 100px; }
  body:not(:has(.hero-x)) .site-header + .sv-hero { padding-top: 100px; }
}
