/* U Homes L Chatbot - Final Popup CSS */

.uh-chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9997;
}

.uh-chat-overlay.uh-open {
  opacity: 1;
  pointer-events: none;
}

.uh-chat-launcher {
  position: fixed;
  bottom: 22px;
  right: 22px;
  min-width: 180px;
  height: 62px;
  padding: 0 22px 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2a0d09 0%, #36120D 48%, #7a4230 100%);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(54, 18, 13, 0.30), 0 2px 6px rgba(54, 18, 13, 0.22);
  z-index: 9998;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, opacity 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.uh-chat-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(54, 18, 13, 0.40), 0 3px 8px rgba(54, 18, 13, 0.26);
}

.uh-chat-launcher:active {
  transform: translateY(-1px) scale(0.99);
}

.uh-chat-launcher::after {
  content: "Chat with Raa";
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.uh-chat-launcher-pulse {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(251, 226, 202, 0.5);
  z-index: -1;
  pointer-events: none;
  animation: uh-launcher-pulse 2.6s ease-out infinite;
}

.uh-chat-launcher-icon {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #F1EEE6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(54, 18, 13, 0.08), 0 3px 8px rgba(0, 0, 0, 0.18);
}

.uh-chat-launcher-icon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

@keyframes uh-launcher-pulse {
  0% { transform: translateY(-50%) scale(1); opacity: 0.7; }
  70% { transform: translateY(-50%) scale(1.55); opacity: 0; }
  100% { transform: translateY(-50%) scale(1.55); opacity: 0; }
}

.uh-chat-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 20px 22px 96px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(48px) scale(0.96);
  transition: opacity 0.32s ease, transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
}

.uh-chat-container.uh-open {
  opacity: 1;
  pointer-events: none;
  transform: translateY(0) scale(1);
}

/* Floating widget: only the chat box captures clicks so the page behind
   stays fully interactive (no blocking overlay). */
.uh-chat-container.uh-open .uhomesl-chat {
  pointer-events: auto;
}

/* Stage wraps the sparkle burst + the chat box so the burst (positioned
   50%/50%) centers on the BOX, not the full-screen container.
   Width is pinned to the box so the stage can't balloon to the box's
   max-content width (which would push the box off to the left). */
.uh-chat-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(408px, 100%);
  flex: 0 0 auto;
}

.uhomesl-chat {
  width: min(408px, 100%);
  max-height: min(82vh, 640px);
  border-radius: 22px;
  overflow: hidden;
  font-family: var(--font-geist-sans), system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.34), 0 8px 22px rgba(54, 18, 13, 0.20), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  background: #F1EEE6;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.uh-chat-hero {
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, #2a0d09 0%, #36120D 45%, #A98360 100%);
  color: #fff;
}

.uh-chat-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  margin-bottom: 12px;
}

.uh-chat-hero-title {
  font-family: var(--font-bodoni), Georgia, serif;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 7px;
}

.uh-chat-hero-text {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.uh-chat-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.uh-quick-btn {
  border: 1px solid rgba(54, 18, 13, 0.06);
  background: #fff;
  color: #2a0d09;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(54, 18, 13, 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.uh-quick-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(54, 18, 13, 0.20);
}

.uh-chat-header {
  padding: 12px 16px;
  background: #ffffff;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.uh-chat-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.uh-chat-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #F1EEE6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
  box-shadow: inset 0 0 0 1px rgba(54, 18, 13, 0.10);
}

.uh-chat-avatar img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.uh-chat-online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #10b981;
  border: 2px solid #ffffff;
}

.uh-chat-header-main {
  display: flex;
  flex-direction: column;
}

.uh-chat-title {
  font-family: var(--font-bodoni), Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.uh-chat-subtitle {
  font-size: 12px;
  color: #6b7280;
}

.uh-chat-header-actions {
  display: flex;
  gap: 6px;
}

.uh-chat-header-actions button {
  border: none;
  background: #f3f4f6;
  color: #111827;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.uh-chat-header-actions button:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.uh-chat-window {
  height: 320px;
  overflow-y: auto;
  padding: 14px 14px 8px;
  background: #f3f4f6;
}

.uh-chat-window::-webkit-scrollbar {
  width: 6px;
}

.uh-chat-window::-webkit-scrollbar-track {
  background: transparent;
}

.uh-chat-window::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.uh-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.uh-chat-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  font-size: 14px;
  outline: none;
}

