:root {
    --chat--color-primary: #0B6F68;
    --chat--color-primary-shade-50: #095650;
    --chat--color-primary-shade-100: #073e3a;
    --chat--color-secondary: #14958a;
    --chat--color-white: #ffffff;
    --chat--color-light: #f4faf9;
    --chat--color-dark: #1a1a1a;
    --chat--color-typing: #6b7b7a;
    --chat--spacing: 1rem;
    --chat--border-radius: 18px;
    --chat--transition-duration: 0.25s;
    --chat--window--width: 400px;
    --chat--window--height: 640px;
    --chat--toggle--background: linear-gradient(135deg, #0B6F68 0%, #14958a 100%);
    --chat--toggle--hover--background: linear-gradient(135deg, #095650 0%, #0f7a71 100%);
    --chat--toggle--active--background: #095650;
    --chat--toggle--color: #ffffff;
    --chat--toggle--size: 62px;
    --chat--header--background: linear-gradient(135deg, #0B6F68 0%, #14958a 100%);
    --chat--header--color: #ffffff;
    --chat--header--padding: 20px 22px;
    --chat--heading--font-size: 1.15em;
    --chat--message--font-size: 0.95rem;
    --chat--message--padding: 0.75rem 1.05rem;
    --chat--message--border-radius: 14px;
    --chat--message-line-height: 1.55;
    --chat--message--bot--background: #ffffff;
    --chat--message--bot--color: #1a1a1a;
    --chat--message--bot--border: 1px solid #e4ecea;
    --chat--message--user--background: #0B6F68;
    --chat--message--user--color: #ffffff;
    --chat--textarea--height: 48px;
    --chat--input--border: 1px solid #d7e6e4;
    --chat--input--border-active: 1px solid #0B6F68;
    --chat--input--border-radius: 12px;
    --chat--input--background: #ffffff;
    --chat--input--text-color: #1a1a1a;
    --chat--input--placeholder--color: #8a9a98;
    --chat--body--background: #f4faf9;
  }

#atlasPreChatHeader {
  position: relative !important;
}
#atlasPreChatCloseBtn {
  box-sizing: border-box !important;
  position: absolute !important;
  top: 12px !important;
  right: 14px !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  z-index: 2 !important;
  transition: background 0.15s ease !important;
}
#atlasPreChatCloseBtn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

.atlas-chat-close-btn {
  box-sizing: border-box !important;
  position: absolute !important;
  top: 16px !important;
  right: 18px !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  z-index: 3 !important;
  transition: background 0.15s ease !important;
}
.atlas-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

  #n8n-chat {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 999999 !important;
  }

  #n8n-chat .chat-window-toggle {
    box-sizing: border-box !important;
    background: linear-gradient(135deg, #0B6F68 0%, #14958a 100%) !important;
    box-shadow: 0 6px 24px rgba(11, 111, 104, 0.35) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  #n8n-chat .chat-window-toggle:hover {
    transform: scale(1.06) !important;
    box-shadow: 0 8px 30px rgba(11, 111, 104, 0.45) !important;
    background: linear-gradient(135deg, #095650 0%, #0f7a71 100%) !important;
  }

  #n8n-chat .chat-window-toggle svg,
  #n8n-chat .chat-window-toggle img {
    display: none !important;
  }

  #n8n-chat .chat-window-toggle::before {
    content: "💬" !important;
    font-size: 28px !important;
    line-height: 1 !important;
    display: block !important;
  }

  #n8n-chat .chat-window {
    border-radius: 20px !important;
    box-shadow: 0 20px 56px rgba(4, 46, 43, 0.22), 0 4px 14px rgba(4, 46, 43, 0.08) !important;
    overflow: hidden !important;
    border: 1px solid rgba(11, 111, 104, 0.10) !important;
  }

  #n8n-chat .chat-header {
    border-bottom: none !important;
    background: linear-gradient(135deg, #0B6F68 0%, #14958a 100%) !important;
    position: relative !important;
    overflow: hidden !important;
  }

  #n8n-chat .chat-header::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: -60% !important;
    width: 60% !important;
    height: 100% !important;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.07), transparent) !important;
    animation: atlasSheen 7s ease-in-out infinite !important;
    pointer-events: none !important;
  }

  @keyframes atlasSheen {
    0% { left: -60%; }
    50% { left: 120%; }
    100% { left: 120%; }
  }

  #n8n-chat .chat-header .chat-heading h1 {
    margin-bottom: 6px !important;
  }

  /* Subtitle row: online-dot text + the "talk to a real person" link.
     Wraps as a tidy inline group with real spacing instead of the two
     parts running into each other. */
  #n8n-chat .chat-header p {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    column-gap: 6px !important;
    row-gap: 2px !important;
    opacity: 0.92 !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
  }

  #n8n-chat .chat-header p::before {
    content: "";
    display: inline-block !important;
    width: 7px !important;
    height: 7px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    background: #4ade80 !important;
    animation: atlasPulse 2s infinite !important;
  }

  @keyframes atlasPulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
  }

  #chatapp-toggle {
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    position: relative !important;
    z-index: 2 !important;
    pointer-events: auto !important;
  }

  #chatapp-toggle:hover {
    opacity: 0.85 !important;
  }

  /* Message input row: force the send button to a fixed circle and
     stop the flex row from stretching it to match the textarea's
     height (the root cause of the oval/stretched look). */
  #n8n-chat .chat-input {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  #n8n-chat .chat-input-send-button,
  #n8n-chat button[type="submit"] {
    box-sizing: border-box !important;
    background: linear-gradient(135deg, #0B6F68 0%, #14958a 100%) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    align-self: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 0 !important;
    box-shadow: 0 3px 10px rgba(11, 111, 104, 0.35) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  }

  #n8n-chat .chat-input-send-button:hover,
  #n8n-chat button[type="submit"]:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 4px 14px rgba(11, 111, 104, 0.45) !important;
  }

  #n8n-chat .chat-input-send-button svg,
  #n8n-chat button[type="submit"] svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    margin: 0 auto !important;
    fill: #ffffff !important;
    color: #ffffff !important;
  }

  #n8n-chat .chat-body {
    background-image: radial-gradient(circle, rgba(11,111,104,0.05) 1px, transparent 1px) !important;
    background-size: 18px 18px !important;
    padding: 16px !important;
  }

  #n8n-chat .chat-message {
    box-shadow: 0 1px 2px rgba(4, 46, 43, 0.04) !important;
  }

  #n8n-chat .chat-message.chat-message-from-user {
    box-shadow: 0 2px 6px rgba(11, 111, 104, 0.25) !important;
  }

  #n8n-chat .chat-input textarea:focus {
    outline: none !important;
  }

  /* Transfer-to-live-agent notice */
  .atlas-transfer-notice {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 10px 12px !important;
    padding: 10px 14px !important;
    background: #eafaf7 !important;
    border: 1px solid rgba(11, 111, 104, 0.18) !important;
    border-radius: 12px !important;
    color: #095650 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    animation: atlasFadeIn 0.2s ease !important;
  }

  .atlas-transfer-notice__dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: #0B6F68 !important;
    flex-shrink: 0 !important;
    animation: atlasPulse 1s infinite !important;
  }

  @keyframes atlasFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Pre-chat "what should we call you?" form */
  #atlasPreChatForm {
    display: none;
    flex-direction: column;
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 340px;
    z-index: 1000000;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(11, 111, 104, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  }

  #atlasPreChatHeader {
    background: linear-gradient(135deg, #0B6F68 0%, #14958a 100%);
    color: #ffffff;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
  }

  #atlasPreChatHeader::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.14), transparent);
    animation: atlasSheen 5s ease-in-out infinite;
    pointer-events: none;
  }

  #atlasPreChatHeader h3 {
    margin: 0 0 6px 0;
    font-size: 1.15em;
    color: #ffffff !important;
    position: relative;
    z-index: 1;
    font-weight: 700;
  }

  #atlasPreChatHeader p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.92;
    color: #ffffff !important;
    position: relative;
    z-index: 1;
  }

  #atlasPreChatBody {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #atlasPreChatBody input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid #d7e6e4;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #1a1a1a;
    outline: none;
  }

  #atlasPreChatBody input:focus {
    border-color: #0B6F68;
  }

  /* intl-tel-input country/flag phone field — match the other inputs */
  #atlasPreChatBody .iti {
    width: 100%;
    display: block;
  }

  #atlasPreChatBody .iti input {
    width: 100%;
  }

  #atlasPreChatBody .iti__flag-container {
    border-radius: 10px 0 0 10px;
  }

  #atlasPreChatBody .iti__selected-flag {
    padding: 0 8px 0 12px;
  }

  #atlasPreChatStart {
    margin-top: 4px;
    background: linear-gradient(135deg, #0B6F68 0%, #14958a 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease;
  }

  #atlasPreChatStart:hover {
    transform: scale(1.02);
  }

  #atlasPreChatError {
    display: none;
    margin: 0;
    font-size: 0.78rem;
    color: #c0392b;
    text-align: center;
  }

  @media (max-width: 480px) {
    #atlasPreChatForm {
      width: calc(100vw - 40px);
      right: 20px;
    }

    #n8n-chat .chat-window {
      width: 100vw !important;
      height: 100vh !important;
      border-radius: 0 !important;
      bottom: 0 !important;
      right: 0 !important;
    }
  }
/* Keep the existing widget readable inside the site's global typography. */
#atlasPreChatHeader h3, #n8n-chat .chat-header h1 { color: #fff; }
#atlasPreChatBody input { color: #1a1a1a; font-family: inherit; }
#atlasPreChatForm { max-height: calc(100dvh - 115px); }
#atlasPreChatBody { overflow-y: auto; }
#atlasPreChatForm button:focus-visible, #n8n-chat button:focus-visible { outline: 2px solid #14958a; outline-offset: 3px; }
@media (max-width: 480px) {
  #n8n-chat .chat-window { height: 100dvh !important; max-height: 100dvh !important; }
}

.atlas-chat-greeting-icon { display: none; }
@media (max-width: 900px) {
  #n8n-chat .chat-window-toggle::before {
    content: "" !important;
    width: 28px;
    height: 28px;
    background: url("/icons/chat.svg") center / contain no-repeat;
  }
  .atlas-chat-greeting-emoji { display: none; }
  .atlas-chat-greeting-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.12em;
  }
}
