/* er-next-level.css
 * Shared styling for the Tier-S/A/B "next level" client-builder elements.
 * Every value resolves through --site-* tokens — never hardcode hex.
 *
 * Elements covered:
 *   .el-ai-concierge          — floating AI chat widget
 *   .el-loan-calculator       — sliders + amortization chart
 *   .el-quiz-funnel           — multi-step quiz
 *   .el-sticky-cta            — floating / bottom-bar CTA
 *   .el-virtual-tour          — sandboxed tour iframe
 *   .el-comparison-picker     — side-by-side compare table
 *   .el-social-proof-feed     — sonner-driven (rendered as portal toast)
 *   .el-geo-block             — geo-conditional wrapper
 *   .el-saved-items           — heart toggle + drawer
 *   .el-recently-viewed       — horizontal strip of last-N items
 *   .el-parallax-section      — scroll parallax bg
 *   .el-tilt-card             — 3D hover tilt
 *   .el-scroll-progress       — top-of-page reading progress bar
 */

/* ── Shared design defaults ─────────────────────────────────────────── */
.el-ai-concierge,
.el-loan-calculator,
.el-quiz-funnel,
.el-sticky-cta,
.el-virtual-tour,
.el-comparison-picker,
.el-saved-items,
.el-recently-viewed,
.el-parallax-section,
.el-tilt-card,
.el-scroll-progress {
  color: var(--site-fg, currentColor);
  font-family: var(--site-body-font, inherit);
}

