
                .scroll-to-top {
                    bottom: 100px !important;
                    right: 28px !important;
                }
                /* Above fixed bottom nav; floating WhatsApp hidden in this range */
                @media (max-width: 767px) {
                    .scroll-to-top {
                        bottom: 96px !important;
                        right: 18px !important;
                    }
                }
            

  /* ── Floating WhatsApp button (hidden ≤767px — bottom nav has WhatsApp) ── */
  .halani-fab-wa {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 9000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--whatsapp);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45);
    transition: transform .15s ease, box-shadow .15s ease;
    animation: halani-fab-pulse 2.5s ease-out infinite;
  }
  .halani-fab-wa:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.6);
  }
  .halani-fab-wa svg { width: 32px; height: 32px; }
  @keyframes halani-fab-pulse {
    0%, 100% { box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.55); }
    50%      { box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45), 0 0 0 16px rgba(37, 211, 102, 0); }
  }

  @media (max-width: 767px) {
    .halani-fab-wa { display: none !important; }
  }

  /* Drawer open — hide FAB so it never stacks over menu / bottom CTAs */
  body.mobile-menu-visible .halani-fab-wa {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* On desktop service pages the StickyCTARail already shows a WhatsApp button —
     hide the floating FAB to avoid duplicating the same CTA */
  @media (min-width: 992px) {
    body:has(.halani-sticky-rail) .halani-fab-wa { display: none; }
  }

  /* ── Mobile bottom-nav (3 buttons) ── */
  .halani-mobile-cta {
    display: none;
  }
  @media (max-width: 767px) {
    .halani-mobile-cta {
      display: grid;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 8500;
      grid-template-columns: 1fr 1fr 1fr;
      background: #fff;
      border-top: 1px solid var(--brand-200);
      box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.10);
      padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
      gap: 6px;
    }
    .halani-mobile-cta a {
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 8px 4px;
      border-radius: 12px;
      text-decoration: none !important;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.4px;
      transition: transform .12s ease;
    }
    .halani-mobile-cta a:active { transform: scale(0.96); }
    .halani-mobile-cta a svg { width: 22px; height: 22px; }
    .halani-mobile-cta .call {
      background: var(--brand-50);
      color: var(--brand-red);
    }
    .halani-mobile-cta .wa {
      background: rgba(37, 211, 102, 0.10);
      color: var(--whatsapp);
    }
    .halani-mobile-cta .apply {
      background: var(--grad-brand);
      color: #fff;
      box-shadow: var(--shadow-brand-sm);
    }

    /* Add bottom padding to body content so mobile-cta doesn't overlap content */
    body { padding-bottom: 76px; }
  }


:root {
    --hai-grad-from: #eb2d37;
    --hai-grad-to: #b91c1c;
    --hai-grad-accent: #f59e0b;
}

/* ── Floating launcher ─────────────────────────────────────────── */
.hai-launcher {
    position: fixed;
    right: 94px; /* left of the WhatsApp FAB (right: 22px + 60px FAB + 12px gap) */
    bottom: 29px; /* vertically centered with the 60px FAB at bottom: 22px */
    z-index: 9001;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px 12px 14px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--hai-grad-from) 0%, var(--hai-grad-to) 100%);
    box-shadow:
        0 10px 30px rgba(235, 45, 55, 0.35),
        0 2px 6px rgba(15, 23, 42, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform .18s ease, box-shadow .18s ease, padding .18s ease;
    overflow: hidden;
    isolation: isolate;
}
.hai-launcher::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from 0deg, rgba(255,255,255,0.6), rgba(255,255,255,0) 60%, rgba(255,255,255,0.6));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    animation: hai-spin 6s linear infinite;
    pointer-events: none;
    z-index: -1;
}
.hai-launcher:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow:
        0 14px 36px rgba(235, 45, 55, 0.45),
        0 4px 10px rgba(15, 23, 42, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.hai-launcher-icon {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.hai-launcher-icon svg { width: 22px; height: 22px; }
.hai-launcher-pulse {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35);
    animation: hai-pulse 2.2s ease-out infinite;
}
@keyframes hai-spin { to { transform: rotate(360deg); } }
@keyframes hai-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35); }
    50%      { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
}