.uh-chat-form input:focus {
  border-color: #36120D;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.15);
}

.uh-chat-form button[type="submit"] {
  border: 0;
  background: #36120D;
  color: #fff;
  cursor: pointer;
}

/* Desktop: floating widget — background scrolls normally (no scroll lock).
   Scroll lock is re-applied only on mobile where the chat is full-screen
   (see the max-width:768px media query). */

/* Button row: Send, Voice, Call */

.uh-chat-voice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.uh-icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.uh-icon-btn:hover {
  transform: translateY(-1px);
}

.uh-icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.uh-icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.uh-send-btn {
  background: #36120D;
  color: #fff;
  box-shadow: 0 8px 20px rgba(54, 18, 13, 0.25);
}

.uh-send-btn:hover {
  background: #2a0d09;
}

.uh-mic-btn {
  background: #10b981;
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.22);
}

.uh-mic-btn.recording {
  background: #ef4444;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}

.uh-chat-call-btn {
  background: #111827;
  color: #fff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.18);
}

.uh-chat-call-btn.active {
  background: #ef4444;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}

/* Messages */

.msg {
  margin: 6px 0;
  font-size: 13px;
  animation: uh-fade-in-up 0.18s ease-out;
  max-width: 100%;
}

.msg-inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #F1EEE6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(54, 18, 13, 0.10);
}

.msg-avatar img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.msg-avatar span {
  font-weight: 700;
  font-size: 13px;
  color: #36120D;
}

.msg-text {
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.45;
  word-wrap: break-word;
}

.msg.user {
  display: flex;
  justify-content: flex-end;
}

.msg.user .msg-text {
  margin-left: auto;
  background: #FBE2CA;
  border-bottom-right-radius: 4px;
}

.msg.bot {
  display: flex;
  justify-content: flex-start;
}

.msg.bot .msg-text {
  background: #ffffff;
  border-bottom-left-radius: 4px;
}

.msg.bot.typing,
.msg.bot.thinking {
  padding: 9px 11px;
  margin: 6px 0;
  border-radius: 12px;
  line-height: 1.45;
  font-size: 13px;
  max-width: 92%;
  word-wrap: break-word;
  background: #ffffff;
  font-style: italic;
  color: #6b7280;
}

.msg-text a {
  color: #36120D;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.msg-text a:hover {
  text-decoration: none;
}

/* Inline lead form */

.uh-inline-lead .uh-lead-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #36120D;
}

.uh-inline-lead .uh-lead-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.uh-inline-lead label {
  font-size: 12px;
  color: #374151;
}

.uh-inline-lead input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  background: #ffffff;
  outline: none;
}

.uh-inline-lead input:focus {
  border-color: #36120D;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.15);
}

.uh-lead-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.uh-lead-submit {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #36120D;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.uh-lead-submit:hover {
  background: #000;
}

.uh-lead-cancel {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #36120D;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.uh-lead-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* Inline booking form */

.uh-inline-booking .uh-booking-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #36120D;
}

.uh-inline-booking .uh-booking-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.uh-inline-booking label {
  font-size: 12px;
  color: #374151;
}

.uh-inline-booking input,
.uh-inline-booking textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  background: #ffffff;
  outline: none;
}

.uh-inline-booking input:focus,
.uh-inline-booking textarea:focus {
  border-color: #36120D;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.15);
}

.uh-booking-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.uh-booking-submit {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #36120D;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.uh-booking-submit:hover {
  background: #000;
}

.uh-booking-cancel {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #36120D;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.uh-booking-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* Slot buttons */

.uh-slots-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uh-slots-status {
  font-size: 12px;
  color: #6b7280;
}

.uh-slots-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.uh-slot-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #36120D;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}

.uh-slot-btn:hover {
  transform: translateY(-1px);
  border-color: #36120D;
}

.uh-slot-btn.uh-selected {
  background: #36120D;
  color: #ffffff;
  border-color: #36120D;
}

/* Recording UI */

.uh-recording-status {
  display: none;
  align-items: center;
  gap: 10px;
  flex: 1;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: #111827;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.uh-recording-status:hover {
  background: #e5e7eb;
}

.uh-record-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #dc2626;
  animation: uh-record-pulse 1s infinite;
}