/* ── AI Concierge ──────────────────────────────────────────────────── */
.el-ai-concierge {
  position: relative;
  /* How much of the layout viewport's bottom edge is hidden from the visitor.
   * The cookie banner and the soft keyboard both cover that same band, and a
   * position:fixed banner sits at the LAYOUT viewport bottom — so once the
   * keyboard is up it covers the banner too. Clearing the SUM double-counted
   * the overlap and shoved the panel a whole banner-height too high.
   * --ai-concierge-cc-residual is the part of the banner the keyboard is not
   * already hiding, and is the only part the panel height must give up. */
  --ai-concierge-obscured: max(
    var(--ai-concierge-cc-lift, 0px),
    var(--ai-concierge-kb-inset, 0px)
  );
  --ai-concierge-cc-residual: max(
    0px,
    calc(var(--ai-concierge-cc-lift, 0px) - var(--ai-concierge-kb-inset, 0px))
  );
}
.el-ai-concierge__launcher {
  position: fixed;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  /* Keep the visible target WCAG-sized before the icon-only mobile rules apply. */
  min-width: 44px;
  min-height: 44px;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  background: var(--ai-concierge-accent, var(--site-accent, transparent));
  color: var(--ai-concierge-accent-fg, var(--site-accent-fg, var(--site-bg, currentColor)));
  border: 1px solid color-mix(
    in srgb,
    var(--ai-concierge-accent-fg, var(--site-accent-fg, currentColor)) 30%,
    transparent
  );
  border-radius: var(--ai-concierge-radius, 999px);
  box-shadow:
    0 0 0 3px color-mix(
      in srgb,
      var(--ai-concierge-bg, var(--site-surface, Canvas)) 86%,
      transparent
    ),
    var(--ai-concierge-shadow, 0 12px 32px -12px rgba(0, 0, 0, 0.35));
  isolation: isolate;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.el-ai-concierge__launcher svg:not(.el-eeva-ai-mark),
.el-ai-concierge__send svg:not(.el-eeva-ai-mark),
.el-ai-concierge__brand-mark svg:not(.el-eeva-ai-mark) {
  color: inherit;
  stroke: currentColor;
}
/* The composer's leading EEva AI mark (owner 2026-11-10: the mark on inputs):
   inside the field's left edge, the text starts after it. */
.el-ai-concierge__field {
  position: relative;
  flex: 1;
  display: flex;
  min-width: 0;
}
.el-ai-concierge__form .el-ai-concierge__field > .el-ai-concierge__input {
  padding-inline-start: 2.25rem;
}
.el-ai-concierge__input-mark {
  position: absolute;
  inset-inline-start: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.el-ai-concierge__launcher:hover {
  transform: translateY(-2px);
  border-color: color-mix(
    in srgb,
    var(--ai-concierge-accent-fg, var(--site-accent-fg, currentColor)) 54%,
    transparent
  );
  box-shadow:
    0 0 0 3px color-mix(
      in srgb,
      var(--ai-concierge-bg, var(--site-surface, Canvas)) 92%,
      transparent
    ),
    0 16px 36px -12px rgba(0, 0, 0, 0.45);
}
.el-ai-concierge__launcher:focus-visible {
  outline: 3px solid var(--ai-concierge-accent-fg, var(--site-accent-fg, currentColor));
  outline-offset: 3px;
  box-shadow:
    0 0 0 6px color-mix(
      in srgb,
      var(--ai-concierge-accent, var(--site-accent, currentColor)) 72%,
      var(--ai-concierge-bg, var(--site-surface, Canvas))
    ),
    var(--ai-concierge-shadow, 0 12px 32px -12px rgba(0, 0, 0, 0.35));
}
.el-ai-concierge--bottom-right .el-ai-concierge__launcher,
.el-ai-concierge--bottom-right .el-ai-concierge__panel {
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
}
.el-ai-concierge--bottom-left .el-ai-concierge__launcher,
.el-ai-concierge--bottom-left .el-ai-concierge__panel {
  left: max(1.25rem, env(safe-area-inset-left));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
}
.el-ai-concierge--inline .el-ai-concierge__launcher {
  position: static;
}
/* LAUNCHERFIT 2026-09-06 — the dismiss control, and the state it produces.
 *
 * MEASURED on production 2026-09-06 at 1440x900 on /, /audit-readiness-checker,
 * /roi-calculator and /hotma-compliance: the concierge element rendered ONE
 * control and zero dismiss affordances, and its 320x44 box sat on top of an H2
 * and, on two routes, on the footer's own links.
 *
 * The control is a sibling, placed from the launcher's measured rect by
 * AIConciergeRenderer — the launcher is fixed and its bottom offset is an
 * inline custom property a site runtime rewrites on scroll, so no static
 * selector can follow it. Only `left`/`top` come from JS; everything visual is
 * here, where a tenant's own stylesheet can still reach it.
 *
 * Dismissing collapses the pill to `[data-launcher-collapsed="true"]`: the same
 * 44x44 icon-only circle the phone blocks below already define, at every width.
 * The assistant stays reachable — see the renderer for why removing it would be
 * the worse defect. */
.el-ai-concierge__launcher-dismiss {
  position: fixed;
  z-index: 61;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  /* RED WITH A WHITE X (owner, 2026-09-11). It was a white disc with dark ink,
   * which on the green launcher pill read as part of the pill rather than as
   * the control that removes it. Red is the one colour on this palette that
   * only ever means "this closes", and white-on-red clears the contrast floor
   * where dark-on-white at 22px did not stand out against the pill behind it.
   * Literal values, not tokens: --site-danger is the form-error red and moves
   * with validation styling, which must not drag this control with it.
   * Guard: AIConciergeRenderer.launcherFit.test.tsx. */
  background: #b91c1c;
  color: #ffffff;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  line-height: 1;
  /* The visible box is 22px so it does not crowd the pill it sits on, and the
   * TAP target is padded back out to the 44px WCAG floor by a transparent
   * pseudo-element rather than by growing the visible chrome. */
}
.el-ai-concierge__launcher-dismiss::after {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: inherit;
}
.el-ai-concierge__launcher-dismiss:hover {
  /* Darken on hover and keep the white X, matching the site's other buttons,
   * which darken rather than invert. */
  background: #991b1b;
  border-color: rgba(255, 255, 255, 0.85);
}
.el-ai-concierge__launcher-dismiss:focus-visible {
  outline: 3px solid var(--ai-concierge-accent, var(--site-accent, currentColor));
  outline-offset: 2px;
}
.el-ai-concierge:not(.el-ai-concierge--inline)
  .el-ai-concierge__launcher[data-launcher-collapsed="true"] {
  width: 44px;
  min-width: 44px;
  max-inline-size: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  gap: 0;
  justify-content: center;
}
.el-ai-concierge--inline .el-ai-concierge__panel {
  position: static;
  margin-top: 0.75rem;
}
/* PHONE-WIDTH FLOATING LAUNCHER — two forms, one switch.
 *
 * MEASURED on production 2026-09-03: website 109 had `launchLabelShort`
 * ("Speak with EEva AHIA") written to the element and served in the page HTML,
 * and AIConciergeRenderer renders `<span>{isPhoneWidth ? launchLabelShort :
 * launchLabel}</span>` — yet the 390x844 capture still showed a mute 44x44
 * circle. Both blocks below ended in an UNCONDITIONAL
 * `… .el-ai-concierge__launcher > span { display: none }`, so no wording could
 * ever reach a pixel no matter what the prop said.
 *
 * The switch is `[data-short-label="true"]`, stamped by the renderer ONLY when
 * `props.launchLabelShort` is a non-empty string. A tenant that never set the
 * prop keeps the identical 44x44 icon-only circle it ships today — that is why
 * the circle rules carry `:not([data-short-label="true"])` rather than being
 * overridden afterwards by source order.
 *
 * The labelled form is a COMPACT pill, not a bar: `width: auto` so it is only
 * as wide as its own wording, `white-space: nowrap` + ellipsis so it can never
 * become the four-line block that covered the hero CTA, and a `max-width` cap
 * so a long short-label still cannot flood the bottom row that the primary CTA
 * and the mobile action dock share. Vertical clearance from those two is owned
 * by the site's own shared block (`body:has(.ee-final-cta) … { bottom: 72px }`
 * and `.ee-concierge-cta-collision { bottom: 128px }`) — deliberately not
 * duplicated here.
 *
 * Both blocks are kept byte-identical to each other on purpose: the container
 * query serves site shells that publish `--site-bp`, the media query serves
 * every other phone. Changing one without the other is the drift this pair has
 * produced before.
 */
@container site style(--site-bp: mobile) {
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__launcher:not([data-short-label="true"]) {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    gap: 0;
    justify-content: center;
  }
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__launcher:not([data-short-label="true"]) > span {
    display: none;
  }
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__launcher[data-short-label="true"] {
    width: auto;
    min-width: 44px;
    max-width: min(calc(100vw - 6.5rem), 17rem);
    height: auto;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    gap: 0.45rem;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
  }
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__launcher[data-short-label="true"] > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (max-width: 480px) {
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__launcher:not([data-short-label="true"]) {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    gap: 0;
    justify-content: center;
  }
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__launcher:not([data-short-label="true"]) > span {
    display: none;
  }
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__launcher[data-short-label="true"] {
    width: auto;
    min-width: 44px;
    max-width: min(calc(100vw - 6.5rem), 17rem);
    height: auto;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    gap: 0.45rem;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
  }
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__launcher[data-short-label="true"] > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.el-ai-concierge__panel {
  position: fixed;
  z-index: 60;
  width: min(
    380px,
    calc(
      100vw - max(
        2.5rem,
        calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 1rem)
      )
    )
  );
  height: min(560px, calc(100vh - 6rem));
  height: min(
    560px,
    calc(
      100dvh - max(
        6rem,
        calc(env(safe-area-inset-top) + env(safe-area-inset-bottom) + 4rem)
      )
    )
  );
  display: flex;
  flex-direction: column;
  background: var(--ai-concierge-bg, var(--site-surface, transparent));
  border-radius: var(--ai-concierge-radius, var(--site-radius-lg, 16px));
  box-shadow: var(--ai-concierge-shadow, 0 24px 64px -20px rgba(0, 0, 0, 0.45));
  border: 1px solid var(--site-border, transparent);
  overflow: hidden;
  animation: ai-concierge-panel-enter 180ms ease-out both;
}
.el-ai-concierge__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ai-concierge-accent-fg, var(--site-accent-fg, currentColor)) 20%, transparent);
  background: var(--ai-concierge-accent, var(--site-accent, transparent));
  color: var(--ai-concierge-accent-fg, var(--site-accent-fg, var(--site-bg, currentColor)));
}
.el-ai-concierge__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.el-ai-concierge__brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--ai-concierge-accent-fg, var(--site-accent-fg, currentColor)) 16%, transparent);
  color: inherit;
}
.el-ai-concierge__header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: inherit;
  overflow-wrap: break-word;
}
.el-ai-concierge__close {
  background: var(--site-surface, var(--site-bg, transparent));
  border: 1px solid color-mix(in srgb, var(--ai-concierge-accent, var(--site-accent, currentColor)) 22%, transparent);
  border-radius: 10px;
  cursor: pointer;
  color: var(--site-accent-on-light, var(--ai-concierge-accent, var(--site-accent, currentColor)));
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  /* WCAG 2.5.5 minimum tap target — was rendering ~26×26. */
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 150ms ease;
}
.el-ai-concierge__close:hover {
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.5);
}
.el-ai-concierge__close svg {
  color: inherit;
  stroke: currentColor;
}
.el-ai-concierge__messages {
  flex: 1;
  overflow-y: auto;
  /* Without this, overscrolling the top/bottom of the log chains to the
     document and drags the page behind the open panel. */
  overscroll-behavior: contain;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--site-bg, transparent);
}
.el-ai-concierge__msg {
  max-width: 80%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
.el-ai-concierge__msg--user {
  align-self: flex-end;
  background: var(--ai-concierge-accent, var(--site-accent, transparent));
  color: var(--ai-concierge-accent-fg, var(--site-accent-fg, var(--site-bg, currentColor)));
  border-bottom-right-radius: 4px;
}
.el-ai-concierge__msg--bot {
  align-self: flex-start;
  background: var(--site-surface, transparent);
  color: var(--site-fg, currentColor);
  border: 1px solid var(--site-border, transparent);
  border-bottom-left-radius: 4px;
}
/* EEVA-AVATAR 2026-10-05 — the optional assistant avatar (element props
 * agentAvatarUrl / agentAvatarAlt). Every selector below matches a class the
 * renderer emits ONLY when an avatar is set and loads, so an element without
 * one paints exactly what it painted before. */
.el-ai-concierge__avatar {
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: color-mix(in srgb, var(--ai-concierge-accent, var(--site-accent, currentColor)) 18%, transparent);
}
.el-ai-concierge__avatar--header {
  width: 36px;
  height: 36px;
  /* A crisp ring on the dark header: 2px in the header's own foreground
   * colour, so it contrasts on any accent the tenant picks. */
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ai-concierge-accent-fg, var(--site-accent-fg, currentColor)) 92%, transparent);
}
/* EEva's character on the launcher (2026-11-10): her face takes the chat
 * icon's place whenever the element shows her face (the same switch as the
 * header). The pill trims its block padding so a 32px face keeps it at the
 * 44px target; the phone circle rules (padding 0, 44x44) centre the face.
 * The live eeva-face element carries the same classes, so it gets this box. */
