  :root {
    --blue-900: #0a1e3d;
    --blue-800: #0c2d5a;
    --blue-700: #134a91;
    --blue-600: #1a5fb4;
    --blue-500: #2176d4;
    --blue-400: #4a9aef;
    --blue-300: #7cb8f5;
    --blue-200: #b3d7fa;
    --blue-100: #dceefb;
    --blue-50:  #f0f7ff;
    --white: #ffffff;
  }
  /* Demo-page global resets removed for production embed */

  /* ══════════════════════════════════════════
     BUBBLE TRIGGER
     ══════════════════════════════════════════ */
  .chat-bubble-trigger {
    position: fixed; bottom: 28px; right: 28px; z-index: 9999;
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    border: none; cursor: pointer;
    box-shadow: 0 6px 24px rgba(10,30,61,0.35);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s;
    opacity: 0; transform: scale(0) translateY(20px);
  }
  .chat-bubble-trigger.visible {
    opacity: 1; transform: scale(1) translateY(0);
  }
  .chat-bubble-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(10,30,61,0.45);
  }
  .chat-bubble-trigger svg { width: 28px; height: 28px; color: white; }

  /* Pulse ring */
  .chat-bubble-trigger::before {
    content: ''; position: absolute; inset: -6px;
    border-radius: 50%; border: 2px solid var(--blue-400);
    animation: ringPulse 2.5s ease-out infinite;
    pointer-events: none;
  }
  @keyframes ringPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
  }
  /* V3: Second ring element (hidden until hover) */
  .chat-bubble-trigger::after {
    content: ''; position: absolute; inset: -4px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    pointer-events: none;
  }

  /* V3: Water ripple effect on hover (desktop only) */
  @media (hover: hover) {
    .chat-bubble-trigger:hover::before {
      animation: waterRipple 1.6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
      border: 2px solid rgba(74,154,239,0.5);
      inset: -4px;
    }
    .chat-bubble-trigger:hover::after {
      animation: waterRipple 1.6s cubic-bezier(0.2, 0.6, 0.3, 1) 0.35s infinite;
      border: 1.5px solid rgba(74,154,239,0.35);
    }
    .chat-bubble-trigger:hover {
      transform: scale(1.08);
      box-shadow:
        0 8px 32px rgba(10,30,61,0.40),
        0 0 0 0 rgba(74,154,239,0.2);
      animation: triggerBreathe 4.5s ease-in-out infinite, waterRippleGlow 1.6s cubic-bezier(0.2, 0.6, 0.3, 1) 0.7s infinite;
    }
  }
  @keyframes waterRipple {
    0%   { transform: scale(1); opacity: 0.6; }
    40%  { opacity: 0.35; }
    100% { transform: scale(2.4); opacity: 0; }
  }
  @keyframes waterRippleGlow {
    0%   { box-shadow: 0 8px 32px rgba(10,30,61,0.40), 0 0 0 0 rgba(74,154,239,0.18); }
    40%  { box-shadow: 0 8px 32px rgba(10,30,61,0.40), 0 0 0 14px rgba(74,154,239,0.06); }
    100% { box-shadow: 0 8px 32px rgba(10,30,61,0.40), 0 0 0 28px rgba(74,154,239,0); }
  }

  /* Unread badge */
  .chat-badge {
    position: absolute; top: -2px; right: -2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #ef4444; color: white;
    font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
    animation: badgePop 0.4s cubic-bezier(0.34,1.56,0.64,1) 1.2s both;
  }
  @keyframes badgePop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

  /* Greeting tooltip */
  .chat-greeting {
    position: fixed; bottom: 100px; right: 28px; z-index: 9998;
    background: var(--white); color: var(--blue-900);
    padding: 14px 20px; border-radius: 16px 16px 4px 16px;
    box-shadow: 0 8px 32px rgba(10,30,61,0.18);
    font-size: 0.9rem; font-weight: 500; max-width: 260px;
    opacity: 0; transform: translateY(10px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none;
    display: flex; align-items: flex-start; gap: 12px;
  }
  .chat-greeting.visible {
    opacity: 1; transform: translateY(0) scale(1);
  }
  .chat-greeting::after {
    content: ''; position: absolute; bottom: -8px; right: 24px;
    width: 0; height: 0;
    border-left: 8px solid transparent; border-right: 8px solid transparent;
    border-top: 8px solid var(--white);
  }
  .greeting-avatar {
    display: block; /* V4 FIX: consistent with welcome-avatar inline-gap fix */
    width: 36px; height: 36px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    border: 2px solid var(--blue-100);
  }
  .greeting-text { line-height: 1.4; }
  .greeting-text strong { color: var(--blue-700); }

  /* ══════════════════════════════════════════
     CHAT CARD
     ══════════════════════════════════════════ */
  .chat-card {
    position: fixed; bottom: 100px; right: 28px; z-index: 10000;
    width: 390px; background: var(--white);
    border-radius: 20px;
    box-shadow:
      0 24px 80px rgba(10,30,61,0.22),
      0 8px 24px rgba(10,30,61,0.08),
      0 0 0 1px rgba(10,30,61,0.04);
    overflow: hidden;
    opacity: 0; transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: all 0.45s cubic-bezier(0.34,1.56,0.64,1);
    /* V18: Viewport safety rail — never overflow the viewport */
    max-block-size: calc(100dvh - 100px - env(safe-area-inset-bottom, 0px) - 24px);
  }
  @supports not (height: 100dvh) {
    .chat-card {
      max-block-size: calc(100vh - 100px - 24px);
    }
  }
  .chat-card.open {
    opacity: 1; transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  /* ── Welcome screen ── */
  .welcome-screen {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 22px 28px 14px;
    background: linear-gradient(160deg, var(--blue-800) 0%, var(--blue-600) 100%);
    color: white; position: relative; overflow: hidden; perspective: 300px;
    min-height: 270px;
    max-height: 1000px;
    opacity: 1;
    z-index: 1;
    transition: min-height 0.8s cubic-bezier(0.25, 0.9, 0.35, 1),
                max-height 0.8s cubic-bezier(0.25, 0.9, 0.35, 1),
                padding 0.8s cubic-bezier(0.25, 0.9, 0.35, 1),
                opacity 0.5s ease;
  }

  /* ── Hero-to-focus transition ──
     When the user picks a topic, the welcome-screen is no longer the
     point of attention. It collapses fully and the quick-actions panel
     slides up to take over the card. The welcome-screen "falls behind"
     the lower content rather than sharing space with it. */
  .welcome-view.focused .welcome-screen {
    min-height: 0;
    max-height: 0;
    padding: 0 28px;
    opacity: 0;
    pointer-events: none;
    /* Pull the lower half up over where the welcome area used to sit */
    z-index: 0;
    transition:
      min-height 0.7s cubic-bezier(0.25, 0.9, 0.35, 1),
      max-height 0.7s cubic-bezier(0.25, 0.9, 0.35, 1),
      padding    0.7s cubic-bezier(0.25, 0.9, 0.35, 1),
      opacity    0.5s ease;
  }
  .welcome-view.focused .welcome-bg-photo,
  .welcome-view.focused .welcome-floaties {
    opacity: 0;
    transition: opacity 0.5s ease;
  }
  .welcome-view.focused .welcome-top-row,
  .welcome-view.focused .welcome-msg,
  .welcome-view.focused .ba-carousel,
  .welcome-view.focused .social-proof,
  .welcome-view.focused .welcome-logo-area,
  .welcome-view.focused .welcome-context-msg {
    opacity: 0 !important; pointer-events: none;
    max-height: 0 !important; margin: 0 !important; padding: 0 !important;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.6s cubic-bezier(0.25, 0.9, 0.35, 1),
                margin 0.5s ease, padding 0.5s ease;
  }
  /* Lift the whole lower stack above the collapsing welcome-screen so
     it reads as sliding up over the old hero area, not reflowing with it. */
  .welcome-view.focused .quick-actions,
  .welcome-view.focused .quick-answer-card,
  .welcome-view.focused .start-chat-row {
    position: relative;
    z-index: 2;
  }
  .welcome-view.focused .quick-actions {
    box-shadow: 0 -4px 20px rgba(10,30,61,0.06);
    padding-top: 18px;
  }
  .welcome-view.focused .start-chat-btn {
    box-shadow: 0 6px 28px rgba(33,118,212,0.35);
  }
  /* V18: In focused state, the lane card's internal CTA is primary.
     Hide the external start-chat-row to save ~60px (returns when unfocused). */
  .welcome-view.focused .start-chat-row {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  }
  .welcome-view.focused .start-chat-avatar-wrap {
    width: 36px;           /* open the slot to exactly the img's rendered size */
    margin-right: 0;       /* restore the row's flex gap alongside Michael */
    opacity: 1; transform: scale(1);
  }

  /* FAQ ENTRY MODE START */
  .welcome-view.faq-entry-mode .quick-chips-row {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.5s cubic-bezier(0.25, 0.9, 0.35, 1),
                opacity 0.4s ease, margin 0.4s ease, padding 0.4s ease;
  }
  .welcome-view.faq-entry-mode .social-proof {
    max-height: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, max-height 0.5s ease, margin 0.4s ease;
  }
  .welcome-view.faq-entry-mode .ba-carousel {
    max-height: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, max-height 0.5s ease;
  }
  .welcome-view.faq-entry-mode .quick-actions {
    background: var(--white);
    position: relative;
    z-index: 2;
    border-bottom: none;
    border-radius: 0;
    padding: 0 24px 2px;
  }
  /* The signature curve: the welcome-screen (blue/photo area) gets
     elliptical bottom corners so it curves inward at the bottom.
     The white card background shows through below the curve. */
  .welcome-view.faq-entry-mode .welcome-screen {
    border-radius: 0 0 50% 50% / 0 0 24% 24%;
    padding-bottom: 45px;
  }
  .welcome-view.faq-entry-mode .chip-preview {
    text-align: center;
    font-style: italic;
    opacity: 0.75;
    margin-bottom: 18px;
  }

  /* ── ARRIVAL SEQUENCE (FAQ CTA entry) ──
     Three-beat micro-narrative: connection → recognition → composition.
     Inspired by editorial mastheads — the status line reads like
     a wire-service slug, the context tag like a column header. */

  /* Avatar glow — soft diffused halo, pure transitions (no animation).
     Transitions work smoothly across beat changes; animations don't
     because removing the class yanks the animation instantly. */
  .welcome-view.faq-entry-mode .welcome-avatar-wrapper::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: none;
    background: transparent;
    box-shadow: 0 0 0 0 rgba(52,211,153,0);
    transition: box-shadow 1.6s cubic-bezier(0.25, 0.9, 0.35, 1);
    pointer-events: none;
  }
  .welcome-view.faq-entry-mode.arrival-beat-1 .welcome-avatar-wrapper::after {
    box-shadow:
      0 0 14px 5px rgba(52, 211, 153, 0.55),
      0 0 30px 12px rgba(52, 211, 153, 0.3),
      0 0 52px 22px rgba(52, 211, 153, 0.12);
  }
  .welcome-view.faq-entry-mode.arrival-beat-2 .welcome-avatar-wrapper::after {
    box-shadow:
      0 0 10px 4px rgba(52, 211, 153, 0.35),
      0 0 22px 8px rgba(52, 211, 153, 0.18),
      0 0 38px 14px rgba(52, 211, 153, 0.06);
  }

  /* Avatar scan — during canvas interlace reveal, hide real img */
  .welcome-avatar-wrapper.avatar-scan-active .welcome-avatar {
    opacity: 0 !important;
    transition: none;
  }
  .welcome-avatar-wrapper .avatar-scan-bw {
    position: absolute;
    top: 3px; left: 3px;
    width: calc(100% - 6px); height: calc(100% - 6px);
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
  }
  .welcome-avatar-wrapper.avatar-scan-active .avatar-scan-bw {
    opacity: 0.6;
  }
  .welcome-avatar-wrapper .avatar-scan-canvas {
    position: absolute;
    top: 3px; left: 3px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
  }
  /* Scan-line edge glow — moves with the reveal */
  .welcome-avatar-wrapper .avatar-scan-edge {
    position: absolute;
    left: 3px;
    width: calc(100% - 6px);
    height: 2px;
    background: linear-gradient(90deg,
      transparent 0%,
      rgba(255,255,255,0.45) 20%,
      rgba(255,255,255,0.7) 50%,
      rgba(255,255,255,0.45) 80%,
      transparent 100%);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.15s ease;
  }
  .welcome-avatar-wrapper.avatar-scan-active .avatar-scan-edge {
    opacity: 1;
  }
  /* 3D micro-squares — tiny voxels that pop up at the scan edge */
  .welcome-avatar-wrapper {
    perspective: 200px;
  }
  .avatar-scan-voxel {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.7);
    border-radius: 0.5px;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transform: translateZ(0px) scale(1);
    animation: voxelPop 0.38s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  }
  @keyframes voxelPop {
    0%   { opacity: 0; transform: translateZ(0px) scale(0.4); }
    25%  { opacity: 0.9; transform: translateZ(12px) scale(1.2); }
    60%  { opacity: 0.6; transform: translateZ(6px) scale(0.9); }
    100% { opacity: 0; transform: translateZ(0px) scale(0.3); }
  }

  /* Status line container — sits below .welcome-role.
     Fixed height always reserved in FAQ mode to prevent layout shift.
     Children positioned absolutely to overlap for crossfade. */
  .arrival-status-wrap {
    position: relative;
    height: 0;
    overflow: visible;
  }
  .welcome-view.faq-entry-mode .arrival-status-wrap {
    height: 28px;
  }
  .arrival-status-wrap .arrival-status-text,
  .arrival-status-wrap .arrival-context-tag {
    position: absolute;
    top: 0;
    left: 50%;
    width: max-content;
    text-align: center;
  }
  /* Each child gets its own transform so translateX(-50%) centering
     doesn't collide with the context-tag's translateY entrance. */
  .arrival-status-wrap .arrival-status-text {
    transform: translateX(-50%);
  }

  /* Beat 1: "connecting..." — wire-service slug aesthetic */
  .arrival-status-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(30, 60, 100, 0.8);
    padding-top: 6px;
    opacity: 0;
    transition: opacity 0.5s ease, letter-spacing 0.7s ease;
    /* Legibility banner — white wash behind text + animated line */
    background: rgba(255, 255, 255, 0.65);
    padding: 6px 14px 8px;
    border-radius: 4px;
  }
  .welcome-view.faq-entry-mode.arrival-beat-1 .arrival-status-text {
    opacity: 1;
    letter-spacing: 1.8px;
  }

  /* Signal handshake — faint base rail under CONNECTING */
  .arrival-status-text::before {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 14px;
    right: 14px;
    height: 1px;
    background: rgba(30, 60, 100, 0.15);
    border-radius: 0.5px;
  }
  /* Signal handshake — scanning bright segment */
  .arrival-status-text::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 14px;
    width: 26%;
    height: 1px;
    background: rgba(30, 60, 100, 0.55);
    border-radius: 0.5px;
    opacity: 0;
  }
  /* Activate sweep only during Beat 1 */
  .welcome-view.faq-entry-mode.arrival-beat-1 .arrival-status-text::after {
    animation: signalSweep 0.72s cubic-bezier(0.19, 1, 0.22, 1) 0.18s 2 both;
  }
  @keyframes signalSweep {
    0%   { left: -5%;  opacity: 0; }
    12%  { opacity: 0.82; }
    78%  { opacity: 0.82; }
    100% { left: 79%;  opacity: 0; }
  }

  /* Beat 2: context tag — editorial column header */
  .arrival-context-tag {
    font-family: 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 17.25px;
    color: #5eb8ff;
    padding-top: 5px;
    opacity: 0;
    transform: translateX(-50%) translateY(3px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    letter-spacing: -0.2px;
    white-space: nowrap;
  }
  .welcome-view.faq-entry-mode.arrival-beat-2 .arrival-context-tag {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  /* Hide connecting text when context tag arrives — opacity only, no layout shift */
  .welcome-view.faq-entry-mode.arrival-beat-2 .arrival-status-text {
    opacity: 0;
    pointer-events: none;
  }

  /* Hairline divider — draws from center outward between identity and question */
  .arrival-hairline {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0.18) 20%,
      rgba(255,255,255,0.22) 50%,
      rgba(255,255,255,0.18) 80%,
      rgba(255,255,255,0) 100%);
    margin: 14px auto 8px;
    transition: width 0.7s cubic-bezier(0.25, 0.9, 0.35, 1);
    position: relative;
    z-index: 1;
  }
  .welcome-view.faq-entry-mode.arrival-beat-2 .arrival-hairline {
    width: 55%;
  }

  /* Push the welcome-msg down slightly in FAQ mode for breathing room */
  .welcome-view.faq-entry-mode .welcome-msg {
    margin-top: 6px;
  }

  /* ── Bottom sheet: unified white surface below the blue header ── */
  .welcome-view.faq-entry-mode .quick-answer-card {
    border-radius: 0;
    border: none;
    margin: 0;
    background: var(--white);
    box-shadow: none;
    position: relative;
    z-index: 2;
  }
  .welcome-view.faq-entry-mode .quick-answer-card.visible {
    margin: 0;
    padding: 4px 24px;
  }
  /* FAQ-mode brand logo — white zone between answer bubble and placeholder text */
  .faq-brand-logo {
    display: none;
    text-align: center;
    background: transparent;
    padding: 0;
    margin: 0;
  }
  .faq-logo-inner {
    position: relative;
    display: inline-block;
  }
  .faq-logo-inner .sparkle-anchor {
    transform: scale(0.65);
  }
  .faq-brand-logo img {
    width: 170px;
    height: auto;
    object-fit: contain;
  }
  .welcome-view.faq-entry-mode .faq-brand-logo {
    display: block;
    position: relative;
    z-index: 3;
    margin-top: -32px;
  }
  .welcome-view.faq-entry-mode .start-chat-row {
    background: var(--white);
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 2px 20px 14px;
    border-radius: 0;
  }
  /* Rotating gradient border — nudge CTA in faq-entry-mode */
  .welcome-view.faq-entry-mode .start-chat-btn {
    overflow: visible;
  }
  .welcome-view.faq-entry-mode .start-chat-btn::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 16px; /* button 14px + 2px border */
    background: conic-gradient(from var(--border-angle, 0deg),
      #1a5fa8, #5eb8ff, #93d1ff, #1a5fa8);
    z-index: -1;
    animation: rotateBorderGradient 2.5s linear infinite;
    /* Mask out interior — only the 2px ring shows */
    padding: 2px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
  }
  @property --border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
  }
  @keyframes rotateBorderGradient {
    to { --border-angle: 360deg; }
  }
  /* Breathing text color pulse — no scale, synced */
  .welcome-view.faq-entry-mode .start-chat-btn > svg,
  .welcome-view.faq-entry-mode .start-chat-btn > span {
    animation: btnTextBreathe 3s ease-in-out infinite;
  }
  @keyframes btnTextBreathe {
    0%   { color: #ffffff; }
    50%  { color: #93d1ff; }
    100% { color: #ffffff; }
  }
  /* Icon jig — pop-up + wiggle hybrid (A+B) */
  .welcome-view.faq-entry-mode .start-chat-btn > svg {
    animation: btnTextBreathe 3s ease-in-out infinite, btnIconJig 4s ease-in-out infinite;
    transform-origin: center center;
  }
  @keyframes btnIconJig {
    0%, 65%, 100% { transform: scale(1) translateY(0) rotate(0deg); }
    70% { transform: scale(1.28) translateY(-2px) rotate(-10deg); }
    76% { transform: scale(1.25) translateY(-1px) rotate(10deg); }
    82% { transform: scale(1.15) translateY(0) rotate(-5deg); }
    88% { transform: scale(1.05) translateY(1px) rotate(0deg); }
    93% { transform: scale(1) translateY(0) rotate(0deg); }
  }
  /* FAQ ENTRY MODE END */

  /* Slow-panning pool photo behind everything */
  .welcome-bg-photo {
    position: absolute; inset: 0; z-index: 0;
    background-image: url('cleaning6.jpg');
    background-size: 202.5% auto;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.12;
    animation: bgPanRight 25s ease-in-out infinite alternate;
    transition: opacity 0.5s ease;
  }
  @keyframes bgPanRight {
    0%   { background-position: 30% center; }
    100% { background-position: 70% center; }
  }
  /* Background scan — interlace reveal on FAQ entry */
  .welcome-bg-photo.bg-scan-active {
    opacity: 0 !important;
    /* Keep animation running invisibly so it resumes at the right spot */
  }
  .welcome-screen .bg-scan-ghost {
    position: absolute; inset: 0; z-index: 0;
    background-image: url('cleaning6.jpg');
    background-size: 202.5% auto;
    background-position: 50% center;
    background-repeat: no-repeat;
    filter: grayscale(1) brightness(0.85);
    opacity: 0.55;
    pointer-events: none;
  }
  .welcome-screen .bg-scan-canvas {
    position: absolute; inset: 0; z-index: 0;
    pointer-events: none;
  }
  .welcome-screen .bg-scan-edge {
    position: absolute;
    left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg,
      transparent 0%,
      rgba(255,255,255,0.2) 15%,
      rgba(255,255,255,0.4) 50%,
      rgba(255,255,255,0.2) 85%,
      transparent 100%);
    pointer-events: none; z-index: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .welcome-screen .bg-scan-edge.active { opacity: 1; }
  .bg-scan-voxel {
    position: absolute;
    width: 5px; height: 5px;
    background: rgba(255,255,255,0.35);
    border-radius: 1px;
    pointer-events: none; z-index: 0;
    opacity: 0;
    transform: translateZ(0px) scale(1);
    animation: bgVoxelPop 0.45s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  }
  @keyframes bgVoxelPop {
    0%   { opacity: 0; transform: translateZ(0px) scale(0.3); }
    20%  { opacity: 0.7; transform: translateZ(8px) scale(1.1); }
    55%  { opacity: 0.4; transform: translateZ(4px) scale(0.85); }
    100% { opacity: 0; transform: translateZ(0px) scale(0.2); }
  }
  .welcome-screen::before { display: none; }
  .welcome-screen::after  { display: none; }

  /* ── Floaties ── */
  .welcome-floaties {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    overflow: hidden; transition: opacity 0.5s ease;
  }
  .welcome-drop {
    position: absolute; bottom: -10%; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.05) 55%, transparent 100%);
    will-change: transform, opacity;
    animation: welcomeFloatUp linear infinite;
  }
  @keyframes welcomeFloatUp {
    0%   { transform: translate3d(0, 0, 0);       opacity: 0; }
    8%   {                                          opacity: 1; }
    88%  {                                          opacity: 1; }
    100% { transform: translate3d(0, -320px, 0);   opacity: 0; }
  }

  .welcome-close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,0.12); border: none; border-radius: 8px;
    width: 30px; height: 30px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; z-index: 2;
  }
  .welcome-close:hover { background: rgba(255,255,255,0.25); }
  .welcome-close svg { width: 14px; height: 14px; color: white; }

  .welcome-avatar-wrapper {
    position: relative; margin-bottom: 16px; z-index: 1;
    transition: margin 0.8s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .welcome-avatar {
    display: block; /* V4 FIX: kill inline descender gap so wrapper is square → glow ring is circular, not oval */
    width: 72px; height: 72px; border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.3s ease, width 0.8s cubic-bezier(0.25, 0.9, 0.35, 1), height 0.8s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .welcome-avatar:hover { transform: scale(1.08); }
  .welcome-online {
    position: absolute; bottom: 2px; right: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #34d399; border: 2.5px solid var(--blue-700);
    animation: livingPulseHero 4.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite 0.8s;
  }
  @keyframes livingPulseHero {
    0%   { background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.35); }
    22%  { background: #3be8aa; box-shadow: 0 0 0 4px rgba(59,232,170,0.18); }
    48%  { background: #4ade80; box-shadow: 0 0 0 6px rgba(74,222,128,0.0); }
    68%  { background: #2dd4a0; box-shadow: 0 0 0 3px rgba(45,212,160,0.14); }
    100% { background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.35); }
  }

  /* Top row */
  .welcome-top-row {
    display: flex; flex-direction: column; align-items: center; gap: 0;
    width: 100%; position: relative; z-index: 1;
    transition: all 0.8s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .welcome-screen.activated .welcome-top-row {
    flex-direction: row; justify-content: center; gap: 14px;
  }
  .welcome-screen.activated .welcome-avatar-wrapper { margin-bottom: 0; }
  .welcome-screen.activated .welcome-avatar { width: 72px; height: 72px; }

  /* Name + role */
  .welcome-name-group {
    position: relative; z-index: 1;
    transition: all 0.8s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .welcome-name-group h3 {
    font-size: 1.05rem; font-weight: 700; margin-bottom: 2px;
    position: relative; z-index: 1;
    transition: font-size 0.8s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .welcome-name-group .welcome-role {
    font-size: 0.75rem; opacity: 1; margin-bottom: 14px;
    position: relative; z-index: 1;
    color: var(--blue-200); font-weight: 600;
    transition: margin 0.8s cubic-bezier(0.25, 0.9, 0.35, 1), font-size 0.8s ease;
  }
  .welcome-screen.activated .welcome-name-group { text-align: left; }
  .welcome-screen.activated .welcome-name-group h3 { font-size: 0.95rem; }
  .welcome-screen.activated .welcome-name-group .welcome-role { margin-bottom: 0; }

  /* Welcome message */
  .welcome-msg {
    font-size: 0.88rem; line-height: 1.55; opacity: 0.92;
    position: relative; z-index: 1; max-width: 300px;
    max-height: 100px; overflow: hidden; margin-top: 10px;
    text-align: center;
    transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.8s cubic-bezier(0.25, 0.9, 0.35, 1) 0.15s, margin 0.8s cubic-bezier(0.25, 0.9, 0.35, 1) 0.15s;
  }
  .welcome-screen.activated .welcome-msg {
    opacity: 0; transform: translateY(-6px);
    pointer-events: none; max-height: 0; margin-top: 0;
  }

  /* Welcome logo area */
  .welcome-logo-area {
    position: relative; z-index: 1;
    width: 160px; height: 72px; margin: 0 auto;
    opacity: 0; transform: scale(0.88);
    pointer-events: none; max-height: 0; overflow: visible;
    transition: opacity 0.9s ease 0.5s, transform 0.9s cubic-bezier(0.25, 0.9, 0.35, 1) 0.5s, max-height 0.8s cubic-bezier(0.25, 0.9, 0.35, 1) 0.3s, margin 0.8s cubic-bezier(0.25, 0.9, 0.35, 1) 0.3s;
  }
  .welcome-screen.activated .welcome-logo-area {
    opacity: 1; transform: scale(1);
    pointer-events: auto; max-height: 90px; margin: 8px auto 4px;
  }

  .welcome-context-msg {
    font-size: 0.84rem; line-height: 1.5; opacity: 0;
    position: relative; z-index: 1; max-width: 300px;
    color: rgba(255,255,255,0.92); transform: translateY(6px);
    max-height: 0; overflow: hidden; margin: 0;
    transition: opacity 0.8s ease 0.9s, transform 0.8s ease 0.9s, max-height 0.8s cubic-bezier(0.25, 0.9, 0.35, 1) 0.7s, margin 0.8s cubic-bezier(0.25, 0.9, 0.35, 1) 0.7s;
  }
  .welcome-screen.activated .welcome-context-msg {
    opacity: 1; transform: translateY(0); max-height: 80px; margin-top: 6px;
  }
  .welcome-logo-area img {
    width: 100%; height: 100%; object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.2));
    animation: miniLogoGlow 3s ease-in-out infinite;
  }

  /* Welcome sparkles */
  .wlogo-sparkle-anchor { position: absolute; width: 0; height: 0; pointer-events: none; }
  .wlogo-sparkle-pulse {
    position: absolute; left: 0; top: 0; width: 56px; height: 56px;
    border-radius: 50%; opacity: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.18) 38%, rgba(255,255,255,0.06) 60%, rgba(255,255,255,0) 72%);
  }
  .wlogo-sparkle-spin { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: visible; }
  .wlogo-sparkle-xhair { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; opacity: 0; }
  .wlogo-sp-arm { position: absolute; border-radius: 1px; }
  .wlogo-sp-arm-h { width: 40px; height: 2px; left: -20px; top: -1px; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%); }
  .wlogo-sp-arm-v { width: 2px; height: 40px; left: -1px; top: -20px; background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%); }
  .wlogo-sp-arm-d1 { width: 28px; height: 1.2px; left: -14px; top: -0.6px; transform: rotate(45deg); background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%); }
  .wlogo-sp-arm-d2 { width: 28px; height: 1.2px; left: -14px; top: -0.6px; transform: rotate(-45deg); background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%); }
  .wlogo-sp-core-glow { position: absolute; width: 18px; height: 18px; left: -9px; top: -9px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 40%, rgba(255,255,255,0) 80%); }
  .wlogo-sp-core-dot { position: absolute; width: 4.5px; height: 4.5px; left: -2.25px; top: -2.25px; border-radius: 50%; background: white; }

  .wsp1 > .wlogo-sparkle-pulse { animation: miniSpkPulse 7.0s ease-out infinite 0.0s; }
  .wsp1-spin { animation: miniSpkSpin 7.0s linear infinite 0.0s; }
  .wsp1 .wlogo-sparkle-xhair  { animation: miniSpkXhair 7.0s ease-out infinite 0.0s; }
  .wsp2 > .wlogo-sparkle-pulse { animation: miniSpkPulse 8.5s ease-out infinite 2.8s; }
  .wsp2-spin { animation: miniSpkSpin 8.5s linear infinite reverse 2.8s; }
  .wsp2 .wlogo-sparkle-xhair  { animation: miniSpkXhair 8.5s ease-out infinite 2.8s; }
  .wsp3 > .wlogo-sparkle-pulse { animation: miniSpkPulse 6.2s ease-out infinite 1.6s; }
  .wsp3-spin { animation: miniSpkSpin 6.2s linear infinite 1.6s; }
  .wsp3 .wlogo-sparkle-xhair  { animation: miniSpkXhair 6.2s ease-out infinite 1.6s; }

  /* Quick actions */
  .quick-actions {
    padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 8px;
    border-bottom: 1px solid var(--blue-50);
    flex-direction: column;
    transition: box-shadow 0.6s ease, max-height 0.4s cubic-bezier(0.25, 0.9, 0.35, 1),
                opacity 0.3s ease, padding 0.4s ease, margin 0.4s ease;
    max-height: 280px;
    overflow: visible;
  }
  /* V3: When a lane is selected, collapse the chip row */
  .quick-actions.qa-lane-collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
    overflow: hidden;
  }
  .quick-chips-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
  .quick-chip {
    background: var(--blue-50); border: 1.5px solid var(--blue-100);
    border-radius: 100px; padding: 8px 16px;
    font-family: 'Inter', sans-serif; font-size: 0.78rem;
    font-weight: 500; color: var(--blue-700);
    cursor: pointer; white-space: nowrap;
    position: relative;
    transform: scale(1);
    opacity: 1;
    overflow: hidden;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.25, 0.9, 0.35, 1),
                border-color 0.5s ease,
                color 0.4s ease,
                opacity 0.4s ease,
                box-shadow 0.5s ease;
  }
  /* Pseudo-element handles all background animation — text never moves */
  .quick-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: transparent;
    z-index: -1;
    transition: background-color 0.3s ease;
  }
  /* V3: Hovered chip — enlarges, pseudo-element pulses dark blue */
  .quick-chip.chip-hover {
    transform: scale(1.12);
    border-color: transparent;
    color: #fff;
    transition: color 0.15s ease, border-color 0.15s ease;
    animation: chipGlow 3s ease-in-out infinite;
  }
  .quick-chip.chip-hover::before {
    background-color: #0c2d5a;
    animation: chipPulse 3s ease-in-out infinite;
  }
  @keyframes chipPulse {
    0%   { background-color: #0c2d5a; }
    50%  { background-color: #1a5fb4; }
    100% { background-color: #0c2d5a; }
  }
  @keyframes chipGlow {
    0%   { box-shadow: 0 0 8px 2px rgba(33,118,212,0.25), 0 0 20px 6px rgba(33,118,212,0.12); }
    50%  { box-shadow: 0 0 12px 4px rgba(74,154,239,0.35), 0 0 30px 10px rgba(74,154,239,0.18); }
    100% { box-shadow: 0 0 8px 2px rgba(33,118,212,0.25), 0 0 20px 6px rgba(33,118,212,0.12); }
  }
  /* V3: Sibling chips — shrink and dim when another is hovered */
  .quick-chip.chip-sibling-shrink {
    transform: scale(0.92);
    opacity: 0.50;
  }
  /* C-1 fix 2026-05-06: class-based chip selection state.
     Replaces the inline style.background/borderColor/color mutations
     in the click handler. Now the welcomeClose handler can sweep
     `.chip-selected` cleanly, so a chip clicked-then-card-closed-without-pick
     no longer stays highlighted on re-open. Same convention is applied to
     .ctx-chip below — sets up the unified chipStateController (§13.4). */
  .quick-chip.chip-selected {
    background: var(--blue-200);
    border-color: var(--blue-400);
    color: var(--blue-900);
  }
  .ctx-chip.chip-selected {
    background: var(--blue-200, #bfdbfe);
    border-color: var(--blue-400, #60a5fa);
  }
  .quick-chip .chip-season-icon { margin-right: 4px; font-size: 0.82rem; }
  .chip-preview {
    font-size: 0.72rem; line-height: 1.5;
    color: var(--blue-600); background: var(--blue-50);
    border-radius: 10px; padding: 8px 14px; margin: 6px 0 0;
    border-left: 3px solid var(--blue-300);
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    min-height: 50px;
    transition: color 0.2s ease;
    overflow: hidden;
  }
  .chip-preview.chip-preview-active {
    color: var(--blue-700);
  }
  /* V3: Slide-in reveal — uses clip-path to work within overflow:hidden card */
  .chip-preview.chip-slide-in {
    animation: chipSlideIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  @keyframes chipSlideIn {
    0%   { clip-path: inset(0 100% 0 0); opacity: 0.3; }
    100% { clip-path: inset(0 0 0 0);    opacity: 1; }
  }

  /* Start chat row with Michael avatar */
  .start-chat-row {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 16px 20px 20px;
    max-height: 80px; /* V18: explicit for transition back from focused state */
    opacity: 1;
    overflow: visible;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  }
  /* Start-chat avatar wrap:
     Initial (no topic selected yet): collapsed to zero width with a
     negative right margin that cancels the row's 12px flex gap. This
     removes the avatar from layout entirely so the button, which has
     flex: 1, can be genuinely centered by justify-content on the row.
     When .welcome-view.focused is set (chip picked), the width
     transitions open, the negative margin returns to zero, and the
     existing scale + opacity pop-in plays on top. The width/margin
     transition has a slightly shorter delay than the pop-in so the
     slot opens first and Michael appears to walk into it. */
  .start-chat-avatar-wrap {
    position: relative; flex-shrink: 0;
    width: 0;
    margin-right: -12px;   /* cancel the row's gap while collapsed */
    overflow: hidden;      /* clip the 36px img until width opens */
    opacity: 0; transform: scale(0.7);
    transition: width 0.55s cubic-bezier(0.25, 0.9, 0.35, 1) 0.18s,
                margin-right 0.55s cubic-bezier(0.25, 0.9, 0.35, 1) 0.18s,
                opacity 0.55s cubic-bezier(0.25, 0.9, 0.35, 1) 0.32s,
                transform 0.6s cubic-bezier(0.25, 0.9, 0.35, 1) 0.32s;
  }
  .start-chat-avatar-wrap img {
    width: 36px; height: 36px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--blue-100);
  }
  .start-chat-avatar-wrap .living-dot {
    position: absolute; bottom: 0; right: 0;
    width: 10px; height: 10px; border-radius: 50%;
    background: #34d399; border: 2px solid white;
    animation: livingPulse 3.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  }
  /* Bioluminescent breathing: asymmetric cycle, hue shifts emerald→mint→seafoam→emerald */
  @keyframes livingPulse {
    0%   { background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.45), 0 0 4px 1px rgba(52,211,153,0.18); }
    18%  { background: #3be8aa; box-shadow: 0 0 0 3px rgba(59,232,170,0.22), 0 0 9px 2px rgba(59,232,170,0.14); }
    42%  { background: #4ade80; box-shadow: 0 0 0 5px rgba(74,222,128,0.0), 0 0 14px 3px rgba(74,222,128,0.10); }
    62%  { background: #2dd4a0; box-shadow: 0 0 0 2px rgba(45,212,160,0.18), 0 0 7px 2px rgba(45,212,160,0.12); }
    82%  { background: #34d399; box-shadow: 0 0 0 1px rgba(52,211,153,0.28), 0 0 5px 1px rgba(52,211,153,0.14); }
    100% { background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.45), 0 0 4px 1px rgba(52,211,153,0.18); }
  }

  .start-chat-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 24px; flex: 1;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
    color: white; border: none; border-radius: 14px;
    font-family: 'Inter', sans-serif; font-size: 0.9rem;
    font-weight: 600; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.9, 0.35, 1);
    box-shadow: 0 4px 16px rgba(33,118,212,0.3);
  }
  .start-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(33,118,212,0.4);
  }
  .start-chat-btn svg { width: 18px; height: 18px; }
  /* Button scan — interlace reveal during FAQ arrival Beat 1 */
  .start-chat-btn { position: relative; overflow: hidden; perspective: 200px; }
  .start-chat-btn.btn-scan-active {
    background: linear-gradient(135deg, rgba(33,100,180,0.35), rgba(33,118,212,0.25)) !important;
  }
  .start-chat-btn .btn-scan-sweep {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
    border-radius: inherit;
    clip-path: inset(0 100% 0 0);
    pointer-events: none; z-index: 0;
  }
  .start-chat-btn .btn-scan-edge {
    position: absolute; top: 0;
    width: 2px; height: 100%;
    background: linear-gradient(180deg,
      transparent 0%,
      rgba(255,255,255,0.5) 30%,
      rgba(255,255,255,0.8) 50%,
      rgba(255,255,255,0.5) 70%,
      transparent 100%);
    pointer-events: none; z-index: 1;
    opacity: 0;
    transition: opacity 0.15s ease;
    left: 0;
  }
  .start-chat-btn.btn-scan-active .btn-scan-edge { opacity: 1; }
  .start-chat-btn > svg,
  .start-chat-btn > span { position: relative; z-index: 2; }
  .btn-scan-voxel {
    position: absolute;
    width: 3px; height: 3px;
    background: rgba(255,255,255,0.6);
    border-radius: 0.5px;
    pointer-events: none; z-index: 1;
    opacity: 0;
    transform: translateZ(0px) scale(1);
    animation: btnVoxelPop 0.32s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  }
  @keyframes btnVoxelPop {
    0%   { opacity: 0; transform: translateZ(0px) scale(0.3); }
    22%  { opacity: 0.85; transform: translateZ(10px) scale(1.15); }
    58%  { opacity: 0.5; transform: translateZ(5px) scale(0.85); }
    100% { opacity: 0; transform: translateZ(0px) scale(0.2); }
  }

  /* ── Conversation view ── */
  .convo-view { display: none; flex-direction: column; height: 460px; }
  .convo-view.active { display: flex; }
  .welcome-view { }
  .welcome-view.hidden { display: none; }

  .convo-header {
    padding: 16px 20px; display: flex; align-items: center;
    justify-content: space-between; gap: 8px;
    border-bottom: 1px solid var(--blue-50); background: var(--white);
  }
  .convo-agent { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
  .convo-avatar-wrap { position: relative; flex-shrink: 0; }
  .convo-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--blue-100); opacity: 1; transition: opacity 0.6s ease, filter 0.6s ease; display: block; }
  .convo-online-dot {
    position: absolute; bottom: 1px; right: -1px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #34d399; border: 2px solid white;
    z-index: 2;
    animation: livingPulse 3.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  }
  .convo-agent.offline .convo-online-dot { background: #dc2626; animation: none; }
  .convo-agent-info h4 { font-size: 0.82rem; font-weight: 700; color: var(--blue-900); line-height: 1.3; }
  .convo-agent-info span { font-size: 0.65rem; color: #34d399; font-weight: 600; display: block; line-height: 1.3; }
  .convo-intent-label {
    font-size: 0.62rem; font-weight: 600; color: var(--blue-700);
    line-height: 1.3; margin-top: 1px;
    letter-spacing: 0.02em;
  }
  /* Offline state */
  .convo-agent-info span.offline { color: #b91c1c; }
  /* Avatar dims to 50% when Michael is offline so the visual matches the status text. */
  .convo-agent.offline .convo-avatar { opacity: 0.5; filter: grayscale(0.35); }
  .convo-close {
    background: var(--blue-50); border: none; border-radius: 10px;
    width: 32px; height: 32px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .convo-close:hover { background: var(--blue-100); transform: rotate(90deg) scale(1.1); }
  .convo-close svg { width: 14px; height: 14px; color: var(--blue-900); }

  /* Convo logo + sparkles */
  .convo-logo-wrap { position: relative; width: 120px; height: 54px; flex-shrink: 0; margin-top: 10px; }
  .convo-logo-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255,255,255,0.15)); animation: miniLogoGlow 3s ease-in-out infinite; }
  @keyframes miniLogoGlow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(33,118,212,0.15)); }
    25%  { filter: drop-shadow(0 0 10px rgba(33,118,212,0.5)); }
    50%  { filter: drop-shadow(0 0 6px rgba(33,118,212,0.25)); }
    75%  { filter: drop-shadow(0 0 8px rgba(33,118,212,0.4)); }
  }

  .mini-sparkle-anchor { position: absolute; width: 0; height: 0; pointer-events: none; }
  .mini-sparkle-pulse { position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%; opacity: 0; background: radial-gradient(circle, rgba(33,118,212,0.35) 0%, rgba(33,118,212,0.18) 38%, rgba(33,118,212,0.06) 60%, rgba(33,118,212,0) 72%); }
  .mini-sparkle-spin { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: visible; }
  .mini-sparkle-xhair { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; opacity: 0; }
  .mini-sp-arm { position: absolute; border-radius: 1px; }
  .mini-sp-arm-h { width: 31px; height: 1.5px; left: -15.5px; top: -0.75px; background: linear-gradient(90deg, rgba(33,118,212,0) 0%, rgba(255,255,255,0.85) 50%, rgba(33,118,212,0) 100%); }
  .mini-sp-arm-v { width: 1.5px; height: 31px; left: -0.75px; top: -15.5px; background: linear-gradient(180deg, rgba(33,118,212,0) 0%, rgba(255,255,255,0.85) 50%, rgba(33,118,212,0) 100%); }
  .mini-sp-arm-d1 { width: 21px; height: 1px; left: -10.5px; top: -0.5px; transform: rotate(45deg); background: linear-gradient(90deg, rgba(33,118,212,0) 0%, rgba(255,255,255,0.85) 50%, rgba(33,118,212,0) 100%); }
  .mini-sp-arm-d2 { width: 21px; height: 1px; left: -10.5px; top: -0.5px; transform: rotate(-45deg); background: linear-gradient(90deg, rgba(33,118,212,0) 0%, rgba(255,255,255,0.85) 50%, rgba(33,118,212,0) 100%); }
  .mini-sp-core-glow { position: absolute; width: 14px; height: 14px; left: -7px; top: -7px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.65) 0%, rgba(255,255,255,0.3) 40%, rgba(255,255,255,0) 80%); }
  .mini-sp-core-dot { position: absolute; width: 3.5px; height: 3.5px; left: -1.75px; top: -1.75px; border-radius: 50%; background: white; }

  @keyframes miniSpkPulse {
    0%   { transform: translate(-50%,-50%) scale(0.04); opacity: 0; }
    12%  { transform: translate(-50%,-50%) scale(0.70); opacity: 0.70; }
    44%  { transform: translate(-50%,-50%) scale(1.85); opacity: 0; }
    100% { transform: translate(-50%,-50%) scale(1.85); opacity: 0; }
  }
  @keyframes miniSpkSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
  @keyframes miniSpkXhair {
    0%   { transform: scale(0);    opacity: 0; }
    14%  { transform: scale(1.25); opacity: 1; }
    30%  { transform: scale(1.0);  opacity: 1; }
    58%  { transform: scale(1.06); opacity: 0.88; }
    82%  { transform: scale(0.45); opacity: 0.22; }
    94%  { transform: scale(0.12); opacity: 0.04; }
    100% { transform: scale(0);    opacity: 0; }
  }

  .msp1 > .mini-sparkle-pulse { animation: miniSpkPulse 7.0s ease-out infinite 0.0s; }
  .msp1-spin { animation: miniSpkSpin 7.0s linear infinite 0.0s; }
  .msp1 .mini-sparkle-xhair  { animation: miniSpkXhair 7.0s ease-out infinite 0.0s; }
  .msp2 > .mini-sparkle-pulse { animation: miniSpkPulse 8.5s ease-out infinite 2.8s; }
  .msp2-spin { animation: miniSpkSpin 8.5s linear infinite reverse 2.8s; }
  .msp2 .mini-sparkle-xhair  { animation: miniSpkXhair 8.5s ease-out infinite 2.8s; }
  .msp3 > .mini-sparkle-pulse { animation: miniSpkPulse 6.2s ease-out infinite 1.6s; }
  .msp3-spin { animation: miniSpkSpin 6.2s linear infinite 1.6s; }
  .msp3 .mini-sparkle-xhair  { animation: miniSpkXhair 6.2s ease-out infinite 1.6s; }

  /* Step indicator */
  .step-indicator {
    padding: 6px 20px 10px; display: flex; align-items: center; gap: 6px; background: var(--white);
  }
  .step-label {
    font-size: 0.68rem; font-weight: 600; color: var(--blue-400);
    text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap;
    transition: opacity 0.25s ease;
  }
  .step-label.step-fading { opacity: 0; }
  .step-progress { flex: 1; height: 3px; border-radius: 3px; background: var(--blue-100); overflow: hidden; position: relative; }
  .step-progress-fill {
    height: 100%; width: 0%; border-radius: 3px;
    background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
    transition: width 0.6s cubic-bezier(0.25, 0.9, 0.35, 1);
    position: relative;
  }
  /* V3: Progress bar shimmer */
  .step-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -50%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    animation: progressShimmer 2s ease-in-out infinite;
  }
  @keyframes progressShimmer {
    0%   { left: -50%; }
    100% { left: 150%; }
  }

  /* Chat body — V3 depth */
  .card-body {
    flex: 1; padding: 16px 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    background: linear-gradient(180deg, #f4f8ff 0%, var(--white) 50%);
    box-shadow: inset 0 2px 6px rgba(10,30,61,0.03);
  }

  /* Messages — V3: Directional entrances */
  .msg-row { display: flex; gap: 8px; align-items: flex-end; opacity: 0; width: 100%; }
  .msg-row.bot { justify-content: flex-start; animation: msgSlideLeft 0.4s cubic-bezier(0.25, 0.9, 0.35, 1) forwards; }
  .msg-row.user { justify-content: flex-end; animation: msgSlideRight 0.4s cubic-bezier(0.25, 0.9, 0.35, 1) forwards; }
  @keyframes msgSlideLeft {
    0%   { opacity: 0; transform: translateX(-12px); }
    100% { opacity: 1; transform: translateX(0); }
  }
  @keyframes msgSlideRight {
    0%   { opacity: 0; transform: translateX(12px); }
    100% { opacity: 1; transform: translateX(0); }
  }

  /* V3: Bot avatar breathing ring in conversation */
  .msg-avatar {
    width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(74,154,239,0);
    animation: msgAvatarRing 6s ease-in-out infinite;
  }
  @keyframes msgAvatarRing {
    0%   { box-shadow: 0 0 0 0 rgba(74,154,239,0); }
    50%  { box-shadow: 0 0 0 2px rgba(74,154,239,0.2), 0 0 6px 1px rgba(74,154,239,0.08); }
    100% { box-shadow: 0 0 0 0 rgba(74,154,239,0); }
  }

  /* V3: Message bubble polish */
  .msg-bubble { max-width: 78%; padding: 11px 15px; font-size: 0.84rem; line-height: 1.55; overflow-wrap: break-word; }
  .msg-row.bot .msg-bubble {
    background: var(--white); color: var(--blue-900);
    border-radius: 4px 14px 14px 14px;
    box-shadow: 0 1px 6px rgba(10,30,61,0.06), 0 0 0 1px rgba(10,30,61,0.02);
  }
  .msg-row.user .msg-bubble {
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
    color: white; border-radius: 14px 4px 14px 14px;
    box-shadow: 0 2px 8px rgba(33,118,212,0.2);
  }

  /* V14: Premium word-by-word typewriter reveal for bot messages */
  .msg-row.bot .msg-bubble {
    opacity: 0; transform: scale(0.96);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .msg-row.bot .msg-bubble.tw-visible {
    opacity: 1; transform: scale(1);
  }
  .tw-word { opacity: 0; transition: opacity 0.18s ease; display: inline; }
  .tw-word.tw-vis { opacity: 1; }
  .tw-word.tw-glow { color: #2a6cb8; transition: opacity 0.18s ease, color 0.4s ease; }
  .tw-word.tw-settle { color: inherit; }

  /* Typing — V3: Upgraded dots */
  .typing-row { display: flex; gap: 8px; align-items: flex-end; align-self: flex-start; opacity: 0; animation: msgSlideLeft 0.3s ease forwards; }
  .typing-dots { display: flex; gap: 4px; padding: 12px 15px; background: var(--white); border-radius: 4px 14px 14px 14px; box-shadow: 0 1px 6px rgba(10,30,61,0.06); align-items: center; }
  .typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-300); animation: typingDotV3 1.2s ease-in-out infinite; }
  .typing-dots span:nth-child(2) { animation-delay: 0.15s; }
  .typing-dots span:nth-child(3) { animation-delay: 0.3s; }
  @keyframes typingDotV3 {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50%      { opacity: 1;   transform: translateY(-3px); }
  }

  /* System messages */
  .system-msg { align-self: center; max-width: 86%; text-align: center; font-size: 0.72rem; font-style: italic; color: #94a3b8; letter-spacing: 0.02em; padding: 10px 14px; margin: 6px 0; border-top: 1px solid rgba(148,163,184,0.18); border-bottom: 1px solid rgba(148,163,184,0.18); background: rgba(148,163,184,0.04); border-radius: 2px; opacity: 0; animation: systemFade 0.6s cubic-bezier(0.25, 0.9, 0.35, 1) forwards; }
  .system-msg.connected { color: #64748b; border-color: rgba(52,211,153,0.28); background: rgba(52,211,153,0.05); }
  .system-msg.severed { color: #64748b; border-color: rgba(100,116,139,0.28); background: rgba(100,116,139,0.06); }
  .system-msg.alone { color: #94a3b8; border-color: rgba(148,163,184,0.14); background: transparent; letter-spacing: 0.04em; }
  @keyframes systemFade { 0% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: translateY(0); } }

  /* Input — V3: Focus glow + breathing prompt */
  .card-input {
    padding: 14px 20px; border-top: 1px solid var(--blue-50);
    display: flex; gap: 8px; align-items: center;
    background: linear-gradient(180deg, var(--white) 0%, #f8faff 100%);
  }
  .card-input input {
    flex: 1; border: none; border-bottom: 2px solid var(--blue-100);
    padding: 10px 4px; font-family: 'Inter', sans-serif;
    font-size: 0.875rem; color: var(--blue-900);
    outline: none; background: transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0;
  }
  .card-input input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 2px 8px rgba(33,118,212,0.1);
  }
  .card-input input::placeholder { color: #b0bec5; }

  /* V3: Input border breathing when awaiting response */
  .card-input.input-awaiting input {
    animation: inputAwaitPulse 3s ease-in-out infinite;
  }
  @keyframes inputAwaitPulse {
    0%   { border-bottom-color: var(--blue-200); }
    50%  { border-bottom-color: var(--blue-400); }
    100% { border-bottom-color: var(--blue-200); }
  }

  /* V3: Send button alive/dead states */
  .card-input .send {
    background: none; border: none; cursor: pointer;
    padding: 8px; display: flex; align-items: center;
    color: var(--blue-200);
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.9, 0.35, 1), opacity 0.3s ease;
    opacity: 0.5;
  }
  .card-input .send.send-alive {
    color: var(--blue-500);
    opacity: 1;
  }
  .card-input .send.send-alive:hover {
    color: var(--blue-700);
    transform: scale(1.15);
  }
  .card-input .send svg { width: 20px; height: 20px; }
  /* V3: Send pulse on click */
  .card-input .send.send-pulse {
    animation: sendPulse 0.4s ease-out;
  }
  @keyframes sendPulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.3); }
    100% { transform: scale(1); }
  }

  /* V3: Conversation header avatar breathing ring */
  .convo-avatar-wrap .convo-avatar {
    animation: convoAvatarRing 7s ease-in-out infinite;
  }
  @keyframes convoAvatarRing {
    0%   { box-shadow: 0 0 0 0 rgba(74,154,239,0); }
    50%  { box-shadow: 0 0 0 3px rgba(74,154,239,0.18), 0 0 8px 1px rgba(74,154,239,0.08); }
    100% { box-shadow: 0 0 0 0 rgba(74,154,239,0); }
  }

  /* V3: Phase 2 summary — depth + stagger */
  .done-state { padding: 20px; }
  .done-confirmation {
    text-align: center;
    opacity: 0;
    animation: doneReveal 0.5s cubic-bezier(0.25, 0.9, 0.35, 1) 0.1s forwards;
  }
  @keyframes doneReveal {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
  }
  .done-confirmation .done-ring {
    animation: doneRingPop 0.6s cubic-bezier(0.25, 0.9, 0.35, 1) 0.3s both;
  }
  @keyframes doneRingPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }
  .done-phase2 {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .done-phase2.visible {
    opacity: 1;
    transform: translateY(0);
  }
  .rich-card {
    border-radius: 18px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04), 0 2px 12px rgba(10,30,61,0.06);
  }

  .powered-by { text-align: center; padding: 8px; font-size: 0.65rem; color: #94a3b8; border-top: 1px solid var(--blue-50); background: var(--white); }

  /* Success / Done state */
  .done-state { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1; padding: 0 24px; overflow: hidden; position: relative; }
  .done-confirmation { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 0 16px; transition: transform 0.9s cubic-bezier(0.25, 0.9, 0.35, 1), opacity 0.7s ease, max-height 0.9s cubic-bezier(0.25, 0.9, 0.35, 1); max-height: 300px; overflow: hidden; }
  .done-confirmation.slide-out { transform: translateY(-40px); opacity: 0; max-height: 0; padding: 0; }
  .done-ring { width: 60px; height: 60px; border-radius: 50%; border: 3px solid #34d399; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; animation: ringIn 0.6s cubic-bezier(0.34,1.56,0.64,1); }
  @keyframes ringIn { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
  .done-ring svg { width: 28px; height: 28px; color: #34d399; }
  .done-state h3 { color: var(--blue-900); font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
  .done-state p { color: #64748b; font-size: 0.82rem; line-height: 1.5; }
  .done-phase2 { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 12px 0 10px; flex: 1; opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease 0.3s, transform 0.8s cubic-bezier(0.25, 0.9, 0.35, 1) 0.3s; }
  .done-phase2.visible { opacity: 1; transform: translateY(0); }
  .done-phase2 .rich-card { max-width: 260px; }
  .done-phase2 .rich-card-img, .done-phase2 .rich-card-img.placeholder { height: 56px; }
  .done-phase2 .rich-card-body { padding: 8px 12px; }
  .done-phase2 .rich-card-desc { margin-bottom: 6px; }
  .done-phase2 .rating-prompt { margin-top: 10px; padding-top: 0; }

  /* ══════════════════════════════════════════
     ROTATING MESSAGE ENGINE
     ══════════════════════════════════════════ */
  .welcome-msg { min-height: 42px; }
  .welcome-msg .typing-anim { display: inline; }
  .welcome-msg .msg-cursor { display: inline-block; width: 2px; height: 1em; background: rgba(255,255,255,0.8); margin-left: 1px; vertical-align: text-bottom; animation: cursorBlink 0.6s steps(1) infinite; }
  @keyframes cursorBlink { 0%,50%{opacity:1} 51%,100%{opacity:0} }
  .welcome-msg .welcome-typing-dots { display: inline-flex; gap: 3px; padding: 0 2px; vertical-align: middle; }
  .welcome-msg .welcome-typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.6); animation: wDot 1.2s ease-in-out infinite; }
  .welcome-msg .welcome-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
  .welcome-msg .welcome-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
  @keyframes wDot { 0%,70%,100%{opacity:0.3} 35%{opacity:1} }

  /* ══════════════════════════════════════════
     SOCIAL PROOF PULSE (Yelp Reviews)
     ══════════════════════════════════════════ */
  .social-proof { position: relative; z-index: 1; min-height: 72px; margin-top: 8px; overflow: hidden; width: 100%; transition: opacity 0.5s ease, max-height 0.6s ease, margin 0.5s ease; }
  .social-proof-item { position: absolute; left: 0; right: 0; text-align: center; padding: 0 16px; opacity: 0; transform: translateX(12px); transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); pointer-events: none; }
  .social-proof-item.active { opacity: 1; transform: translateX(0); pointer-events: auto; }
  .proof-stars { display: flex; justify-content: center; gap: 2px; margin-bottom: 3px; }
  .proof-star { color: #facc15; font-size: 0.65rem; }
  .proof-quote { font-size: 0.68rem; font-style: italic; line-height: 1.45; color: rgba(255,255,255,0.85); max-width: 300px; margin: 0 auto; }
  .proof-author { font-size: 0.62rem; font-weight: 600; margin-top: 2px; color: rgba(255,255,255,0.55); letter-spacing: 0.03em; }
  .proof-stat { font-size: 0.7rem; font-weight: 500; color: rgba(255,255,255,0.75); letter-spacing: 0.02em; }
  .proof-stat .proof-stat-icon { margin-right: 4px; }

  /* ══════════════════════════════════════════
     BEFORE / AFTER PHOTO CAROUSEL
     ══════════════════════════════════════════ */
  .ba-carousel { display: none; }
  .ba-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 1.2s ease; background: rgba(0,0,0,0.25); border-radius: 10px; }
  .ba-slide.active { opacity: 1; }
  .ba-slide-inner { display: flex; width: 100%; height: 100%; }
  .ba-half { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
  .ba-half img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.85); }
  .ba-half .ba-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 600; color: rgba(255,255,255,0.5); letter-spacing: 0.04em; text-transform: uppercase; }
  .ba-half:first-child .ba-placeholder { background: rgba(180,50,50,0.25); }
  .ba-half:last-child .ba-placeholder { background: rgba(50,180,80,0.25); }
  .ba-divider { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.6); transform: translateX(-50%); z-index: 2; }
  .ba-label { position: absolute; bottom: 4px; font-size: 0.55rem; font-weight: 700; color: white; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 6px; border-radius: 4px; z-index: 2; }
  .ba-label.before { left: 8px; background: rgba(220,60,60,0.7); }
  .ba-label.after  { right: 8px; background: rgba(40,180,80,0.7); }
  .ba-dots { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 3; }
  .ba-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.3); transition: background 0.4s; }
  .ba-dot.active { background: rgba(255,255,255,0.9); }

  /* ══════════════════════════════════════════
     RICH MESSAGE CARDS
     ══════════════════════════════════════════ */
  .rich-card { background: var(--white); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 12px rgba(10,30,61,0.08); max-width: 280px; margin: 4px 0; border: 1px solid var(--blue-50); }
  .rich-card-img { width: 100%; height: 100px; object-fit: cover; display: block; }
  .rich-card-img.placeholder { background: linear-gradient(135deg, var(--blue-100), var(--blue-50)); display: flex; align-items: center; justify-content: center; color: var(--blue-300); font-size: 1.6rem; }
  .rich-card-body { padding: 10px 14px; }
  .rich-card-title { font-size: 0.8rem; font-weight: 700; color: var(--blue-900); margin-bottom: 3px; }
  .rich-card-desc { font-size: 0.72rem; color: #64748b; line-height: 1.45; margin-bottom: 8px; }
  .rich-card-btn { display: block; width: 100%; padding: 8px; background: var(--blue-50); border: 1.5px solid var(--blue-100); border-radius: 8px; text-align: center; font-family: 'Inter', sans-serif; font-size: 0.72rem; font-weight: 600; color: var(--blue-600); cursor: pointer; transition: all 0.2s; }
  .rich-card-btn:hover { background: var(--blue-100); border-color: var(--blue-300); }
  .rich-card-btn.expanded { background: var(--blue-100); color: var(--blue-700); border-color: var(--blue-200); }
  .rc-expanded { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.5s cubic-bezier(0.25, 0.9, 0.35, 1), opacity 0.4s ease, padding 0.5s ease; padding: 0 0; }
  .rc-expanded.open { max-height: 250px; opacity: 1; padding: 8px 0 4px; }
  .rc-detail-row { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; color: var(--blue-900); padding: 3px 0; line-height: 1.4; }
  .rc-check { color: #34d399; font-weight: 700; font-size: 0.68rem; flex-shrink: 0; }
  .rc-note { font-size: 0.66rem; color: #64748b; font-style: italic; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--blue-50); line-height: 1.45; }

  /* POST-CHAT RATING */
  .rating-prompt { display: flex; flex-direction: column; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(100,116,139,0.12); animation: doneReveal 0.5s cubic-bezier(0.25, 0.9, 0.35, 1) forwards; opacity: 0; }
  .rating-label { font-size: 0.76rem; color: #64748b; margin-bottom: 8px; transition: opacity 0.3s ease, transform 0.3s ease; }
  .rating-buttons { display: flex; gap: 12px; transition: opacity 0.3s ease, transform 0.3s ease; }
  .rating-btn { background: var(--blue-50); border: 1.5px solid var(--blue-100); border-radius: 12px; padding: 10px 20px; font-size: 1.2rem; cursor: pointer; transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1); }
  .rating-btn:hover { transform: scale(1.15); box-shadow: 0 4px 16px rgba(33,118,212,0.15); }
  .rating-btn.selected { border-color: var(--blue-400); background: var(--blue-100); transform: scale(1.1); }
  .rating-thanks { font-size: 0.74rem; color: var(--blue-500); font-weight: 600; margin-top: 8px; opacity: 0; transition: opacity 0.5s ease; }
  .rating-thanks.visible { opacity: 1; }

  /* V3: Rating confirmation — full widget takeover */
  .rating-prompt.rating-fading .rating-label,
  .rating-prompt.rating-fading .rating-buttons {
    opacity: 0;
    transform: translateY(-6px);
  }
  .convo-final-confirm {
    position: absolute;
    inset: 0;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: 20px;
  }
  .convo-final-confirm.final-visible {
    opacity: 1;
  }
  .final-check-ring {
    width: 72px; height: 72px; border-radius: 50%;
    border: 3px solid #34d399;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
    transform: scale(0);
    animation: finalRingPop 0.7s cubic-bezier(0.34,1.56,0.64,1) 0.2s forwards;
  }
  @keyframes finalRingPop {
    0%   { transform: scale(0); box-shadow: 0 0 0 0 rgba(52,211,153,0.35); }
    55%  { transform: scale(1.12); box-shadow: 0 0 0 14px rgba(52,211,153,0); }
    100% { transform: scale(1); box-shadow: 0 0 24px 4px rgba(52,211,153,0.08); }
  }
  .final-check-ring svg {
    width: 34px; height: 34px; color: #34d399;
    opacity: 0;
    animation: finalCheckIn 0.35s ease 0.55s forwards;
  }
  @keyframes finalCheckIn {
    0%   { opacity: 0; transform: scale(0.4); }
    100% { opacity: 1; transform: scale(1); }
  }
  .final-confirm-text {
    font-size: 0.92rem; color: var(--blue-900); font-weight: 700;
    text-align: center; white-space: nowrap;
    opacity: 0;
    animation: finalTextIn 0.4s ease 0.75s forwards;
  }
  @keyframes finalTextIn {
    0%   { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
  }
  .final-confirm-sub {
    font-size: 0.74rem; color: #64748b; margin-top: 6px;
    opacity: 0;
    animation: finalTextIn 0.4s ease 0.95s forwards;
  }
  /* Widget exit — shrink back to bubble */
  .chat-card.widget-exiting {
    transform: translateY(16px) scale(0.92) !important;
    opacity: 0 !important;
    transition: all 0.55s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: none;
  }
  .chat-bubble-trigger.fresh-return {
    animation: triggerBreathe 4.5s ease-in-out infinite, freshReturnPop 0.6s cubic-bezier(0.34,1.56,0.64,1);
  }
  @keyframes freshReturnPop {
    0%   { transform: scale(0.6); }
    100% { transform: scale(1); }
  }

  /* INACTIVITY NUDGE */
  .nudge-bubble { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border-radius: 4px 14px 14px 14px; padding: 10px 14px; font-size: 0.78rem; line-height: 1.5; max-width: 78%; box-shadow: 0 2px 8px rgba(146,64,14,0.08); animation: msgSlideLeft 0.4s cubic-bezier(0.25, 0.9, 0.35, 1) forwards; opacity: 0; }

  /* QUICK ANSWER INFO CARDS */
  /* ─────────────────────────────────────────────────────────────
     QUICK ANSWER PANEL — premium stable-shell transition system

     Philosophy: the outer shell is a persistent, locked frame.
     Content lives in a dual-layer stage where outgoing and
     incoming layers crossfade over each other. The shell's
     footprint never changes after its initial reveal — only
     on the very first open does height animate from 0 → locked.

     V3: --qa-card-height is measured per-card at runtime and set
     answer card and set as an inline custom property. Fallback
     values below are only used if measurement hasn't run yet.
     ───────────────────────────────────────────────────────────── */
  .quick-answer-card {
    background: linear-gradient(180deg, #f7faff 0%, #f0f4fc 100%);
    border: 1.5px solid var(--blue-100);
    border-radius: 18px;
    margin: 0 20px;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
    /* V3: Height transitions per-card instead of locked to tallest.
       --qa-card-height is set per card switch by showAnswerCard. */
    max-height: 0;
    min-height: 0;
    height: 0;
    transition:
      height    0.45s cubic-bezier(0.25, 0.9, 0.35, 1),
      max-height 0.45s cubic-bezier(0.25, 0.9, 0.35, 1),
      min-height 0.45s cubic-bezier(0.25, 0.9, 0.35, 1),
      opacity   0.42s ease,
      padding   0.5s  ease,
      margin    0.5s  ease,
      border-color 0.5s ease;
  }
  .quick-answer-card.visible {
    max-height: var(--qa-card-height, 280px);
    min-height: var(--qa-card-height, 280px);
    height: var(--qa-card-height, 280px);
    opacity: 1;
    padding: 16px;
    margin: 0 20px 14px;
    overflow-y: auto; /* V18: internal scroll when viewport-capped */
    overscroll-behavior: contain;
  }
  /* V18: Scroll fade mask — only when content overflows */
  .quick-answer-card.v18-has-overflow {
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent);
    mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent);
  }
  .quick-answer-card.v18-has-overflow.v18-scrolled-end {
    -webkit-mask-image: none;
    mask-image: none;
  }
  /* V3: qa-stable allows smooth height changes between cards. */
  .quick-answer-card.qa-stable {
    transition:
      height    0.35s cubic-bezier(0.25, 0.9, 0.35, 1),
      max-height 0.35s cubic-bezier(0.25, 0.9, 0.35, 1),
      min-height 0.35s cubic-bezier(0.25, 0.9, 0.35, 1),
      opacity 0.42s ease, padding 0.5s ease, margin 0.5s ease;
  }

  /* Stage: relative parent that holds the outgoing + incoming layers. */
  .qa-stage {
    position: relative;
    width: 100%;
    height: 100%;
  }
  /* Layers: absolutely stacked, crossfade via opacity only. */
  .qa-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 320ms cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: none;
    will-change: opacity;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .qa-layer.qa-visible {
    opacity: 1;
    pointer-events: auto;
  }
  .qa-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .qa-icon { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--blue-100), var(--blue-50)); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
  .qa-title { font-size: 0.82rem; font-weight: 700; color: var(--blue-900); }
  .qa-body { font-size: 0.76rem; line-height: 1.55; color: #64748b; margin-bottom: 12px; }
  .qa-body ul { list-style: none; padding: 0; margin: 4px 0 0; }
  .qa-body ul li { padding: 2px 0; display: flex; align-items: center; gap: 5px; }
  .qa-body ul li::before { content: '✓'; color: #34d399; font-weight: 700; font-size: 0.72rem; }
  .qa-cta { background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); color: white; border: none; border-radius: 10px; padding: 9px 18px; font-family: 'Inter', sans-serif; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.3s; width: 100%; }
  .qa-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(33,118,212,0.3); }

  /* ── In-card context chips (Plateau 5) ── */
  .qa-chip-section { margin: 6px 0 10px; }
  .qa-chip-label {
    font-size: 0.66rem; font-weight: 600; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 5px;
  }
  .qa-chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
  .qa-chip {
    background: var(--blue-50); border: 1.5px solid var(--blue-100);
    border-radius: 100px; padding: 4px 11px;
    font-family: 'Inter', sans-serif; font-size: 0.68rem;
    font-weight: 500; color: var(--blue-700);
    cursor: pointer; transition: all 0.18s; white-space: nowrap;
    line-height: 1.4;
  }
  .qa-chip:hover {
    background: var(--blue-100); border-color: var(--blue-300);
    color: var(--blue-900);
  }
  .qa-chip.qa-chip-selected {
    background: var(--blue-200); border-color: var(--blue-400);
    color: var(--blue-900); font-weight: 600;
  }
  .qa-footer-note {
    font-size: 0.66rem; color: #94a3b8; text-align: center;
    margin-top: 6px; line-height: 1.4;
  }

  /* COMEBACK HOOK */
  .chat-bubble-trigger.comeback { animation: gentleAttention 2s ease-in-out 0.5s 2; }
  @keyframes gentleAttention { 0%,100% { transform: scale(1); } 15% { transform: scale(1.06); } 30% { transform: scale(1); } 45% { transform: scale(1.04); } 60% { transform: scale(1); } }
  .chat-bubble-trigger.comeback::before { animation: softRing 3s ease-out infinite; }
  @keyframes softRing { 0% { transform: scale(1); opacity: 0.3; } 100% { transform: scale(1.3); opacity: 0; } }

  /* V9: TERMINATED STATE — grayed out, unclickable */
  .chat-bubble-trigger.terminated {
    background: #9ca3af !important;
    pointer-events: none !important;
    opacity: 0.45 !important;
    cursor: default !important;
    animation: none !important;
  }
  .chat-bubble-trigger.terminated::before,
  .chat-bubble-trigger.terminated::after {
    display: none !important;
  }

  @media (max-width: 480px) {
    .chat-card { width: calc(100vw - 24px); right: 12px; bottom: 100px; }
    .chat-bubble-trigger { width: 56px; height: 56px; bottom: 20px; right: 16px; }
    .chat-greeting { right: 12px; bottom: 84px; max-width: 220px; }
  }

  /* ═══════════════════════════════════════════════════════
     V3 FRONT-DOOR ENHANCEMENTS
     ═══════════════════════════════════════════════════════ */

  /* ── Chip indicator dots — V3: transforms into check-badge on selection ── */
  .qa-chip .qa-chip-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 7px; height: 7px; border-radius: 50%;
    margin-right: 4px; vertical-align: middle;
    flex-shrink: 0;
    position: relative;
    transition: width 0.35s cubic-bezier(0.34,1.56,0.64,1),
                height 0.35s cubic-bezier(0.34,1.56,0.64,1),
                background-color 0.25s ease,
                box-shadow 0.4s ease;
    overflow: hidden;
  }
  /* Check SVG inside — hidden by default */
  .qa-chip .qa-chip-dot .dot-check {
    width: 0; height: 0;
    opacity: 0;
    transition: width 0.25s ease 0.1s, height 0.25s ease 0.1s, opacity 0.25s ease 0.1s;
  }
  /* ── Selected state: dot becomes a check-badge ── */
  .qa-chip.qa-chip-selected .qa-chip-dot {
    width: 14px; height: 14px;
    background-color: var(--blue-600) !important;
    animation: dotBadgePop 0.5s cubic-bezier(0.34,1.56,0.64,1);
  }
  .qa-chip.qa-chip-selected .qa-chip-dot .dot-check {
    width: 9px; height: 9px;
    opacity: 1;
  }
  @keyframes dotBadgePop {
    0%   { width: 7px; height: 7px; box-shadow: 0 0 0 0 rgba(33,118,212,0.35); }
    40%  { width: 18px; height: 18px; box-shadow: 0 0 0 6px rgba(33,118,212,0.12); }
    70%  { width: 13px; height: 13px; box-shadow: 0 0 0 8px rgba(33,118,212,0); }
    100% { width: 14px; height: 14px; box-shadow: none; }
  }

  /* V18: In-chat discovery chips (conversation flow) */
  .v18-discovery-chips {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 0 4px;
  }
  .v18-disc-chip {
    background: var(--blue-50, #eff6ff); border: 1.5px solid var(--blue-100, #dbeafe);
    border-radius: 100px; padding: 6px 14px;
    font-family: 'Inter', sans-serif; font-size: 0.74rem;
    font-weight: 500; color: var(--blue-700, #1d4ed8);
    cursor: pointer; transition: all 0.18s; white-space: nowrap;
  }
  .v18-disc-chip:hover {
    background: var(--blue-100, #dbeafe); border-color: var(--blue-300, #93c5fd);
    transform: translateY(-1px);
  }
  .v18-disc-chip.v18-disc-skip {
    background: transparent; border-color: #d1d5db;
    color: #9ca3af; font-weight: 400;
  }
  .v18-disc-chip.v18-disc-skip:hover {
    background: #f9fafb; border-color: #9ca3af;
    color: #6b7280;
  }

  /* ── In-chat context chips (scope / urgency / typo-confirm) ─────────────
     Displayed inline below the bot's context question. Visitor taps one
     instead of typing. Row self-destructs on selection so the chat stays
     clean. Shares the v18-disc-chip aesthetic but with a slightly warmer
     palette to differentiate from discovery chips. */
  .ctx-chip-row {
    display: flex; flex-wrap: wrap; gap: 7px;
    padding: 8px 0 4px;
  }
  .ctx-chip {
    background: var(--blue-50, #eff6ff);
    border: 1.5px solid var(--blue-200, #bfdbfe);
    border-radius: 100px;
    padding: 7px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem; font-weight: 500;
    color: var(--blue-700, #1d4ed8);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
    white-space: nowrap;
    user-select: none;
  }
  .ctx-chip:hover {
    background: var(--blue-100, #dbeafe);
    border-color: var(--blue-400, #60a5fa);
    transform: translateY(-1px);
  }
  .ctx-chip:active {
    transform: translateY(0);
    background: var(--blue-200, #bfdbfe);
  }
  /* Affirmative chip (Yes / fix-it) — slightly greener tint */
  .ctx-chip.ctx-chip-yes {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
  }
  .ctx-chip.ctx-chip-yes:hover {
    background: #dcfce7; border-color: #86efac;
  }
  /* Negative / skip chip */
  .ctx-chip.ctx-chip-no {
    background: transparent; border-color: #d1d5db; color: #6b7280; font-weight: 400;
  }
  .ctx-chip.ctx-chip-no:hover {
    background: #f9fafb; border-color: #9ca3af; color: #374151;
  }
  /* Urgency chip — amber tint */
  .ctx-chip.ctx-chip-urgent {
    background: #fffbeb; border-color: #fde68a; color: #92400e;
  }
  .ctx-chip.ctx-chip-urgent:hover {
    background: #fef3c7; border-color: #fcd34d;
  }

  /* ── Credibility chips (green pool, cloudy water) ── */
  .qa-chip.qa-credibility {
    border-color: #a7d8a0;
    background: #f8fdf7;
    font-weight: 600;
  }
  .qa-chip.qa-credibility:hover {
    border-color: #6bc460;
    background: #f0fbee;
  }
  .qa-chip.qa-credibility.qa-chip-selected {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
  }

  /* ── Per-lane icon backgrounds ── */
  .qa-icon.qa-icon-service  { background: linear-gradient(135deg, #e0f2fe, #bae6fd); }
  .qa-icon.qa-icon-repair   { background: linear-gradient(135deg, #fef3c7, #fde68a); }
  .qa-icon.qa-icon-quote    { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
  .qa-icon.qa-icon-existing { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
  .qa-icon.qa-icon-question { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }

  /* ── Conditional reveal section ── */
  .qa-conditional-wrap {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.25, 0.9, 0.35, 1),
                opacity 0.3s ease 0.1s,
                margin 0.4s cubic-bezier(0.25, 0.9, 0.35, 1);
    margin: 0;
  }
  .qa-conditional-wrap.qa-cond-revealed {
    max-height: 120px;
    opacity: 1;
    margin: 6px 0 10px;
  }

  /* ── Conversational prompt with breathing dot ── */
  .qa-cond-prompt {
    font-size: 0.72rem;
    color: var(--blue-700);
    font-weight: 500;
    margin-bottom: 6px;
    padding-left: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .qa-cond-prompt .qa-prompt-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--blue-400);
    animation: qaPromptPulse 2s ease-in-out infinite;
    flex-shrink: 0;
  }
  @keyframes qaPromptPulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
  }

  /* ── Referral toggle row ── */
  .qa-referral-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 10px;
    padding: 7px 11px;
    background: #fffcf0;
    border: 1px solid #fde68a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .qa-referral-row:hover { background: #fef9e0; }
  .qa-referral-row.qa-ref-active {
    background: #fef3c7;
    border-color: #f59e0b;
  }
  .qa-referral-check {
    width: 16px; height: 16px; border-radius: 4px;
    border: 2px solid #d4a017;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; color: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
  }
  .qa-referral-row.qa-ref-active .qa-referral-check {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
  }
  .qa-referral-text {
    font-size: 0.7rem;
    color: #92400e;
    font-weight: 500;
  }
  .qa-referral-row.qa-ref-active .qa-referral-text { font-weight: 600; }

  /* ── FAQ preview — chat bubble style ── */
  .qa-faq-section { margin: 6px 0 10px; }
  /* V18: FAQ accordion toggle */
  .qa-faq-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 8px 12px;
    background: var(--blue-50, #eff6ff); border: 1px solid var(--blue-100, #dbeafe);
    border-radius: 10px; cursor: pointer;
    font-family: 'Inter', sans-serif; font-size: 0.72rem;
    color: var(--blue-700, #1d4ed8); font-weight: 500;
    transition: all 0.2s;
  }
  .qa-faq-toggle:hover {
    background: var(--blue-100, #dbeafe); border-color: var(--blue-200, #bfdbfe);
  }
  .qa-faq-toggle:focus-visible {
    outline: 2px solid var(--blue-400, #60a5fa);
    outline-offset: 2px;
  }
  .qa-faq-toggle-icon { font-size: 0.82rem; flex-shrink: 0; }
  .qa-faq-toggle-text { flex: 1; text-align: left; }
  .qa-faq-toggle-arrow {
    font-size: 0.7rem; color: var(--blue-400, #60a5fa);
    transition: transform 0.25s ease;
    flex-shrink: 0;
  }
  .qa-faq-toggle[aria-expanded="true"] .qa-faq-toggle-arrow {
    transform: rotate(180deg);
  }
  .qa-faq-panel {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.25, 0.9, 0.35, 1),
                opacity 0.25s ease 0.05s,
                margin 0.3s ease;
    margin: 0;
  }
  .qa-faq-panel.qa-faq-expanded {
    max-height: 300px;
    overflow-y: auto;
    opacity: 1;
    margin-top: 6px;
  }
  .qa-faq-label {
    font-size: 0.66rem; font-weight: 600; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 6px;
  }
  .qa-faq-item { margin-bottom: 4px; cursor: pointer; }
  .qa-faq-q {
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: 10px 10px 10px 3px;
    padding: 7px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--blue-700);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
  }
  .qa-faq-q:hover {
    background: var(--blue-100);
    border-color: var(--blue-200);
  }
  .qa-faq-q.qa-faq-open {
    border-radius: 10px 10px 3px 3px;
    border-bottom-color: transparent;
    background: var(--blue-100);
  }
  .qa-faq-arrow {
    font-size: 0.55rem; color: var(--blue-400);
    transition: transform 0.2s;
  }
  .qa-faq-q.qa-faq-open .qa-faq-arrow { transform: rotate(180deg); }

  .qa-faq-a {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.25, 0.9, 0.35, 1),
                opacity 0.25s ease;
  }
  .qa-faq-a.qa-faq-a-open {
    max-height: 200px; /* V18-fix: 100px silently clipped long answers */
    opacity: 1;
    overflow-y: auto;
  }
  .qa-faq-a-inner {
    background: #fff;
    border: 1px solid var(--blue-100);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
  }
  .qa-faq-avatar {
    width: 22px; height: 22px; border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 1px;
    border: 1px solid var(--blue-100);
  }
  .qa-faq-a-text {
    font-size: 0.7rem;
    color: #4a5a70;
    line-height: 1.5;
  }

  /* ── Back button in card header ── */
  .qa-back-btn {
    margin-left: auto;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--blue-200);
    background: var(--blue-50);
    color: var(--blue-500);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
  }
  .qa-back-btn:hover {
    background: var(--blue-100);
    border-color: var(--blue-400);
    color: var(--blue-700);
  }
  .qa-back-btn svg {
    width: 14px; height: 14px;
  }

  /* ── Adaptive CTA: urgent variant ── */
  .qa-cta.qa-cta-urgent {
    background: linear-gradient(135deg, #dc6b20, #ea8c3a);
    box-shadow: 0 3px 12px rgba(220,107,32,0.2);
  }
  .qa-cta.qa-cta-urgent:hover {
    box-shadow: 0 5px 18px rgba(220,107,32,0.3);
  }

  /* ── CTA shimmer effect ── */
  .qa-cta { position: relative; overflow: hidden; }
  .qa-cta::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
  }
  .qa-cta:hover::after { left: 150%; }

  /* ═══════════════════════════════════════════════════════
     V3 POLISH LAYER — 10 ENHANCEMENTS
     ═══════════════════════════════════════════════════════ */

  /* ── 1. Start button breathing glow ── */
  .start-chat-btn {
    animation: startBtnBreathe 4s ease-in-out infinite;
  }
  @keyframes startBtnBreathe {
    0%   { box-shadow: 0 4px 16px rgba(33,118,212,0.30); }
    50%  { box-shadow: 0 4px 24px rgba(33,118,212,0.50), 0 0 12px 2px rgba(74,154,239,0.15); }
    100% { box-shadow: 0 4px 16px rgba(33,118,212,0.30); }
  }

  /* ── 2. CTA button breathing inside cards ── */
  .qa-cta:not(.qa-cta-urgent) {
    animation: ctaBreathe 5s ease-in-out infinite;
  }
  @keyframes ctaBreathe {
    0%   { box-shadow: 0 3px 12px rgba(33,118,212,0.20); }
    50%  { box-shadow: 0 3px 18px rgba(33,118,212,0.40), 0 0 8px 2px rgba(74,154,239,0.12); }
    100% { box-shadow: 0 3px 12px rgba(33,118,212,0.20); }
  }

  /* ── 3. Social proof — handled in base styles above ── */

  /* ── 4. Card content stagger-reveal ── */
  .qa-layer .qa-header {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .qa-layer .qa-body {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.08s, transform 0.4s ease 0.08s;
  }
  .qa-layer .qa-chip-section:nth-child(1) {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.14s, transform 0.4s ease 0.14s;
  }
  .qa-layer .qa-chip-section:nth-child(2) {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.20s, transform 0.4s ease 0.20s;
  }
  .qa-layer .qa-conditional-wrap {
    opacity: 0;
    transform: translateY(6px);
    transition: max-height 0.4s cubic-bezier(0.25, 0.9, 0.35, 1),
                opacity 0.3s ease 0.1s,
                transform 0.3s ease 0.1s,
                margin 0.4s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .qa-layer .qa-conditional-wrap.qa-cond-revealed {
    opacity: 1;
    transform: translateY(0);
  }
  .qa-layer .qa-referral-row {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.24s, transform 0.4s ease 0.24s, background 0.2s ease, border-color 0.2s ease;
  }
  .qa-layer .qa-faq-section {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.22s, transform 0.4s ease 0.22s;
  }
  .qa-layer .qa-cta {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.30s, transform 0.4s ease 0.30s;
  }
  .qa-layer .qa-footer-note {
    opacity: 0;
    transition: opacity 0.4s ease 0.34s;
  }
  /* When layer becomes visible, cascade everything in */
  .qa-layer.qa-visible .qa-header,
  .qa-layer.qa-visible .qa-body,
  .qa-layer.qa-visible .qa-chip-section,
  .qa-layer.qa-visible .qa-referral-row,
  .qa-layer.qa-visible .qa-faq-section,
  .qa-layer.qa-visible .qa-cta,
  .qa-layer.qa-visible .qa-footer-note {
    opacity: 1;
    transform: translateY(0);
  }

  /* ── 5. Sub-chip hover lift + selection ripple ── */
  .qa-chip {
    transition: all 0.22s cubic-bezier(0.25, 0.9, 0.35, 1);
    position: relative;
  }
  .qa-chip:hover {
    box-shadow: 0 2px 8px rgba(33,118,212,0.12);
    transform: translateY(-1px);
  }
  /* ── 6. Back button delayed entrance + single pulse ── */
  .qa-layer .qa-back-btn {
    opacity: 0;
    transition: opacity 0.4s ease 0.35s, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }
  .qa-layer.qa-visible .qa-back-btn {
    opacity: 1;
    animation: backBtnPulse 1.2s ease-out 0.6s 1;
  }
  @keyframes backBtnPulse {
    0%   { box-shadow: 0 0 0 0 rgba(33,118,212,0.30); }
    50%  { box-shadow: 0 0 0 5px rgba(33,118,212,0); }
    100% { box-shadow: none; }
  }

  /* ── 7. Michael's avatar breathing ring ── */
  .welcome-avatar-wrapper {
    position: relative;
  }
  .welcome-avatar-wrapper::after {
    content: '';
    position: absolute;
    inset: -2px; /* V4 FIX: was -3px, left 1px gap between photo border edge and glow ring inner edge */
    border-radius: 50%;
    border: 2px solid transparent;
    animation: avatarRingBreathe 7s ease-in-out infinite;
    pointer-events: none;
  }
  @keyframes avatarRingBreathe {
    0%   { border-color: rgba(74,154,239,0.0);  box-shadow: 0 0 0 0 rgba(74,154,239,0); }
    50%  { border-color: rgba(74,154,239,0.35); box-shadow: 0 0 12px 2px rgba(74,154,239,0.12); }
    100% { border-color: rgba(74,154,239,0.0);  box-shadow: 0 0 0 0 rgba(74,154,239,0); }
  }

  /* ── 9. Chip preview border pulse on text change ── */
  .chip-preview.chip-border-flash {
    animation: previewBorderFlash 0.5s ease-out;
  }
  @keyframes previewBorderFlash {
    0%   { border-left-color: var(--blue-500); }
    100% { border-left-color: var(--blue-300); }
  }

  /* ── 10. FAQ typing indicator ── */
  .qa-faq-typing {
    display: none;
    gap: 3px;
    padding: 2px 0;
    align-items: center;
    height: 16px;
  }
  .qa-faq-typing span {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--blue-400);
    opacity: 0.4;
    animation: faqTypingDot 1s ease-in-out infinite;
  }
  .qa-faq-typing span:nth-child(2) { animation-delay: 0.15s; }
  .qa-faq-typing span:nth-child(3) { animation-delay: 0.30s; }
  @keyframes faqTypingDot {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50%      { opacity: 1;   transform: translateY(-2px); }
  }
  .qa-faq-a-text {
    transition: opacity 0.3s ease;
  }
  .qa-faq-a-text.faq-text-hidden {
    opacity: 0;
  }

  /* ═══════════════════════════════════════════════════════
     V3 POLISH LAYER 2 — PREMIUM REFINEMENTS
     ═══════════════════════════════════════════════════════ */

  /* ── 1. Card top border glow on open (handoff from chip) ── */
  .quick-answer-card.visible {
    animation: cardBorderGlow 0.6s ease-out;
  }
  @keyframes cardBorderGlow {
    0%   { border-color: var(--blue-500); box-shadow: inset 0 1px 3px rgba(0,0,0,0.04), 0 0 12px 2px rgba(33,118,212,0.2); }
    100% { border-color: var(--blue-100); box-shadow: inset 0 1px 3px rgba(0,0,0,0.04); }
  }

  /* ── 3. (Moved to base dot CSS above) ── */

  /* ── 5. Start button dims when card is open ── */
  .welcome-view.focused .start-chat-row .start-chat-btn {
    opacity: 0.35;
    animation: none;
    transition: opacity 0.5s ease;
  }
  .welcome-view.focused .start-chat-row .start-chat-btn:hover {
    opacity: 0.7;
  }

  /* ── 7. Subtle water caustics in welcome hero ── */
  .welcome-screen::after {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.04;
    background:
      radial-gradient(ellipse 120px 80px at 25% 40%, rgba(255,255,255,0.8) 0%, transparent 70%),
      radial-gradient(ellipse 100px 120px at 70% 60%, rgba(255,255,255,0.6) 0%, transparent 70%),
      radial-gradient(ellipse 80px 60px at 50% 25%, rgba(255,255,255,0.7) 0%, transparent 70%);
    animation: causticsDrift 12s ease-in-out infinite alternate;
    pointer-events: none;
  }
  @keyframes causticsDrift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(8px, -5px) scale(1.05); }
    100% { transform: translate(-5px, 3px) scale(0.97); }
  }

  /* ── 9. Social proof thin progress bar ── */
  .social-proof-progress {
    position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 2px;
    background: rgba(255,255,255,0.12);
    border-radius: 1px;
    overflow: hidden;
  }
  .social-proof-progress-fill {
    height: 100%;
    width: 0%;
    background: rgba(255,255,255,0.45);
    border-radius: 1px;
    animation: proofProgressFill 5.5s linear infinite;
  }
  @keyframes proofProgressFill {
    0%   { width: 0%; }
    100% { width: 100%; }
  }

  /* ── 10. Micro-bounce on chip selection (enhanced) ── */
  .qa-chip.qa-chip-selected {
    animation: chipSelectBounce 0.35s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  @keyframes chipSelectBounce {
    0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(33,118,212,0.35); }
    30%  { transform: scale(1.06); box-shadow: 0 0 0 4px rgba(33,118,212,0.15); }
    60%  { transform: scale(0.97); box-shadow: 0 0 0 6px rgba(33,118,212,0); }
    100% { transform: scale(1);    box-shadow: none; }
  }

  /* ── 2. Conversation transition choreography ── */
  .welcome-view.convo-exiting .quick-answer-card {
    opacity: 0 !important;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease !important;
  }
  .welcome-view.convo-exiting .quick-actions {
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
  }
  .welcome-view.convo-exiting .start-chat-row {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease 0.05s, transform 0.25s ease 0.05s;
  }
  .welcome-view.convo-exiting .welcome-screen {
    opacity: 0 !important;
    transition: opacity 0.35s ease 0.1s !important;
  }
  .convo-view.convo-entering {
    opacity: 0;
    transform: translateY(10px);
  }
  .convo-view.convo-entered {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 0.9, 0.35, 1);
  }

  /* ═══════════════════════════════════════════════════════
     V3 POLISH LAYER 3 — GAP FIXES
     ═══════════════════════════════════════════════════════ */

  /* ── 1. Lane chips stagger-return (JS adds per-chip delay) ── */
  .quick-chip.chip-stagger-in {
    opacity: 0;
    transform: scale(0.85);
    animation: chipStaggerReturn 0.4s cubic-bezier(0.25, 0.9, 0.35, 1) forwards;
  }
  @keyframes chipStaggerReturn {
    0%   { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
  }

  /* ── 3. Powered-by footer polish ── */
  .powered-by {
    text-align: center; padding: 10px 16px; font-size: 0.63rem;
    color: var(--blue-400); letter-spacing: 0.03em; font-weight: 500;
    border-top: 1px solid var(--blue-50);
    background: linear-gradient(180deg, var(--white) 0%, #f8faff 100%);
  }

  /* ── 4. Chat bubble trigger breathing glow ── */
  .chat-bubble-trigger.visible {
    animation: triggerBreathe 4.5s ease-in-out infinite;
  }
  @keyframes triggerBreathe {
    0%   { box-shadow: 0 6px 24px rgba(10,30,61,0.35); }
    50%  { box-shadow: 0 6px 32px rgba(33,118,212,0.50), 0 0 16px 4px rgba(74,154,239,0.15); }
    100% { box-shadow: 0 6px 24px rgba(10,30,61,0.35); }
  }

  /* ── 5. Reduced motion ── */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.2s !important;
    }
    .quick-chip.chip-hover { transform: scale(1.04); }
    .quick-chip.chip-sibling-shrink { transform: scale(0.97); }
    .chip-preview.chip-slide-in { animation: chipSlideIn 0.35s ease both !important; }
    .social-proof-progress-fill { animation: none; width: 100%; }
    .welcome-screen::after { animation: none; }
    .qa-faq-panel { transition-duration: 0.01ms !important; }
    .qa-faq-toggle-arrow { transition-duration: 0.01ms !important; }
    .v18-disc-chip { transition-duration: 0.01ms !important; }
  }

  /* ── 6. Adaptive CTA text fade (JS toggles class) ── */
  .qa-cta.qa-cta-fading {
    opacity: 0.3;
    transition: opacity 0.12s ease;
  }

  /* ── 7. FAQ question hover lift ── */
  .qa-faq-q {
    transition: all 0.22s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .qa-faq-q:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33,118,212,0.08);
  }

  /* ── 8. Greeting tooltip Michael breathing ring ── */
  .greeting-avatar {
    position: relative;
    box-shadow: 0 0 0 0 rgba(74,154,239,0);
    animation: greetingAvatarRing 7s ease-in-out infinite;
  }
  @keyframes greetingAvatarRing {
    0%   { box-shadow: 0 0 0 0 rgba(74,154,239,0), 0 0 0 0 rgba(74,154,239,0); }
    50%  { box-shadow: 0 0 0 3px rgba(74,154,239,0.25), 0 0 8px 2px rgba(74,154,239,0.10); }
    100% { box-shadow: 0 0 0 0 rgba(74,154,239,0), 0 0 0 0 rgba(74,154,239,0); }
  }

  /* ── 9. Scroll fade indicator on card overflow ── */
  .qa-layer::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    display: block;
    background: linear-gradient(180deg, transparent 0%, rgba(246,249,255,0.95) 100%);
    pointer-events: none;
    flex-shrink: 0;
  }

  /* ── 10. Welcome close button polish ── */
  .welcome-close {
    transition: background 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
  .welcome-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: rgba(255,255,255,0.2);
  }

  /* ═══════════════════════════════════════════════════════
     V3 MOBILE / TOUCH — CAPABILITY-BASED
     ═══════════════════════════════════════════════════════ */

  /* ── Touch devices: tap-pulse replaces hover breathing ── */
  @media (hover: none) {
    /* Larger touch targets */
    .quick-chip { padding: 10px 18px; font-size: 0.8rem; }
    .qa-chip { padding: 8px 14px; font-size: 0.74rem; }
    .qa-faq-q { padding: 10px 14px; }
    .qa-back-btn { width: 30px; height: 30px; }
    .qa-back-btn svg { width: 16px; height: 16px; }

    /* Tap-pulse: brief one-shot dark blue flash */
    .quick-chip.chip-tap-pulse {
      animation: chipTapPulse 0.45s ease-out;
    }
    .quick-chip.chip-tap-pulse::before {
      background-color: #0c2d5a;
      animation: chipTapBg 0.45s ease-out;
    }
    @keyframes chipTapPulse {
      0%   { transform: scale(1); color: var(--blue-700); }
      25%  { transform: scale(1.06); color: #fff;
             box-shadow: 0 0 10px 3px rgba(33,118,212,0.25); }
      100% { transform: scale(1); color: var(--blue-700);
             box-shadow: none; }
    }
    @keyframes chipTapBg {
      0%   { background-color: transparent; }
      25%  { background-color: #0c2d5a; }
      100% { background-color: transparent; }
    }

    /* Sub-chip tap pulse */
    .qa-chip.qa-chip-tap-pulse {
      animation: subChipTap 0.35s ease-out;
    }
    @keyframes subChipTap {
      0%   { transform: scale(1); }
      30%  { transform: scale(1.05);
             box-shadow: 0 0 0 4px rgba(33,118,212,0.15); }
      100% { transform: scale(1); box-shadow: none; }
    }

    /* Disable hover-only effects that feel wrong on touch */
    .quick-chip.chip-hover { transform: none; animation: none; }
    .quick-chip.chip-hover::before { animation: none; background: transparent; }
    .quick-chip.chip-sibling-shrink { transform: none; opacity: 1; }
    .qa-chip:hover { transform: none; box-shadow: none; }
    .qa-faq-q:hover { transform: none; box-shadow: none; }
    .welcome-close:hover { transform: none; }

    /* Chip preview on mobile — slightly more compact */
    .chip-preview { min-height: 44px; font-size: 0.7rem; }
  }

  /* ── Small screens: layout adjustments ── */
  @media (max-width: 480px) {
    .chat-card {
      width: calc(100vw - 16px);
      right: 8px; bottom: 80px;
      border-radius: 18px;
    }
    .chat-bubble-trigger { width: 54px; height: 54px; bottom: 16px; right: 12px; }
    .chat-greeting { right: 12px; bottom: 78px; max-width: 200px; font-size: 0.82rem; }

    .welcome-screen { padding: 18px 20px 14px; min-height: 200px; }
    .welcome-top-row { gap: 10px; }
    .welcome-avatar { width: 44px; height: 44px; }
    .welcome-name-group h3 { font-size: 0.88rem; }
    .welcome-msg { font-size: 0.82rem; }
    .social-proof { min-height: 64px; }
    .proof-quote { font-size: 0.65rem; }
    .proof-author { font-size: 0.58rem; }

    .quick-actions { padding: 12px 14px; }
    .quick-chips-row { gap: 6px; }
    .chip-preview { padding: 6px 12px; margin: 4px 0 0; font-size: 0.68rem; min-height: 40px; }

    .quick-answer-card.visible { padding: 14px; margin: 0 12px 4px; }
    .qa-header { margin-bottom: 6px; }
    .qa-title { font-size: 0.78rem; }
    .qa-body ul li { font-size: 0.72rem; }
    .qa-chip-label { font-size: 0.62rem; }
    .qa-cta { padding: 11px 14px; font-size: 0.78rem; }
    .qa-footer-note { font-size: 0.62rem; }

    .start-chat-row { margin: 12px 14px 16px; }
    .start-chat-btn { padding: 11px 18px; font-size: 0.84rem; }

    .card-input { padding: 10px 14px; }
    .card-input input { font-size: 0.82rem; padding: 8px 4px; }
    .msg-bubble { font-size: 0.8rem; padding: 10px 13px; }

    .convo-final-confirm .final-check-ring { width: 60px; height: 60px; }
    .convo-final-confirm .final-check-ring svg { width: 28px; height: 28px; }
    .convo-final-confirm .final-confirm-text { font-size: 0.84rem; }
  }

  /* ── Compact mode for short screens ── */
  @media (max-height: 720px) {
    .chat-card { bottom: 80px; max-block-size: calc(100dvh - 80px - env(safe-area-inset-bottom, 0px) - 16px); }
    .welcome-screen { padding: 16px 24px 10px; min-height: 220px; }
    .quick-actions { padding: 12px 16px; }
    .quick-answer-card.visible { padding: 12px; }
    .qa-chip-section { margin: 4px 0 6px; }
    .qa-chip-label { margin-bottom: 4px; }
    .qa-chip-row { gap: 4px; }
    .qa-body { margin-bottom: 8px; }
    .qa-body ul li { padding: 1px 0; }
    .qa-cta { padding: 8px 14px; }
    .qa-footer-note { margin-top: 4px; }
    .qa-faq-toggle { padding: 6px 10px; }
    .start-chat-row { margin: 12px 16px 14px; }
    .social-proof { min-height: 56px; }
  }
  @supports not (height: 100dvh) {
    @media (max-height: 720px) {
      .chat-card { max-block-size: calc(100vh - 80px - 16px); }
    }
  }
