:root {
  --asphalt: #101113;
  --yellow: #FFD400;
  --yellow-hover: #E0B800;
  --white: #FFFFFF;
  --off: #F3F3F1;
  --ink-soft: #5A5D62;
  --line: rgba(16,17,19,0.12);
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- BASE / DESKTOP ---------- */
#holit-chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999999;
  font-family: var(--font-body);
}

#holit-chat-bubble {
  width: 60px;
  height: 60px;
  background-color: var(--asphalt);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background-color 0.2s;
  border: 3px solid var(--yellow);
}

#holit-chat-bubble:hover { transform: scale(1.05); background-color: #000; }

#holit-chat-bubble svg { width: 28px; height: 28px; fill: var(--yellow); }

#holit-chat-window {
  display: none;
  width: 360px;
  height: 520px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
  flex-direction: column;
  overflow: hidden;
  position: absolute;
  bottom: 80px;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  transform: translateY(10px);
  border: 2px solid var(--asphalt);
  z-index: 1000000;
}

#holit-chat-window.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.holit-header {
  background-color: var(--asphalt);
  color: var(--white);
  padding: 16px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid var(--yellow);
  flex-shrink: 0;
}

.holit-close { cursor: pointer; font-size: 24px; color: var(--yellow); line-height: 1; }
.holit-close:hover { color: var(--white); }

#holit-messages {
  flex: 1 1 0;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--off);
}

/* Spacer to push short chats to the bottom */
#holit-messages::before {
  content: "";
  flex: 1 0 auto;
}

.holit-msg-wrapper { 
  display: flex; 
  flex-direction: column; 
  max-width: 85%; 
  flex-shrink: 0; 
}

.holit-msg-wrapper.user { align-self: flex-end; align-items: flex-end; }
.holit-msg-wrapper.bot { align-self: flex-start; align-items: flex-start; }

.holit-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  font-family: var(--font-body);
}

.holit-msg.bot { background: var(--white); color: var(--asphalt); border: 1px solid var(--line); border-bottom-left-radius: 0; }
.holit-msg.user { background: var(--asphalt); color: var(--white); border-bottom-right-radius: 0; }

.holit-time { font-size: 11px; color: var(--ink-soft); margin-top: 4px; margin-left: 4px; margin-right: 4px; }

.holit-typing {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 8px;
  border-bottom-left-radius: 0;
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.holit-typing-text {
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.holit-dots { display: flex; align-items: center; }

.holit-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--yellow-hover);
  border-radius: 50%;
  margin: 0 1.5px;
  animation: holit-bounce 1.4s infinite ease-in-out both;
}

.holit-dots span:nth-child(1) { animation-delay: -0.32s; }
.holit-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes holit-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.holit-quick-replies { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.holit-qr-btn {
  background: var(--white);
  border: 2px solid var(--asphalt);
  color: var(--asphalt);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s;
}

.holit-qr-btn:hover { background: var(--yellow); border-color: var(--yellow); color: var(--asphalt); }

.holit-input-area {
  padding: 12px;
  background: var(--white);
  border-top: 2px solid var(--asphalt);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.holit-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 4px;
  outline: none;
  font-size: 14px;
  font-family: var(--font-body);
}

.holit-input-area input:focus { border-color: var(--asphalt); }

.holit-input-area button {
  background: var(--yellow);
  color: var(--asphalt);
  border: none;
  border-radius: 4px;
  padding: 0 16px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.2s;
}

.holit-input-area button:hover { background: var(--yellow-hover); }
.holit-input-area button:disabled { background: #ccc; color: #666; cursor: not-allowed; }


/* --------------------------------------
   MOBILE — FULL SCREEN CHAT
   -------------------------------------- */
@media (max-width: 700px) {
  /* Prevent body scroll when chat is open (JS also helps here) */
  body.holit-chat-open {
    overflow: hidden !important;
    height: 100% !important;
    position: relative !important;
  }

  /* Hide the floating bubble entirely when chat is open */
  body.holit-chat-open #holit-chat-bubble {
    display: none !important;
  }

  /* Chat window = full screen */
  #holit-chat-window {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;      /* Fallback */
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0;
    pointer-events: none;
    z-index: 2147483647 !important;
  }

  #holit-chat-window.open {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  /* When keyboard opens, JS sets inline height/top. This CSS is the fallback. */
  #holit-chat-window.open {
    height: 100dvh !important;
  }

  /* Header stays fixed at top */
  .holit-header {
    padding: 14px 16px;
    font-size: 15px;
  }

  /* Messages flex fill */
  #holit-messages {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }

  /* Input area stays pinned at bottom */
  .holit-input-area {
    flex-shrink: 0 !important;
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: var(--white);
    position: relative;
    z-index: 10;
  }

  /* Prevent iOS auto-zoom */
  .holit-input-area input {
    font-size: 16px !important;
  }

  .holit-input-area button {
    padding: 0 14px;
  }
}