.el-ai-concierge__avatar--launcher {
  width: 32px;
  height: 32px;
}
.el-ai-concierge__launcher[data-launcher-face="true"] {
  padding-block: 0.3rem;
  padding-inline-start: 0.35rem;
}
eeva-face.el-ai-concierge__avatar {
  overflow: hidden;
}
.el-ai-concierge__titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* The honesty cue beside a face: always rendered with the avatar. */
.el-ai-concierge__ai-label {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--ai-concierge-accent-fg, var(--site-accent-fg, currentColor)) 84%, transparent);
}
.el-ai-concierge__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--site-border, transparent);
  background: var(--site-surface, transparent);
}
.el-ai-concierge__input {
  flex: 1;
  border: 1px solid var(--site-border, transparent);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  background: var(--site-bg, transparent);
  color: var(--site-fg, currentColor);
}
.el-ai-concierge__send {
  min-width: 48px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-concierge-accent, var(--site-accent, transparent));
  color: var(--ai-concierge-accent-fg, var(--site-accent-fg, var(--site-bg, currentColor)));
  border: 0;
  border-radius: 10px;
  padding: 0 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.el-ai-concierge__send:disabled {
  opacity: 0.5;
  cursor: progress;
}
/* Confirm-before-execute CTA for a grounded concierge action (buy/book/lead). */
/* Walkthrough media (public CDN video link / step images) on assistant replies. */
/* Per-message thumbs feedback on assistant replies. */
/* TOMBSTONE — `.el-ai-concierge__checked*` moved to the shared
 * assistant-markdown stylesheet as `.md-sources*`
 * (public/css/markdown-display.css — the stylesheet for THE ONE EEva reply
 * renderer, src/shared/eeva-reply/, vendored from ExactOps' protocol core).
 *
 * The old rules were the browser's own defaults with the colour turned down: a
 * `\25B8` text triangle, `list-style: disc`, opacity 0.72. Against a designed
 * answer bubble that read as unfinished, which is what the owner reported as
 * "looks off". The replacement is a bordered summary chip with a drawn chevron
 * and a list of ruled rows.
 *
 * The rules are DELETED rather than left in place: they styled class names no
 * renderer emits any more, and dead CSS that still matches nothing is exactly
 * how a future reader concludes the receipt is styled here when it is not. */
