#sgx-nova-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483647;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Bubble */
#sgx-nova-chat .sgx-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--sgx-brand, #c40000);
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  cursor: pointer;
}

/* Hide panel when flagged */
#sgx-nova-chat[data-hidden="1"] .sgx-panel {
  display: none;
}

/* Panel */
#sgx-nova-chat .sgx-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: 360px;
  max-height: 80vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
#sgx-nova-chat .sgx-header {
  background: linear-gradient(180deg, var(--sgx-brand,#c40000), #7a0000);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#sgx-nova-chat .sgx-header h3 {
  margin: 0;
  font-size: 18px;
}

#sgx-nova-chat .sgx-close {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 0;
  border-radius: 18px;
  width: 36px;
  height: 28px;
  cursor: pointer;
}

/* Tabs */
#sgx-nova-chat .sgx-tabs {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

#sgx-nova-chat .sgx-tabs [role=tab] {
  flex: 1;
  border: 0;
  background: #eee;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: #222222;      /* stronger tab text */
}

#sgx-nova-chat .sgx-tabs [aria-selected=true] {
  background: #fff;
  border: 1px solid #ddd;
  color: #222222;
}

/* Body area – scrolls when tall */
/*#sgx-nova-chat .sgx-body {
  padding: 12px;
  overflow-y: auto;
}*/




/* Generic bodies – Booking & Quote will still scroll */
#sgx-nova-chat .sgx-body {
  padding: 12px;
}

/* Booking & Quote keep scrolling behavior */
#sgx-nova-chat .sgx-body[data-tab="booking"],
#sgx-nova-chat .sgx-body[data-tab="quote"] {
  max-height: 60vh;
  overflow-y: auto;
}






/* Message bubbles */
#sgx-nova-chat .ai {
  background: #f7f7f7;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px;
  margin: 0 0 10px 0;
  white-space: pre-wrap;
}

#sgx-nova-chat .ai.user-msg {
  background: #eaf6ff;
  border-color: #d6ecff;
}

/* Reply row */
#sgx-nova-chat .sgx-reply {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

#sgx-nova-chat .sgx-reply-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px;
}

#sgx-nova-chat .sgx-reply button {
  background: var(--sgx-brand,#c40000);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 600;
  cursor: pointer;
}

/* Services grid */
#sgx-nova-chat .sgx-services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Strong, readable service buttons – FINAL */
#sgx-nova-chat .sgx-services-grid button {
  background: #f3f3f3;        /* light grey */
  color: #222222;             /* dark text */
  font-weight: 600;           /* semi-bold */
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  height: 42px;
}

/* Optional hover */
#sgx-nova-chat .sgx-services-grid button:hover {
  background: #ffffff;
  border-color: var(--sgx-brand, #c40000);
}

/* Forms */
#sgx-nova-chat .sgx-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#sgx-nova-chat .sgx-row {
  display: flex;
  gap: 8px;
}

#sgx-nova-chat .sgx-row input,
#sgx-nova-chat .sgx-row select,
#sgx-nova-chat textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 8px;
  font-size: 14px;
}

#sgx-nova-chat textarea {
  resize: vertical;
}

/* Submit buttons */
#sgx-nova-chat .sgx-submit {
  background: var(--sgx-brand,#c40000);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Footer */
#sgx-nova-chat .sgx-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-top: 1px solid #eee;
  background: #fafafa;
  font-size: 12px;
}

#sgx-nova-chat .sgx-footer a {
  color: var(--sgx-brand,#c40000);
  text-decoration: none;
}

/* Mobile */
@media (max-width: 480px) {
  #sgx-nova-chat .sgx-panel {
    right: 10px;
    left: 10px;
    width: auto;
  }
}






#sgx-nova-chat .sgx-body[data-tab="services"] {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#sgx-nova-chat .sgx-services-grid {
    flex: 1;
    overflow-y: auto;
}

#sgx-nova-chat .sgx-reply {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 8px;
    padding-bottom: 4px;
}



/* SERVICES tab: messages scroll, input stays at bottom */
#sgx-nova-chat .sgx-panel {
  display: flex;
  flex-direction: column;
}

/* Services body fills the panel and uses flex layout */
#sgx-nova-chat .sgx-body[data-tab="services"] {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;   /* inner parts manage their own scroll */
}

/* Scrollable messages area */
#sgx-nova-chat .sgx-body[data-tab="services"] .sgx-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 8px;
}

/* Services grid sits above the input, doesn’t scroll off with it */
#sgx-nova-chat .sgx-body[data-tab="services"] .sgx-services-grid {
  flex-shrink: 0;
  margin-bottom: 8px;
}

/* Reply bar fixed at bottom of Services tab */
#sgx-nova-chat .sgx-body[data-tab="services"] .sgx-reply {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding-top: 4px;
  padding-bottom: 4px;
  background: #fff;
}




/* -------------------------------------------------
   SERVICES TAB LAYOUT – input fixed at bottom
   ------------------------------------------------- */

/* Make the Services body a flex column that scrolls */
#sgx-nova-chat .sgx-body[data-tab="services"] {
  display: flex;
  flex-direction: column;
  overflow-y: auto;         /* content scrolls */
  padding-bottom: 72px;     /* space so last message isn't hidden under bar */
}

/* Order: 1) services grid, 2) messages, 3) reply bar */
#sgx-nova-chat .sgx-body[data-tab="services"] .sgx-services-grid {
  order: 1;
  flex-shrink: 0;
}

/* All AI/user bubbles (existing + new) are the "messages" */
#sgx-nova-chat .sgx-body[data-tab="services"] .ai {
  order: 2;
}

/* Reply bar stays stuck to the bottom of the viewport */
#sgx-nova-chat .sgx-body[data-tab="services"] .sgx-reply {
  order: 3;
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-shrink: 0;
}


/* When chatting, hide the services grid for a cleaner chat view */
#sgx-nova-chat.sgx-chatting .sgx-services-grid {
  display: none;
}

/* Avatar bubble variant */
#sgx-nova-chat .sgx-bubble.sgx-has-avatar {
  border-radius: 50%;
  border: 3px solid var(--sgx-brand, #c40000);
  background-color: #ffffff;
  background-size: cover;
  background-position: center center;
}

/* Thank-you message under Booking / Quote forms */
#sgx-nova-chat .sgx-thanks {
  margin-top: 8px;
  font-size: 13px;
  color: #444;
}
