/* Hero search bar — shared (home + housing guide block 12) */
/* Large multi-field search */
    .hero-search {
      display: grid;
      grid-template-columns: 1.05fr 1.45fr 1fr 0.95fr auto;
      align-items: stretch;
      gap: 0;
      max-width: 100%;
      margin: 0 auto;
      padding: 0.55rem;
      background: var(--bg-white);
      border: 1px solid var(--border-light);
      border-radius: var(--radius-search, 1.25rem);
      box-shadow: var(--shadow-search, var(--shadow-lg));
      text-align: left;
    }

    .hero-search:focus-within {
      border-color: rgba(37, 99, 235, 0.45);
      box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.18),
        var(--shadow-search, var(--shadow-lg));
    }

    .hero-search__seg {
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-width: 0;
      padding: 0.55rem 0.85rem 0.55rem 1rem;
      margin: 0;
      z-index: 1;
    }

    .hero-search__seg.is-open {
      z-index: 5;
    }

    .hero-search__seg:not(:last-of-type)::after {
      content: '';
      position: absolute;
      top: 18%;
      right: 0;
      width: 1px;
      height: 64%;
      background: var(--border-light);
    }

    .hero-search__label {
      display: block;
      margin-bottom: 0.2rem;
      font-size: 0.6875rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--text-muted);
      line-height: 1;
    }

    .hero-search__value {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      min-width: 0;
    }

    .hero-search__value > i {
      flex-shrink: 0;
      color: var(--primary);
      font-size: 1rem;
      line-height: 1;
    }

    .hero-search__control {
      appearance: none;
      -webkit-appearance: none;
      flex: 1;
      min-width: 0;
      width: 100%;
      border: none;
      background: transparent;
      padding: 0.15rem 0;
      font-family: inherit;
      font-size: 0.9375rem;
      font-weight: 600;
      color: var(--text-primary);
      line-height: 1.25;
      outline: none;
    }

    .hero-search__control::placeholder {
      color: var(--text-muted);
      font-weight: 500;
    }

    .hero-search__control--number {
      cursor: text;
      min-width: 0;
    }

    /* Custom select + calendar (menus portaled to body) */
    .hero-select,
    .hero-cal {
      position: relative;
      flex: 1;
      min-width: 0;
    }

    .hero-select__trigger {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      width: 100%;
      padding: 0.15rem 0;
      border: none;
      background: transparent;
      font-family: inherit;
      font-size: 0.9375rem;
      font-weight: 600;
      color: var(--text-primary);
      line-height: 1.25;
      text-align: left;
      cursor: pointer;
    }

    .hero-select__trigger:focus-visible {
      outline: 2px solid rgba(37, 99, 235, 0.45);
      outline-offset: 3px;
      border-radius: 6px;
    }

    .hero-select__current {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .hero-select__current.is-placeholder {
      color: var(--text-muted);
      font-weight: 500;
    }

    .hero-select__chevron {
      flex-shrink: 0;
      width: 0.65rem;
      height: 0.65rem;
      border-right: 1.5px solid #94a3b8;
      border-bottom: 1.5px solid #94a3b8;
      transform: rotate(45deg) translateY(-1px);
      transition: transform 0.15s ease;
    }

    .hero-select.is-open .hero-select__chevron,
    .hero-cal.is-open .hero-select__chevron {
      transform: rotate(225deg) translateY(-1px);
    }

    .hero-popover {
      position: fixed;
      z-index: 10050;
      margin: 0;
      padding: 0.4rem;
      background: #fff;
      border: 1px solid var(--border-light);
      border-radius: 0.85rem;
      box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.04),
        0 16px 40px rgba(15, 23, 42, 0.14);
    }

    .hero-popover[hidden] {
      display: none !important;
    }

    .hero-select__option {
      display: block;
      width: 100%;
      padding: 0.7rem 0.85rem;
      border: none;
      border-radius: 0.6rem;
      background: transparent;
      font-family: inherit;
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text-primary);
      text-align: left;
      cursor: pointer;
      transition: background 0.12s ease, color 0.12s ease;
    }

    .hero-select__option:hover,
    .hero-select__option:focus-visible {
      background: var(--primary-lighter);
      color: var(--primary-dark);
      outline: none;
    }

    .hero-select__option.is-selected {
      background: var(--primary);
      color: #fff;
    }

    .hero-select__option.is-selected:hover,
    .hero-select__option.is-selected:focus-visible {
      background: var(--primary-dark);
      color: #fff;
    }

    /* Date calendar popover */
    .hero-cal__panel {
      width: 288px;
      padding: 0.75rem;
    }

    .hero-cal__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      margin-bottom: 0.65rem;
    }

    .hero-cal__title {
      font-size: 0.9375rem;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }

    .hero-cal__nav {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 2rem;
      height: 2rem;
      border: none;
      border-radius: 0.55rem;
      background: var(--bg-light);
      color: var(--text-primary);
      cursor: pointer;
      transition: background 0.12s ease, color 0.12s ease;
    }

    .hero-cal__nav:hover {
      background: var(--primary-lighter);
      color: var(--primary-dark);
    }

    .hero-cal__weekdays {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 0.15rem;
      margin-bottom: 0.25rem;
    }

    .hero-cal__weekday {
      text-align: center;
      font-size: 0.6875rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--text-muted);
      padding: 0.25rem 0;
    }

    .hero-cal__grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 0.15rem;
    }

    .hero-cal__day {
      aspect-ratio: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: none;
      border-radius: 0.55rem;
      background: transparent;
      font-family: inherit;
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--text-primary);
      cursor: pointer;
      transition: background 0.12s ease, color 0.12s ease;
    }

    .hero-cal__day:hover:not(:disabled):not(.is-selected) {
      background: var(--primary-lighter);
      color: var(--primary-dark);
    }

    .hero-cal__day.is-outside {
      color: #cbd5e1;
    }

    .hero-cal__day.is-today:not(.is-selected) {
      box-shadow: inset 0 0 0 1.5px rgba(37, 99, 235, 0.45);
    }

    .hero-cal__day.is-selected {
      background: var(--primary);
      color: #fff;
    }

    .hero-cal__day:disabled {
      color: #e2e8f0;
      cursor: not-allowed;
    }

    .hero-cal__footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 0.5rem;
      margin-top: 0.65rem;
      padding-top: 0.55rem;
      border-top: 1px solid var(--border-lighter);
    }

    .hero-cal__action {
      border: none;
      background: transparent;
      padding: 0.35rem 0.5rem;
      border-radius: 0.45rem;
      font-family: inherit;
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--primary);
      cursor: pointer;
    }

    .hero-cal__action:hover {
      background: var(--primary-lighter);
    }

    .hero-cal__action--muted {
      color: var(--text-muted);
    }

    .hero-search__submit {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.45rem;
      align-self: stretch;
      min-height: 3.5rem;
      padding: 0 1.35rem;
      margin: 0.1rem;
      border: none;
      border-radius: 0.9rem;
      background: var(--primary);
      color: #fff;
      font-family: inherit;
      font-size: 0.9375rem;
      font-weight: 700;
      cursor: pointer;
      transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
      white-space: nowrap;
      box-shadow: var(--shadow-primary);
    }

    .hero-search__submit:hover {
      background: var(--primary-dark);
      color: #fff;
    }

    .hero-search__submit:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }

    .hero-search__submit:active {
      transform: scale(0.98);
    }

    .hero-search__submit i {
      font-size: 1rem;
      line-height: 1;
    }

    .hero__popular {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 0.55rem 0.65rem;
      margin: 1.35rem 0 0;
    }

    .hero__popular-label {
      font-size: 0.875rem;
      font-weight: 700;
      color: var(--text-primary);
      margin-right: 0.15rem;
      text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
    }

    .hero__chip {
      display: inline-flex;
      align-items: center;
      min-height: 36px;
      padding: 0.45rem 0.85rem;
      border-radius: 999px;
      border: 1px solid var(--border-light);
      background: rgba(255, 255, 255, 0.88);
      color: var(--text-primary);
      font-size: 0.8125rem;
      font-weight: 600;
      line-height: 1.2;
      text-decoration: none;
      box-shadow: 0 1px 2px rgba(22, 28, 36, 0.04);
      transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    }

    .hero__chip:hover {
      border-color: rgba(37, 99, 235, 0.35);
      color: var(--primary);
      background: #fff;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
    }

    /* Conversational AI path — organic fork under classic filters */
    .hero-ask {
      --hero-ask: #41737e;
      --hero-ask-deep: #2f5a63;
      --hero-ask-soft: #e8f4f2;
      --hero-ask-ink: #243f45;
      margin: 0.85rem auto 0;
      max-width: 100%;
      text-align: left;
    }

    .hero-ask__fork {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.85rem;
      margin: 0 0 0.7rem;
      color: var(--hero-ask-ink);
      font-size: 0.8125rem;
      font-weight: 600;
      letter-spacing: 0.01em;
    }

    .hero-ask__fork::before,
    .hero-ask__fork::after {
      content: '';
      flex: 1;
      max-width: 7.5rem;
      height: 1px;
      background: linear-gradient(
        90deg,
        transparent,
        rgba(65, 115, 126, 0.45),
        transparent
      );
    }

    .hero-ask__fork-label {
      display: inline-flex;
      align-items: baseline;
      gap: 0.35rem;
      white-space: nowrap;
    }

    .hero-ask__fork-or {
      font-family: var(--font-display);
      font-size: 1.05rem;
      font-weight: 700;
      font-style: italic;
      letter-spacing: -0.02em;
      color: var(--hero-ask);
    }

    .hero-ask__rail {
      position: relative;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: stretch;
      gap: 0;
      border-radius: 1.35rem;
      border: 1.5px solid rgba(65, 115, 126, 0.42);
      background:
        radial-gradient(120% 140% at 0% 0%, rgba(65, 115, 126, 0.16) 0%, transparent 46%),
        linear-gradient(118deg, #eef7f5 0%, #ffffff 48%, #f7fbfa 100%);
      box-shadow:
        0 1px 2px rgba(22, 28, 36, 0.04),
        0 18px 40px rgba(65, 115, 126, 0.16);
      overflow: hidden;
      isolation: isolate;
    }

    .hero-ask__rail::before {
      content: '';
      position: absolute;
      inset: 0 auto 0 0;
      width: 4px;
      background: linear-gradient(180deg, #5a9aa5 0%, var(--hero-ask) 55%, var(--hero-ask-deep) 100%);
      z-index: 1;
    }

    .hero-ask__rail::after {
      content: '';
      position: absolute;
      inset: -40% -20% auto auto;
      width: 14rem;
      height: 14rem;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(65, 115, 126, 0.12) 0%, transparent 70%);
      pointer-events: none;
      animation: heroAskBloom 7s ease-in-out infinite alternate;
    }

    @keyframes heroAskBloom {
      from { transform: translate(0, 0) scale(1); opacity: 0.7; }
      to { transform: translate(-18%, 12%) scale(1.15); opacity: 1; }
    }

    .hero-ask__brand {
      position: relative;
      z-index: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      gap: 0.2rem;
      padding: 1rem 1.05rem 1rem 1.2rem;
      border-right: 1px solid rgba(65, 115, 126, 0.16);
      white-space: nowrap;
    }

    .hero-ask__brand-kicker {
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--hero-ask);
    }

    .hero-ask__brand-name {
      font-family: var(--font-display);
      font-size: 1.4rem;
      font-weight: 700;
      letter-spacing: -0.035em;
      line-height: 1;
      color: var(--hero-ask-ink);
    }

    .hero-ask__brand-name em {
      font-style: normal;
      color: var(--hero-ask);
    }

    .hero-ask__prompt {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 0.9rem;
      min-height: 76px;
      padding: 0.85rem 0.85rem 0.85rem 1.1rem;
      text-decoration: none;
      color: inherit;
      transition: background 0.22s ease;
    }

    .hero-ask__prompt:hover {
      background: rgba(65, 115, 126, 0.06);
    }

    .hero-ask__prompt:focus-visible {
      outline: 2px solid var(--hero-ask);
      outline-offset: -2px;
    }

    .hero-ask__quote {
      position: relative;
      display: block;
      font-family: var(--font-display);
      font-size: clamp(1.02rem, 2.35vw, 1.28rem);
      font-weight: 500;
      font-style: italic;
      letter-spacing: -0.025em;
      line-height: 1.32;
      color: var(--hero-ask-ink);
      min-width: 0;
    }

    /* Invisible longest brief — locks height so typing wrap never reflows the hero */
    .hero-ask__quote-sizer {
      display: block;
      visibility: hidden;
      pointer-events: none;
      user-select: none;
    }

    .hero-ask__quote-live {
      position: absolute;
      inset: 0;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
      overflow: hidden;
      transition: opacity 0.28s ease;
    }

    .hero-ask__quote-live.is-swap {
      opacity: 0;
    }

    .hero-ask__quote-mark {
      font-style: normal;
      font-weight: 700;
      color: var(--hero-ask);
      opacity: 0.85;
    }

    .hero-ask__caret {
      display: inline-block;
      width: 0.1em;
      margin-left: 0.1em;
      height: 0.95em;
      border-radius: 1px;
      background: var(--hero-ask);
      vertical-align: -0.1em;
      animation: heroAskCaret 0.9s steps(1) infinite;
    }

    @keyframes heroAskCaret {
      50% { opacity: 0; }
    }

    .hero-ask__cta {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      flex-shrink: 0;
      min-height: 48px;
      padding: 0.6rem 1.05rem;
      border-radius: 999px;
      background: var(--hero-ask);
      color: #fff;
      font-size: 0.9rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      box-shadow: 0 6px 18px rgba(65, 115, 126, 0.32);
      transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    }

    .hero-ask__prompt:hover .hero-ask__cta {
      background: var(--hero-ask-deep);
      transform: translateY(-1px);
      box-shadow: 0 8px 22px rgba(65, 115, 126, 0.38);
    }

    .hero-ask__cta-icon {
      display: inline-grid;
      place-items: center;
      width: 1.35rem;
      height: 1.35rem;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.18);
      font-size: 0.85rem;
      line-height: 1;
    }

    .hero-ask__hint {
      margin: 0.6rem 0 0;
      text-align: center;
      font-size: 0.8125rem;
      color: var(--text-secondary);
      text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
    }

    .hero-ask__hint a {
      color: var(--hero-ask);
      font-weight: 700;
      text-decoration: none;
    }

    .hero-ask__hint a:hover {
      text-decoration: underline;
    }

    @media (max-width: 720px) {
      .hero-ask__fork::before,
      .hero-ask__fork::after {
        max-width: 2.5rem;
      }

      .hero-ask__rail {
        grid-template-columns: 1fr;
      }

      .hero-ask__rail::before {
        inset: 0 0 auto 0;
        width: auto;
        height: 3px;
        background: linear-gradient(90deg, #5a9aa5 0%, var(--hero-ask) 55%, var(--hero-ask-deep) 100%);
      }

      .hero-ask__brand {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.35rem 0.55rem;
        border-right: 0;
        border-bottom: 1px solid rgba(65, 115, 126, 0.16);
        padding: 0.8rem 1rem 0.7rem;
        white-space: normal;
      }

      .hero-ask__brand-name {
        font-size: 1.2rem;
      }

      .hero-ask__prompt {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        min-height: 0;
        padding: 0.9rem 1rem 1rem;
      }

      .hero-ask__cta {
        justify-content: center;
        width: 100%;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .hero-ask__caret,
      .hero-ask__rail::after {
        animation: none;
      }

      .hero-ask__quote-live {
        transition: none;
      }
    }

    @media (max-width: 960px) {
      .hero {
        padding: 2.5rem 0 2.75rem;
        align-items: flex-start;
      }

      .hero__title {
        white-space: normal;
        max-width: 18ch;
        margin-left: auto;
        margin-right: auto;
        font-size: clamp(1.625rem, 6.5vw, 2.25rem);
      }

      .hero__subtitle {
        max-width: 36rem;
        margin-bottom: 1.5rem;
        font-size: 0.9875rem;
        line-height: 1.55;
        padding: 0 0.25rem;
      }

      .hero-search {
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding: 0.35rem;
        border-radius: 1.1rem;
      }

      .hero-search__seg {
        padding: 0.75rem 0.85rem;
      }

      .hero-search__seg:not(:last-of-type)::after {
        display: none;
      }

      .hero-search__seg:nth-child(1),
      .hero-search__seg:nth-child(2) {
        border-bottom: 1px solid var(--border-light);
      }

      .hero-search__seg:nth-child(1),
      .hero-search__seg:nth-child(3) {
        border-right: 1px solid var(--border-light);
      }

      .hero-search__submit {
        grid-column: 1 / -1;
        min-height: 3.15rem;
        margin: 0.35rem;
        width: auto;
        border-radius: 0.85rem;
      }

      .hero__popular {
        margin-top: 1.15rem;
        gap: 0.5rem;
      }

      .hero__chip {
        padding: 0.4rem 0.75rem;
        font-size: 0.78125rem;
      }
    }

    @media (max-width: 560px) {
      .hero {
        padding: 1.75rem 0 2.25rem;
      }

      .hero__title {
        max-width: none;
        letter-spacing: -0.03em;
      }

      .hero__subtitle {
        font-size: 0.9375rem;
        margin-bottom: 1.25rem;
      }

      .hero-search {
        grid-template-columns: 1fr;
        padding: 0.25rem;
      }

      .hero-search__seg {
        padding: 0.85rem 1rem;
        border-right: none !important;
        border-bottom: 1px solid var(--border-light);
      }

      .hero-search__seg:nth-child(4) {
        border-bottom: none;
      }

      .hero-search__submit {
        margin: 0.25rem 0.35rem 0.4rem;
        min-height: 3rem;
      }

      .hero__popular {
        justify-content: flex-start;
      }

      .hero__popular-label {
        width: 100%;
        margin: 0 0 0.15rem;
        text-align: left;
      }
    }