/* Mobile: just an icon button */
@media (max-width: 767px) {
    .hai-launcher { padding: 12px; bottom: 86px; right: 16px; gap: 0; }
    .hai-launcher-label { display: none; }
}

body.mobile-menu-visible .hai-launcher {
    display: none !important;
}

/* When the WhatsApp FAB is hidden on desktop service pages (sticky rail
   present), slide the launcher back into its slot so it isn't floating
   next to empty space. */
@media (min-width: 992px) {
    body:has(.halani-sticky-rail) .hai-launcher { right: 22px; }
}

/* Hide launcher while panel is open (we get a header close button instead) */
.hai-open .hai-launcher {
    transform: scale(0.6);
    opacity: 0;
    pointer-events: none;
}

/* ── Panel ─────────────────────────────────────────────────────── */
.hai-panel {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9002;
    width: min(400px, calc(100vw - 32px));
    height: min(640px, calc(100vh - 44px));
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow:
        0 30px 90px rgba(15, 23, 42, 0.30),
        0 8px 24px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: hai-pop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes hai-pop {
    from { transform: translateY(20px) scale(0.94); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Animated gradient border via pseudo-element */
.hai-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(235,45,55,0.6), rgba(245,158,11,0.4) 50%, rgba(235,45,55,0.6));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

@media (max-width: 767px) {
    .hai-panel {
        right: 0; left: 0; bottom: 0;
        width: 100%;
        height: 86vh;
        border-radius: 24px 24px 0 0;
    }
}

.hai-panel-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.0));
}
.hai-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hai-grad-from), var(--hai-grad-to));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 36px;
    box-shadow: 0 4px 12px rgba(235, 45, 55, 0.3);
}
.hai-avatar svg { width: 20px; height: 20px; }
.hai-title {
    flex: 1; min-width: 0;
}
.hai-title-name {
    font-weight: 700; font-size: 14px; color: #0c0a09;
    display: flex; align-items: center; gap: 6px;
}
.hai-title-status {
    font-size: 11px; color: #64748b;
    display: flex; align-items: center; gap: 5px;
    margin-top: 2px;
}
.hai-status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,0.18);
}
.hai-close {
    background: rgba(15, 23, 42, 0.05);
    border: none; border-radius: 50%;
    width: 30px; height: 30px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: #44403c;
    transition: background 0.15s ease, transform 0.15s ease;
}
.hai-close:hover { background: rgba(15, 23, 42, 0.10); transform: rotate(90deg); }

/* ── Messages ──────────────────────────────────────────────────── */
.hai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    scroll-behavior: smooth;
    background:
        radial-gradient(800px 240px at 100% 0%, rgba(235, 45, 55, 0.06), transparent 60%),
        radial-gradient(600px 200px at 0% 100%, rgba(245, 158, 11, 0.06), transparent 60%);
}
.hai-messages::-webkit-scrollbar { width: 6px; }
.hai-messages::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.18); border-radius: 999px;
}

.hai-msg {
    display: flex; flex-direction: column;
    max-width: 88%;
    word-wrap: break-word;
    animation: hai-msg-in 0.25s ease;
}
@keyframes hai-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hai-msg-user {
    align-self: flex-end;
    align-items: flex-end;
}
.hai-msg-assistant {
    align-self: flex-start;
    align-items: flex-start;
}
.hai-bubble {
    padding: 11px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    color: #0c0a09;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    position: relative;
}
.hai-bubble-user {
    background: linear-gradient(135deg, var(--hai-grad-from), var(--hai-grad-to));
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 14px rgba(235, 45, 55, 0.28);
}
.hai-bubble-assistant {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom-left-radius: 6px;
}
.hai-bubble-assistant a { color: var(--hai-grad-to); font-weight: 600; }
.hai-bubble-assistant p { margin: 0 0 8px 0; }
.hai-bubble-assistant p:last-child { margin-bottom: 0; }
.hai-bubble-assistant ul, .hai-bubble-assistant ol { margin: 6px 0 8px 18px; padding: 0; }
.hai-bubble-assistant li { margin-bottom: 4px; }
.hai-bubble-assistant strong { font-weight: 700; color: #0c0a09; }
.hai-bubble-assistant code {
    background: rgba(15, 23, 42, 0.06); padding: 1px 5px; border-radius: 4px; font-size: 12px;
}
.hai-bubble-assistant .hai-h {
    font-weight: 700;
    font-size: 14px;
    color: #0c0a09;
    margin: 14px 0 6px;
    letter-spacing: -0.01em;
}
.hai-bubble-assistant .hai-h:first-child { margin-top: 0; }
.hai-bubble-assistant .hai-h-sub {
    font-weight: 700;
    font-size: 13px;
    color: #1c1917;
    margin: 10px 0 4px;
}

.hai-caret {
    display: inline-block; width: 7px; height: 14px;
    background: var(--hai-grad-to);
    margin-left: 2px; vertical-align: text-bottom;
    border-radius: 2px;
    animation: hai-caret 1s steps(2) infinite;
}
@keyframes hai-caret { 50% { opacity: 0; } }

/* "Thinking" dots — shown in the assistant bubble while we wait for the
   server reply (non-streaming path). Once content arrives the typewriter
   takes over and the dots are replaced by text. */
.hai-thinking {
    display: inline-flex; gap: 4px; align-items: center;
    padding: 4px 0;
}
.hai-thinking span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--hai-grad-to);
    opacity: 0.35;
    animation: hai-thinking 1.2s ease-in-out infinite;
}
.hai-thinking span:nth-child(2) { animation-delay: 0.18s; }
.hai-thinking span:nth-child(3) { animation-delay: 0.36s; }
@keyframes hai-thinking {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40%           { opacity: 1;   transform: translateY(-3px); }
}