/* A bottom-anchored cookie consent banner (er-interactive.css, z-index 9999,
 * full-bleed below 480px) sits exactly where the floating launcher lives. The
 * banner's --cc-reserve mechanism pads BODY, which only moves flow content —
 * a position:fixed peer like this launcher gets no offset, so on
 * exactestate.com the banner covered 100% of the 44px launcher and every tap
 * landed on the banner's privacy-policy link instead of opening chat.
 * CookieConsentRenderer toggles html[data-cookie-banner="visible"] for exactly
 * this window, so key off it: raise the launcher/panel above the banner AND
 * lift them clear of the reserved band so they never cover the banner's own
 * Accept/Decline buttons. The lift is capped at 40dvh so an over-generous
 * per-site reserve cannot park the launcher off-screen; the z-index keeps it
 * tappable even in that clamped case. Everything reverts the moment the
 * attribute goes away.
 */
html[data-cookie-banner="visible"] .el-ai-concierge:not(.el-ai-concierge--inline) {
  --ai-concierge-cc-lift: min(calc(var(--cc-reserve, 96px) + 0.75rem), 40dvh);
}
@container site style(--site-bp: mobile) {
  html[data-cookie-banner="visible"] .el-ai-concierge:not(.el-ai-concierge--inline) {
    --ai-concierge-cc-lift: min(calc(var(--cc-reserve-mobile, 240px) + 0.75rem), 40dvh);
  }
}
@media (max-width: 768px) {
  html[data-cookie-banner="visible"] .el-ai-concierge:not(.el-ai-concierge--inline) {
    --ai-concierge-cc-lift: min(calc(var(--cc-reserve-mobile, 240px) + 0.75rem), 40dvh);
  }
}
html[data-cookie-banner="visible"] .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__launcher,
html[data-cookie-banner="visible"] .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__panel {
  /* Above .el-cookie-consent (9999). Reachability must not depend on the
     lift arithmetic clearing every possible banner height. */
  z-index: 10000;
  bottom: calc(
    max(1.25rem, env(safe-area-inset-bottom))
    + var(--ai-concierge-obscured, 0px)
  );
}
/* Keep the panel inside the part of the viewport the visitor can actually see.
 *
 * --ai-concierge-cc-lift: the cookie-banner band (above). Reached only via
 *   --ai-concierge-obscured / --ai-concierge-cc-residual, never added to the
 *   keyboard inset directly — see the note on .el-ai-concierge.
 * --ai-concierge-kb-inset / --ai-concierge-vv: published by
 *   AIConciergeRenderer from the VisualViewport API while the panel is open.
 *   The tenant viewport meta has no interactive-widget, so the default
 *   resizes-visual applies and the soft keyboard shrinks NEITHER the layout
 *   viewport NOR 100dvh — without these two the composer renders underneath
 *   the keyboard. Both are unset until the panel mounts, so the var()
 *   fallbacks (0px / 100dvh) reproduce the previous geometry exactly and
 *   nothing is read at render time.
 */
