.ca-chat {
  --chat-navy: #0a2540;
  --chat-teal: #006b76;
  position: fixed;
  bottom: max(18px, env(safe-area-inset-bottom));
  right: max(18px, env(safe-area-inset-right));
  z-index: 8;
  color: var(--chat-navy);
}

.ca-chat [hidden] { display: none !important; }

.ca-chat button, .ca-chat input { font: inherit; }

.ca-chat-launch, .ca-chat-primary {
  background: var(--chat-teal);
  border: 1px solid var(--chat-teal);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  min-height: 44px;
  padding: 8px 14px;
  font-weight: 700 !important;
}

.ca-chat-launch {
  background: var(--chat-navy);
  border-color: var(--chat-navy);
  border-radius: 999px;
  padding-inline: 19px;
  box-shadow: 0 5px 18px #0a254033;
}

.ca-chat-panel {
  width: min(550px, calc(100vw - 36px));
  height: min(720px, calc(100dvh - 36px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dce4e9;
  border-radius: 15px;
  box-shadow: 0 12px 45px #0a25404d;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.55;
}

.ca-chat-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--chat-navy);
  color: white;
  padding: 8px 10px 8px 16px;
}

.ca-chat-controls { display: flex; }
.ca-chat-controls button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 20px;
  min-height: 44px;
  min-width: 40px;
}
.ca-chat-controls button:hover { background: #ffffff21; }
.ca-chat-controls button:focus-visible { outline-offset: -3px; }

.ca-chat-log {
  flex: 1 1 auto;
  min-height: 52px;
  overflow: auto;
  background: #f8fafc;
  padding: 14px;
  overscroll-behavior: contain;
}

.ca-chat-bubble {
  width: fit-content;
  max-width: 93%;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid #dce4e9;
  border-radius: 10px;
  background: white;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.ca-chat-visitor {
  margin-left: auto;
  background: #e8f4f5;
  border-color: #d8ecee;
}

.ca-chat-action {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 69%;
  overflow: auto;
  overscroll-behavior: contain;
  border-top: 1px solid #dce4e9;
  padding: 12px;
}

.ca-chat-options, .ca-chat-input-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ca-chat .ca-chat-input-row {
  flex-wrap: nowrap;
  margin: 8px 0;
  padding: 0;
}

.ca-chat .ca-chat-input-row input {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 16px;
}

.ca-chat-option {
  border: 1px solid #b8ccd2;
  border-radius: 7px;
  background: #fff;
  color: var(--chat-navy);
  min-height: 40px;
  padding: 6px 9px;
  cursor: pointer;
}
.ca-chat-option:hover { background: #edf7f7; }
.ca-chat button:disabled { cursor: wait; opacity: .55; }
.ca-chat-question { font-weight: 700; margin: 3px 0 8px; }
.ca-chat-step {
  margin: 0;
  color: var(--chat-teal);
  font-size: .8125rem;
  font-weight: 700;
}
.ca-chat-actions-row { margin-top: 8px; }
.ca-chat-note { margin: 7px 0 0; color: #4d5e71; font-size: .8125rem; }
.ca-chat-note:empty { display: none; }
/* Scroll the answers separately so the submit and edit controls stay in view. */
.ca-chat-review-mode {
  display: flex;
  flex-direction: column;
}

.ca-chat-review-mode > :not(.ca-chat-review) {
  flex-shrink: 0;
}

.ca-chat-review {
  min-height: 44px;
  max-height: min(26dvh, 190px);
  overflow: auto;
  border: 1px solid #dce4e9;
  border-radius: 8px;
  padding: 10px;
  overflow-wrap: anywhere;
}
.ca-chat-review dl, .ca-chat-review dd { margin: 0; }
.ca-chat-review dt { margin-top: 8px; font-weight: 700; }
.ca-chat-review dt:first-child { margin-top: 0; }
.ca-chat-review + .ca-chat-note { margin-bottom: 8px; }
.ca-chat-draft { display: inline-flex; color: var(--chat-teal); margin-top: 7px; }

@media (max-width: 480px) {
  .ca-chat {
    bottom: max(10px, env(safe-area-inset-bottom));
    right: max(10px, env(safe-area-inset-right));
  }

  .ca-chat-launch { min-height: 36px; padding: 5px 12px; font-size: .875rem !important; }

  .ca-chat-panel {
    width: calc(100vw - 20px);
    height: min(640px, calc(100dvh - 20px));
  }

  .ca-chat-option { min-height: 44px; }
}


.enquiry-date {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.ca-chat-input-row > .enquiry-date {
  flex: 1 1 0;
}

.enquiry-date input.enquiry-date-display {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.enquiry-date-calendar {
  position: relative;
  display: grid;
  flex: 0 0 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #b8ccd2;
  border-radius: 7px;
  color: #0a2540;
  background: #fff;
}

.enquiry-date-calendar:focus-within {
  outline: 2px solid #006b76;
  outline-offset: 2px;
}

.enquiry-date-calendar:hover {
  background: #edf7f7;
}

.enquiry-date .enquiry-date-calendar input,
.ca-chat .ca-chat-input-row .enquiry-date-calendar input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.enquiry-date-calendar input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  cursor: pointer;
}

.enquiry-date-icon {
  position: relative;
  width: 18px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.enquiry-date-icon::before {
  content: '';
  position: absolute;
  inset: 4px 0 auto;
  border-top: 1.5px solid currentColor;
}

.enquiry-date-icon::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 3px;
  right: 3px;
  height: 5px;
  border-inline: 1.5px solid currentColor;
}