@keyframes uh-record-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.uh-chat-form.is-recording #uh-chat-input,
.uh-chat-form.is-recording .uh-chat-voice-actions {
  display: none;
}

.uh-chat-form.is-recording .uh-recording-status {
  display: flex;
}

/* TTS unlock */

.uh-tts-unlock .msg-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uh-tts-play-btn {
  align-self: flex-start;
  border: none;
  background: #36120D;
  color: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}

.uh-tts-play-btn:hover {
  background: #000;
}

/* Animation */

@keyframes uh-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile */

@media (max-width: 768px) {
  /* Full-screen chat on mobile: lock background scroll and let the whole
     container capture input. */
  body.uh-chat-modal-open {
    overflow: hidden;
  }

  .uh-chat-container.uh-open {
    pointer-events: auto;
  }

  .uh-chat-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
  }

  .uh-chat-stage {
    width: 100%;
    height: 100%;
  }

  .uhomesl-chat {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    display: flex;
    flex-direction: column;
  }

  @supports (height: 100dvh) {
    .uhomesl-chat {
      height: 100dvh;
      max-height: 100dvh;
      min-height: 100dvh;
    }
  }

  .uh-chat-hero {
    padding: 14px 14px 10px;
    flex-shrink: 0;
  }

  .uh-chat-badge {
    font-size: 11px;
    padding: 5px 8px;
    margin-bottom: 8px;
  }

  .uh-chat-hero-title {
    font-size: 18px;
    line-height: 1.28;
    margin-bottom: 6px;
  }

  .uh-chat-hero-text {
    font-size: 12.5px;
    line-height: 1.4;
  }

  .uh-chat-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .uh-quick-btn {
    width: 100%;
    text-align: center;
    font-size: 12px;
    padding: 10px 12px;
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-chat-header {
    padding: 10px 12px;
    flex-shrink: 0;
  }

  .uh-chat-header-actions button {
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-chat-window {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 8px;
  }

  .uh-chat-form {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #e5e7eb;
    background: #fff;
  }

  .uh-chat-form input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 999px;
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-chat-voice-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 0;
    flex-shrink: 0;
  }

  .uh-icon-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .uh-chat-launcher {
    min-width: 132px;
    height: 52px;
    padding: 0 12px;
    border-radius: 14px;
    gap: 8px;
    bottom: 12px;
    right: 12px;
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-chat-launcher::after {
    content: "Chat";
    font-size: 13px;
  }

  .uh-chat-launcher-icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
    border-radius: 10px;
  }

  .msg {
    font-size: 12.5px;
  }

  .msg-inner {
    gap: 6px;
  }

  .msg-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .msg-text {
    padding: 9px 10px;
  }

  .uh-recording-status {
    font-size: 12px;
    padding: 9px 10px;
  }

  .uh-record-dot {
    width: 8px;
    height: 8px;
  }
}

@media (max-width: 480px) {
  .uhomesl-chat {
    border-radius: 18px 18px 0 0;
  }

  .uh-chat-hero {
    padding: 14px 14px 10px;
  }

  .uh-chat-hero-title {
    font-size: 17px;
  }

  .uh-chat-hero-text {
    font-size: 12.5px;
  }

  .uh-chat-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .uh-quick-btn {
    width: 100%;
    text-align: center;
  }

  .uh-chat-header {
    padding: 10px 10px;
  }

  .uh-chat-window {
    padding: 10px 10px 6px;
  }

  .uh-chat-form {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    gap: 6px;
  }

  .uh-chat-form input {
    font-size: 13px;
    padding: 10px 11px;
  }

  .uh-chat-voice-actions {
    gap: 5px;
  }

  .uh-icon-btn {
    width: 40px;
    height: 40px;
  }

  .uh-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .uh-chat-launcher {
    min-width: 128px;
    height: 54px;
    padding: 0 16px 0 6px;
    border-radius: 999px;
    gap: 9px;
    bottom: 14px;
    right: 14px;
  }

  .uh-chat-launcher::after {
    content: "Chat";
    font-size: 13px;
  }

  .uh-chat-launcher-pulse {
    left: 6px;
    width: 42px;
    height: 42px;
  }

  .uh-chat-launcher-icon {
    width: 42px;
    height: 42px;
  }

  .uh-chat-launcher-icon img {
    width: 27px;
    height: 27px;
  }

  .uh-recording-status {
    font-size: 12px;
    padding: 9px 10px;
  }

  .uh-record-dot {
    width: 8px;
    height: 8px;
  }
}