.el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__panel {
  bottom: calc(
    max(1.25rem, env(safe-area-inset-bottom))
    + var(--ai-concierge-obscured, 0px)
  );
  height: max(
    220px,
    min(
      560px,
      calc(
        var(--ai-concierge-vv, 100dvh) - max(
          6rem,
          calc(env(safe-area-inset-top) + env(safe-area-inset-bottom) + 4rem)
        ) - var(--ai-concierge-cc-residual, 0px)
      )
    )
  );
}

/* ── Mobile sheet ──────────────────────────────────────────────────────
 * Below 480px the popover rendered as a shrunken desktop card (351x560 =
 * 60% of a 390x844 viewport). Make it a real sheet: full-bleed inside the
 * safe area, tall enough to read a conversation in. The composer also gets
 * an explicit 16px font — 'font: inherit' computed to 13.35px, under iOS
 * Safari's 16px threshold, so focusing it zoomed the whole page.
 * Must stay AFTER the lifted-panel height rule above so the sheet height
 * wins at equal specificity.
 */
/* The container-query twin of the phone sheet below. These two blocks must
 * stay identical: a browser that supports style() container queries takes this
 * one, everything else takes the @media twin, and a fix applied to only one of
 * them is a fix half the phones never see. */
@container site style(--site-bp: mobile) {
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    width: auto;
    height: var(--ai-concierge-vv, 100dvh);
    max-height: var(--ai-concierge-vv, 100dvh);
    border-radius: 0;
    border: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__panel
    > .el-ai-concierge__header {
    padding-top: calc(0.75rem + env(safe-area-inset-top));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(0.85rem + env(safe-area-inset-right));
  }
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__close {
    min-width: 44px;
    min-height: 44px;
  }
  .el-ai-concierge__input {
    font-size: 16px;
  }
}
/* ── Phone: a FULL-SCREEN sheet ────────────────────────────────────────
 * Owner, 2026-09-04, verbatim: "for the chat bot, you show it open on phone
 * but it is not the full height it should be full width and height with clear
 * exit."
 *
 * MEASURED before this change, from the two rules this block replaces: at
 * <=480 the panel inset itself 0.5rem on each side, sat 1.25rem off the
 * bottom, and capped its height at min(80dvh, vv - 4rem). On a 390x844 phone
 * that is 374 wide by at most 675 tall — 77% of the screen, with page content
 * visible around three edges. That is what the owner is describing.
 *
 * Now: inset 0 on all four sides, height 100dvh (with the visualViewport
 * height taking over while the soft keyboard is up, which is what
 * --ai-concierge-vv is for), no radius, no border, and the SAFE AREA handled
 * as padding INSIDE the sheet rather than as an inset that shrinks it — a
 * full-bleed sheet must reach the physical edges of the display and keep its
 * controls out of the notch, not stop short of both.
 *
 * The cookie-banner residual is deliberately dropped here: a full-screen modal
 * sheet is above the banner, so reserving room for it would leave a strip of
 * page showing for no reason. The lifted-panel rule above still applies to the
 * desktop popover, which is what it was written for.
 */
