/* Evergreen Hydroseed FAQ chat widget */
.eh-chat {
  --eh-green: #1f5e3b;
  --eh-green-d: #163f29;
  --eh-green-l: #3f9a5f;
  --eh-slate: #4a5a6a;
  --eh-slate-d: #2f3b47;
  --eh-bg: #f5f7f6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Stack the existing estimate FAB above the chat launcher */
.fab {
  right: 16px;
  bottom: 88px;
  z-index: 70;
}
body.eh-chat-open .fab {
  visibility: hidden;
  pointer-events: none;
}
footer {
  padding-bottom: 120px;
}

.eh-chat-launcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--eh-green);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px #0004;
  display: grid;
  place-items: center;
  padding: 0;
}
.eh-chat-launcher:hover,
.eh-chat-launcher:focus-visible {
  background: var(--eh-green-d);
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.eh-chat-launcher svg {
  width: 26px;
  height: 26px;
  display: block;
}
.eh-chat-launcher[aria-expanded="true"] .eh-icon-chat { display: none; }
.eh-chat-launcher[aria-expanded="false"] .eh-icon-close,
.eh-chat-launcher:not([aria-expanded="true"]) .eh-icon-close { display: none; }
.eh-chat-launcher[aria-expanded="true"] .eh-icon-close { display: block; }

.eh-chat-panel {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 80;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px));
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px #0004;
  display: none;
  flex-direction: column;
  overflow: hidden;
  color: var(--eh-slate-d);
  line-height: 1.5;
}
.eh-chat-panel.is-open {
  display: flex;
}

.eh-chat-header {
  background: var(--eh-slate-d);
  color: #fff;
  padding: 12px 14px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.eh-chat-header h2 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
}
.eh-chat-header p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #c9d3db;
  font-weight: 400;
}
.eh-chat-close {
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}
.eh-chat-close:hover,
.eh-chat-close:focus-visible {
  background: #ffffff22;
  outline: 2px solid #fff;
  outline-offset: 0;
}

.eh-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  background: var(--eh-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.eh-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.95rem;
}
.eh-msg p { margin: 0 0 8px; }
.eh-msg p:last-child { margin-bottom: 0; }
.eh-msg a { color: var(--eh-green); font-weight: 600; }
.eh-msg ul {
  margin: 6px 0 0;
  padding-left: 1.15rem;
}
.eh-msg li { margin: 0 0 4px; }
.eh-msg-bot {
  background: #fff;
  border: 1px solid #dde4e0;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 3px #0000000a;
}
.eh-msg-user {
  background: var(--eh-green);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.eh-chat-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid #dde4e0;
  flex-shrink: 0;
}
.eh-chip {
  background: #fff;
  color: var(--eh-green);
  border: 1px solid var(--eh-green-l);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
}
.eh-chip:hover,
.eh-chip:focus-visible {
  background: var(--eh-green);
  color: #fff;
  outline: 2px solid var(--eh-green-d);
  outline-offset: 1px;
}

.eh-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid #e6ece8;
  flex-shrink: 0;
}
.eh-chat-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.eh-chat-form input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #b8c4cc;
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  min-width: 0;
}
.eh-chat-form input[type="text"]:focus {
  outline: 2px solid var(--eh-green-l);
  outline-offset: 1px;
  border-color: var(--eh-green);
}
.eh-chat-send {
  background: var(--eh-green);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.eh-chat-send:hover,
.eh-chat-send:focus-visible {
  background: var(--eh-green-d);
  outline: 2px solid var(--eh-green-l);
  outline-offset: 1px;
}

@media (max-width: 760px) {
  .fab {
    bottom: 84px;
    right: 12px;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  .eh-chat-launcher {
    right: 12px;
    bottom: 12px;
  }
  .eh-chat-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 76px;
    height: min(70vh, calc(100vh - 100px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .eh-chat-launcher,
  .eh-chat-panel,
  .eh-chip,
  .eh-msg {
    transition: none;
  }
}