/* Safari fixes */
.uhomesl-chat,
.uh-chat-window,
.uh-chat-form,
.uh-chat-form input,
.uh-quick-btn,
.uh-chat-header-actions button,
.uh-icon-btn {
  box-sizing: border-box;
}

.uh-chat-window,
.uhomesl-chat {
  min-width: 0;
}

@supports (-webkit-touch-callout: none) {
  .uh-chat-container {
    height: -webkit-fill-available;
  }

  .uhomesl-chat {
    height: -webkit-fill-available;
    max-height: -webkit-fill-available;
  }

  .uh-chat-window {
    -webkit-overflow-scrolling: touch;
  }
}

/* =====================================================================
   MAGICAL POP-UP  (auto pop-up materialise, glowing aura, magical
   typewriter greeting, sparkles, shimmering quick-actions)
   Added 2026-09-02. Brand palette: mahogany #36120D / #2a0d09,
   warm bronze #A98360, cream #F1EEE6, peach #FBE2CA.
   ===================================================================== */

/* --- Materialise transition when the popup appears --- */
@keyframes uh-magic-materialise {
  0%   { opacity: 0; transform: scale(0.82) translateY(110px); filter: blur(9px); }
  45%  { opacity: 1; transform: scale(1.025) translateY(-14px); filter: blur(0); }
  68%  { transform: scale(0.994) translateY(6px); }
  84%  { transform: scale(1.004) translateY(-3px); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
.uh-chat-container.uh-magic-in {
  animation: uh-magic-materialise 0.95s cubic-bezier(0.34, 1.42, 0.4, 1) both;
}

/* --- Gentle glowing aura around the chat card while open --- */
@keyframes uh-aura {
  0%, 100% {
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.35),
                0 0 24px rgba(169, 131, 96, 0.30),
                0 0 0 1px rgba(251, 226, 202, 0.22);
  }
  50% {
    box-shadow: 0 30px 74px rgba(15, 23, 42, 0.40),
                0 0 48px rgba(169, 131, 96, 0.58),
                0 0 0 1px rgba(251, 226, 202, 0.42);
  }
}
.uh-chat-container.uh-open .uhomesl-chat {
  animation: uh-aura 3.6s ease-in-out infinite;
}

/* --- Sparkle burst layer (fires on every open) --- */
.uh-chat-sparkle-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}
.uh-chat-sparkle-burst span {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #FBE2CA 40%, #A98360 62%, rgba(169, 131, 96, 0) 72%);
  opacity: 0;
}
.uh-chat-sparkle-burst.uh-burst-run span {
  animation: uh-burst-fly 1.1s ease-out forwards;
}
@keyframes uh-burst-fly {
  0%   { opacity: 0; transform: rotate(var(--ang)) translateY(0) scale(0.2); }
  16%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--ang)) translateY(calc(var(--dist) * -1)) scale(1); }
}
.uh-chat-sparkle-burst span:nth-child(1)  { --ang: 0deg;   --dist: 130px; animation-delay: 0s;    }
.uh-chat-sparkle-burst span:nth-child(2)  { --ang: 30deg;  --dist: 165px; animation-delay: .03s;  }
.uh-chat-sparkle-burst span:nth-child(3)  { --ang: 60deg;  --dist: 140px; animation-delay: .06s;  }
.uh-chat-sparkle-burst span:nth-child(4)  { --ang: 90deg;  --dist: 175px; animation-delay: .02s;  }
.uh-chat-sparkle-burst span:nth-child(5)  { --ang: 120deg; --dist: 135px; animation-delay: .05s;  }
.uh-chat-sparkle-burst span:nth-child(6)  { --ang: 150deg; --dist: 160px; animation-delay: .08s;  }
.uh-chat-sparkle-burst span:nth-child(7)  { --ang: 180deg; --dist: 130px; animation-delay: .01s;  }
.uh-chat-sparkle-burst span:nth-child(8)  { --ang: 210deg; --dist: 168px; animation-delay: .04s;  }
.uh-chat-sparkle-burst span:nth-child(9)  { --ang: 240deg; --dist: 138px; animation-delay: .07s;  }
.uh-chat-sparkle-burst span:nth-child(10) { --ang: 270deg; --dist: 178px; animation-delay: .02s;  }
.uh-chat-sparkle-burst span:nth-child(11) { --ang: 300deg; --dist: 142px; animation-delay: .06s;  }
.uh-chat-sparkle-burst span:nth-child(12) { --ang: 330deg; --dist: 162px; animation-delay: .09s;  }