@media (max-width: 480px) {
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    width: auto;
    height: var(--ai-concierge-vv, 100dvh);
    max-height: var(--ai-concierge-vv, 100dvh);
    border-radius: 0;
    border: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__panel
    > .el-ai-concierge__header {
    padding-top: calc(0.75rem + env(safe-area-inset-top));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(0.85rem + env(safe-area-inset-right));
  }
  /* The clear exit. 44x44 is the WCAG 2.5.5 floor; it was 40x40, and on a
   * full-screen sheet the close control is the ONLY way out, so it is the one
   * target that must not be borderline. */
  .el-ai-concierge:not(.el-ai-concierge--inline) .el-ai-concierge__close {
    min-width: 44px;
    min-height: 44px;
  }
  .el-ai-concierge__input {
    font-size: 16px;
  }
}

@keyframes ai-concierge-panel-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .el-ai-concierge__panel {
    animation-duration: 1ms;
    animation-iteration-count: 1;
  }
}

/* ── Loan Calculator ───────────────────────────────────────────────── */
.el-loan-calculator {
  background: var(--site-surface, transparent);
  border: 1px solid var(--site-border, transparent);
  border-radius: var(--site-radius-lg, 16px);
  --el-padding-default: 1.5rem;
  display: grid;
  gap: 1rem;
}
.el-loan-calculator__sliders {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@container site style(--site-bp: tablet) or style(--site-bp: desktop) {
  .el-loan-calculator__sliders {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 768px) {
  .el-loan-calculator__sliders {
    grid-template-columns: repeat(3, 1fr);
  }
}
.el-loan-calculator__slider label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--site-muted, currentColor);
  margin-bottom: 0.4rem;
}
.el-loan-calculator__slider label strong {
  font-size: 1rem;
  color: var(--site-fg, currentColor);
}
.el-loan-calculator__slider input[type="range"] {
  width: 100%;
  accent-color: var(--site-accent, currentColor);
}
.el-loan-calculator__results {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr 1fr;
  padding: 1rem;
  background: var(--site-bg, transparent);
  border-radius: var(--site-radius-md, 12px);
}
.el-loan-calculator__result-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--site-muted, currentColor);
}
.el-loan-calculator__result-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--site-fg, currentColor);
}
.el-loan-calculator__chart {
  width: 100%;
  height: 220px;
}

/* ── Quiz Funnel ───────────────────────────────────────────────────── */
.el-quiz-funnel {
  background: var(--site-surface, transparent);
  border: 1px solid var(--site-border, transparent);
  border-radius: var(--site-radius-lg, 16px);
  --el-padding-default: 1.75rem;
  max-width: 640px;
  margin-inline: auto;
}
/* Nested quiz-funnel: cap the WRAPPER at the renderer card's max-width
   so the wrapper bg (painted from --el-bg via the .el bridge) doesn't
   extend past the card and appear as a square gutter on either side.
   See the matching .el--form rule in er-content.css for the rationale. */