.hai-msg-meta {
    font-size: 10px; color: #94a3b8;
    margin-top: 4px;
    padding: 0 4px;
    text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}

.hai-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
}

/* ── Empty state ───────────────────────────────────────────────── */
.hai-empty {
    flex: 1;
    display: flex; flex-direction: column;
    justify-content: center; align-items: flex-start;
    padding: 20px 4px;
    gap: 16px;
}
.hai-empty-hello {
    display: flex; align-items: center; gap: 10px;
    padding: 0 8px;
}
.hai-empty-hello-icon {
    width: 44px; height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--hai-grad-from), var(--hai-grad-to));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(235, 45, 55, 0.35);
}
.hai-empty-hello-icon svg { width: 22px; height: 22px; }
.hai-empty-hello-text { line-height: 1.3; }
.hai-empty-hello-text strong {
    display: block; font-size: 16px; color: #0c0a09; font-weight: 700;
}
.hai-empty-hello-text span {
    font-size: 12px; color: #64748b;
}
.hai-empty-intro {
    font-size: 14px; color: #44403c;
    padding: 0 8px;
    line-height: 1.55;
}
.hai-empty-prompt-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 0 8px;
    margin-top: 4px;
}
.hai-chips {
    display: flex; flex-direction: column; gap: 6px;
    padding: 0 4px;
}
.hai-chip {
    text-align: left;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0c0a09;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    display: flex; align-items: center; gap: 8px;
    line-height: 1.4;
}
.hai-chip:hover {
    background: #fff;
    border-color: rgba(235, 45, 55, 0.35);
    transform: translateX(2px);
}
.hai-chip::before {
    content: "→";
    color: var(--hai-grad-to);
    font-weight: 700;
    flex: 0 0 14px;
}

/* ── Input ─────────────────────────────────────────────────────── */
.hai-input-area {
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.7);
}
.hai-input-row {
    display: flex; gap: 8px;
    align-items: flex-end;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 18px;
    padding: 6px 6px 6px 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hai-input-row:focus-within {
    border-color: rgba(235, 45, 55, 0.45);
    box-shadow: 0 0 0 3px rgba(235, 45, 55, 0.12);
}
.hai-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    color: #0c0a09;
    padding: 7px 0;
    max-height: 120px;
    min-height: 22px;
    line-height: 1.45;
}
.hai-input::placeholder { color: #94a3b8; }
.hai-send {
    flex: 0 0 36px;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--hai-grad-from), var(--hai-grad-to));
    color: #fff;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(235, 45, 55, 0.32);
    transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.hai-send:hover:not(:disabled) {
    transform: scale(1.06);
}
.hai-send:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.85;
}
.hai-send svg { width: 16px; height: 16px; }

.hai-disclaimer {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
    margin-top: 8px;
    padding: 0 8px;
    line-height: 1.5;
}
.hai-disclaimer a { color: #64748b; text-decoration: underline; }