/* --- Magical typing indicator dots (before greeting types out) --- */
.uh-magic-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 2px 0;
}
.uh-magic-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #36120D, #A98360);
  box-shadow: 0 0 6px rgba(169, 131, 96, 0.65);
  animation: uh-dot-bounce 1s infinite ease-in-out;
}
.uh-magic-dots i:nth-child(2) { animation-delay: .15s; }
.uh-magic-dots i:nth-child(3) { animation-delay: .30s; }
@keyframes uh-dot-bounce {
  0%, 80%, 100% { transform: translateY(0) scale(0.9); opacity: .55; }
  40%           { transform: translateY(-5px) scale(1.1); opacity: 1; }
}

/* --- Magical "Thinking" indicator (shimmering word + dots) --- */
.uh-magic-thinking .msg-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.uh-think-text {
  font-size: 13px;
  font-weight: 600;
  font-style: normal;
  background: linear-gradient(90deg, #36120D 0%, #A98360 30%, #FBE2CA 50%, #A98360 70%, #36120D 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: uh-think-shimmer 2.2s linear infinite;
}
@keyframes uh-think-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -20% center; }
}

/* --- Typewriter caret --- */
.uh-tw-bubble {
  position: relative;
  overflow: visible;
}
.uh-tw-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: linear-gradient(#36120D, #A98360);
  box-shadow: 0 0 8px rgba(169, 131, 96, 0.9);
  border-radius: 2px;
  animation: uh-caret 0.7s steps(1) infinite;
}
@keyframes uh-caret { 50% { opacity: 0; } }
.uh-tw-cursor-done {
  animation: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* --- Floating sparkles emitted while Raa types --- */
.uh-sparkle {
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  background: radial-gradient(circle, #fff 0%, #FBE2CA 45%, rgba(251, 226, 202, 0) 70%);
  border-radius: 50%;
  animation: uh-sparkle-float 0.85s ease-out forwards;
}
@keyframes uh-sparkle-float {
  0%   { opacity: 0; transform: translateY(0) scale(0.4); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-18px) scale(1); }
}

/* --- Shimmering quick-action buttons --- */
.uh-quick-btn {
  position: relative;
  overflow: hidden;
}
.uh-quick-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -140%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: skewX(-18deg);
  animation: uh-btn-shine 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes uh-btn-shine {
  0%   { left: -140%; }
  22%  { left: 140%; }
  100% { left: 140%; }
}
.uh-quick-btn:nth-child(2)::before { animation-delay: .5s; }
.uh-quick-btn:nth-child(3)::before { animation-delay: 1s; }

/* --- Respect reduced-motion preferences --- */
/* =====================================================================
   IDLE "AI ASSISTANT" ATTENTION LOOP (shown only while the chat is closed)
   - electric "charging" energy glow that pulses around the launcher pill
   - periodic call-out chip "Ask Raa - AI assistant" with a glowing
     energy core + expanding signal rings
   Both stop automatically once the chat opens (body.uh-chat-modal-open).
   Reworked 2026-09-02 (digital / electric / AI theme).
   ===================================================================== */

body:not(.uh-chat-modal-open) .uh-chat-launcher {
  animation: uh-launcher-charge 2.6s ease-in-out infinite;
}

/* Let the hover lift take over cleanly */
body:not(.uh-chat-modal-open) .uh-chat-launcher:hover {
  animation: none;
}

/* Electric "charge" breathing glow - reads as powered-up / AI energy */
@keyframes uh-launcher-charge {
  0%, 100% {
    box-shadow: 0 10px 24px rgba(54, 18, 13, 0.30),
                0 0 0 0 rgba(251, 226, 202, 0.0),
                0 0 14px 1px rgba(169, 131, 96, 0.30);
  }
  50% {
    box-shadow: 0 12px 28px rgba(54, 18, 13, 0.34),
                0 0 22px 4px rgba(251, 226, 202, 0.55),
                0 0 40px 8px rgba(169, 131, 96, 0.40);
  }
}

.uh-chat-callout {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #ffffff;
  color: #36120D;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(54, 18, 13, 0.24), 0 2px 6px rgba(54, 18, 13, 0.16);
  border: 1px solid rgba(54, 18, 13, 0.08);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transform-origin: bottom right;
  pointer-events: none;
}

.uh-chat-callout::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 30px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  transform: rotate(45deg);
  border-right: 1px solid rgba(54, 18, 13, 0.08);
  border-bottom: 1px solid rgba(54, 18, 13, 0.08);
}