:where(.el .el).el--quiz-funnel {
  max-width: 640px;
  margin-inline: auto;
}
.el-quiz-funnel__progress {
  height: 6px;
  background: var(--site-border, transparent);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.el-quiz-funnel__progress-fill {
  height: 100%;
  background: var(--site-accent, transparent);
  transition: width 240ms ease;
}
.el-quiz-funnel__prompt {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--site-fg, currentColor);
  word-break: break-word;
  overflow-wrap: break-word;
}
.el-quiz-funnel__options {
  display: grid;
  gap: 0.5rem;
}
.el-quiz-funnel__option {
  text-align: left;
  background: var(--site-bg, transparent);
  border: 1px solid var(--site-border, transparent);
  color: var(--site-fg, currentColor);
  padding: 0.85rem 1rem;
  border-radius: var(--site-radius-md, 12px);
  font: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.el-quiz-funnel__option:hover {
  border-color: var(--site-accent, transparent);
}
.el-quiz-funnel__option[aria-pressed="true"] {
  border-color: var(--site-accent, transparent);
  background: color-mix(in srgb, var(--site-accent, transparent) 12%, var(--site-bg, transparent));
}
.el-quiz-funnel__nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
  gap: 0.5rem;
}
.el-quiz-funnel__result {
  text-align: center;
  padding-block: 1rem;
}
.el-quiz-funnel__result h3 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: var(--site-fg, currentColor);
}
.el-quiz-funnel__result p {
  color: var(--site-muted, currentColor);
  margin: 0 0 1rem;
}
.el-quiz-funnel__cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--site-accent, transparent);
  color: var(--site-on-accent, currentColor);
  border-radius: var(--site-radius-md, 12px);
  text-decoration: none;
  font-weight: 600;
}

/* ── Sticky CTA ─────────────────────────────────────────────────────── */
.el-sticky-cta {
  position: fixed;
  z-index: 55;
  transition: transform 240ms ease, opacity 240ms ease;
}
.el-sticky-cta[data-hidden="true"] {
  opacity: 0;
  transform: translateY(120%);
  pointer-events: none;
}
.el-sticky-cta--bottom-bar {
  left: 0;
  right: 0;
  bottom: 0;
  --el-padding-default: 0.85rem 1rem;
  background: var(--site-surface, transparent);
  border-top: 1px solid var(--site-border, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.el-sticky-cta--floating-button {
  right: 1.25rem;
  bottom: 1.25rem;
}
.el-sticky-cta--side-tab {
  right: 0;
  top: 40%;
  writing-mode: vertical-rl;
  transform-origin: 100% 50%;
  --el-padding-default: 0.75rem 0.5rem;
}
.el-sticky-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--site-accent, transparent);
  color: var(--site-on-accent, currentColor);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.35);
}
.el-sticky-cta__close {
  background: transparent;
  border: 0;
  color: var(--site-muted, currentColor);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.4rem;
}

/* ── Virtual Tour ──────────────────────────────────────────────────── */
.el-virtual-tour {
  position: relative;
  width: 100%;
  background: var(--el-bg, var(--site-bg, transparent));
  border-radius: var(--el-radius, var(--site-radius-lg, 16px));
  box-shadow: var(--el-shadow, none);
  overflow: hidden;
}
.el-virtual-tour[data-aspect="16:9"] { aspect-ratio: 16 / 9; }
.el-virtual-tour[data-aspect="4:3"] { aspect-ratio: 4 / 3; }
.el-virtual-tour[data-aspect="1:1"] { aspect-ratio: 1 / 1; }
.el-virtual-tour[data-aspect="square"] { aspect-ratio: 1 / 1; }
.el-virtual-tour[data-aspect="tall"] { aspect-ratio: 9 / 16; }
.el-virtual-tour[data-aspect="full-screen"] { aspect-ratio: auto; min-height: 70vh; }
.el-virtual-tour__iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.el-virtual-tour__poster {
  position: absolute;
  inset: 0;
  background-size: var(--el-object-fit, cover);
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.el-virtual-tour__loading {
  color: var(--site-on-accent, currentColor);
  background: color-mix(in srgb, var(--site-bg, transparent) 60%, transparent);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
}

/* ── Comparison Picker ─────────────────────────────────────────────── */
.el-comparison-picker {
  display: grid;
  gap: 1rem;
}
.el-comparison-picker__chooser {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.el-comparison-picker__chip {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--site-border, transparent);
  background: var(--site-bg, transparent);
  color: var(--site-fg, currentColor);
  cursor: pointer;
}
.el-comparison-picker__chip[aria-pressed="true"] {
  background: var(--site-accent, transparent);
  color: var(--site-on-accent, currentColor);
  border-color: transparent;
}
.el-comparison-picker__table {
  width: 100%;
  border-collapse: collapse;
}
.el-comparison-picker__table th,
.el-comparison-picker__table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--site-border, transparent);
  font-size: 0.9rem;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: break-word;
}
.el-comparison-picker__table th {
  background: var(--site-bg, transparent);
  color: var(--site-muted, currentColor);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}
.el-comparison-picker__empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--site-muted, currentColor);
  background: var(--site-bg, transparent);
  border-radius: var(--site-radius-md, 12px);
}

/* ── Geo Block ─────────────────────────────────────────────────────── */
.el-geo-block {
  display: contents;
}
.el-geo-block[data-state="hidden"] {
  display: none;
}

/* ── Saved Items ───────────────────────────────────────────────────── */
.el-saved-items {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.el-saved-items__toggle {
  background: transparent;
  border: 0;
  padding: 0.4rem;
  cursor: pointer;
  color: var(--site-muted, currentColor);
  transition: color 160ms ease, transform 160ms ease;
}
.el-saved-items__toggle[aria-pressed="true"] {
  color: var(--site-accent, currentColor);
  transform: scale(1.05);
}
.el-saved-items__drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: min(360px, 100vw);
  background: var(--site-surface, transparent);
  z-index: 70;
  box-shadow: -16px 0 48px -16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  transition: transform 240ms ease;
}
.el-saved-items__drawer[data-side="right"] { right: 0; }
.el-saved-items__drawer[data-side="left"] { left: 0; }
.el-saved-items__drawer[data-open="false"][data-side="right"] { transform: translateX(100%); }
.el-saved-items__drawer[data-open="false"][data-side="left"] { transform: translateX(-100%); }
.el-saved-items__drawer-header {
  padding: 1rem;
  border-bottom: 1px solid var(--site-border, transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.el-saved-items__drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  margin: 0;
  list-style: none;
}
.el-saved-items__drawer-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--site-muted, currentColor);
}

/* ── Recently Viewed ───────────────────────────────────────────────── */
.el-recently-viewed {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
}
.el-recently-viewed__item {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: var(--site-surface, transparent);
  border: 1px solid var(--site-border, transparent);
  border-radius: var(--site-radius-md, 12px);
  overflow: hidden;
  text-decoration: none;
  color: var(--site-fg, currentColor);
  display: flex;
  flex-direction: column;
}
.el-recently-viewed__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.el-recently-viewed__title {
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: break-word;
}
.el-recently-viewed__empty {
  padding: 1rem;
  color: var(--site-muted, currentColor);
  font-size: 0.9rem;
}

/* ── Parallax Section ──────────────────────────────────────────────── */
.el-parallax-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--site-radius-lg, 16px);
}
.el-parallax-section__bg {
  position: absolute;
  inset: -10% 0;
  background-size: cover;
  background-position: center;
  will-change: transform;
}
.el-parallax-section__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.el-parallax-section__content {
  position: relative;
  z-index: 1;
  padding: clamp(1.5rem, 4vw, 3rem);
}
@media (prefers-reduced-motion: reduce) {
  .el-parallax-section__bg { transform: none !important; }
}

/* ── Tilt Card ─────────────────────────────────────────────────────── */
.el-tilt-card {
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 200ms ease;
  will-change: transform;
}
.el-tilt-card__inner {
  display: block;
  border-radius: var(--site-radius-lg, 16px);
  background: var(--site-surface, transparent);
  border: 1px solid var(--site-border, transparent);
  padding: 1.25rem;
}
.el-tilt-card__glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--tilt-glare-x, 50%) var(--tilt-glare-y, 50%), rgba(255, 255, 255, var(--tilt-glare-opacity, 0)) 0%, transparent 60%);
  transition: background-position 80ms linear;
}
@media (prefers-reduced-motion: reduce) {
  .el-tilt-card { transform: none !important; }
}

/* ── Scroll Progress ───────────────────────────────────────────────── */
.el-scroll-progress {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 65;
  background: transparent;
  pointer-events: none;
}
.el-scroll-progress[data-position="top"] { top: 0; }
.el-scroll-progress[data-position="bottom"] { bottom: 0; }
.el-scroll-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--site-accent, transparent);
  transition: width 80ms linear;
}