/* Glowing energy "core" dot with expanding signal rings (AI / electric) */
.uh-chat-callout-spark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.uh-chat-callout-spark .uh-spark-core {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #FBE2CA 45%, #A98360 100%);
  box-shadow: 0 0 6px 1px rgba(251, 226, 202, 0.9), 0 0 10px 2px rgba(169, 131, 96, 0.6);
}
.uh-chat-callout-spark::before,
.uh-chat-callout-spark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 1.5px solid rgba(169, 131, 96, 0.7);
  opacity: 0;
}

body:not(.uh-chat-modal-open) .uh-chat-callout {
  animation: uh-callout-loop 9s ease-in-out infinite;
}

body:not(.uh-chat-modal-open) .uh-chat-callout-spark .uh-spark-core {
  animation: uh-spark-flicker 1.4s ease-in-out infinite;
}
body:not(.uh-chat-modal-open) .uh-chat-callout-spark::before {
  animation: uh-spark-ring 2.2s ease-out infinite;
}
body:not(.uh-chat-modal-open) .uh-chat-callout-spark::after {
  animation: uh-spark-ring 2.2s ease-out infinite;
  animation-delay: 1.1s;
}

body.uh-chat-modal-open .uh-chat-callout {
  display: none;
}

@keyframes uh-callout-loop {
  0% { opacity: 0; transform: translateY(8px) scale(0.9); }
  5% { opacity: 1; transform: translateY(0) scale(1); }
  30% { opacity: 1; transform: translateY(0) scale(1); }
  38% { opacity: 0; transform: translateY(8px) scale(0.9); }
  100% { opacity: 0; transform: translateY(8px) scale(0.9); }
}

@keyframes uh-spark-flicker {
  0%, 100% { opacity: 1; transform: scale(1); filter: brightness(1); }
  40% { opacity: 0.55; transform: scale(0.82); filter: brightness(1.4); }
  55% { opacity: 1; transform: scale(1.12); filter: brightness(1.6); }
  70% { opacity: 0.75; transform: scale(0.94); }
}

@keyframes uh-spark-ring {
  0% { opacity: 0.8; transform: scale(0.5); }
  70% { opacity: 0; transform: scale(2.4); }
  100% { opacity: 0; transform: scale(2.4); }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.uh-chat-modal-open) .uh-chat-launcher { animation: none; }
  .uh-chat-launcher-pulse { animation: none; }
  .uh-chat-callout { animation: none; opacity: 0; }
  .uh-chat-callout-spark .uh-spark-core,
  .uh-chat-callout-spark::before,
  .uh-chat-callout-spark::after { animation: none; opacity: 0; }
  .uh-chat-container.uh-magic-in { animation: none; }
  .uh-chat-container.uh-open .uhomesl-chat { animation: none; }
  .uh-chat-sparkle-burst.uh-burst-run span { animation: none; opacity: 0; }
  .uh-magic-dots i { animation: none; }
  .uh-think-text { animation: none; }
  .uh-tw-cursor { animation: none; }
  .uh-sparkle { display: none; }
  .uh-quick-btn::before { animation: none; display: none; }
}
