/* Quick answers widget. Uses the site's green and orange palette. */
.etwc-chat {
  --c-green-900: #142a23; --c-green-800: #1f3d33; --c-green-600: #3f6b5a; --c-green-300: #9cc2ae; --c-green-100: #e8f1ec;
  --c-accent: #e0913a; --c-accent-dark: #b86a17; --c-cream: #fbf7f1; --c-sand: #f3e9dc; --c-ink: #1d2a26; --c-white: #fffdf9;
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--c-ink);
}
.etwc-chat *, .etwc-chat *::before, .etwc-chat *::after { box-sizing: border-box; }

/* Floating bubble */
.etwc-toggle {
  display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 0 18px 0 14px; height: 52px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--c-green-800); color: #fff; font: inherit; font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 8px 22px rgba(20, 42, 35, .35), 0 0 0 2px rgba(255, 255, 255, .9);
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.etwc-toggle svg { flex: none; color: var(--c-accent); }
.etwc-toggle:hover { background: var(--c-green-900); transform: translateY(-2px); }
.etwc-toggle:focus-visible, .etwc-close:focus-visible, .etwc-chip:focus-visible, .etwc-btn:focus-visible,
.etwc-send:focus-visible, .etwc-link:focus-visible, .etwc-log:focus-visible {
  outline: 3px solid var(--c-accent); outline-offset: 2px;
}
.etwc-open .etwc-toggle { background: var(--c-accent-dark); }
.etwc-open .etwc-toggle svg { color: #fff; }

/* Panel */
.etwc-panel {
  position: absolute; right: 0; bottom: 66px; width: 380px; max-width: calc(100vw - 24px);
  height: min(600px, calc(100vh - 110px)); height: min(600px, calc(100dvh - 110px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--c-cream); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(20, 42, 35, .35), 0 0 0 1px rgba(20, 42, 35, .08);
  opacity: 0; transform: translateY(12px) scale(.98); transform-origin: bottom right;
  transition: opacity .18s ease, transform .18s ease;
}
.etwc-panel[hidden] { display: none; }
.etwc-open .etwc-panel { opacity: 1; transform: none; }

.etwc-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--c-green-800); color: #fff; flex: none; }
.etwc-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--c-accent); color: var(--c-green-900); display: grid; place-items: center; flex: none; }
.etwc-avatar svg { width: 20px; height: 20px; }
.etwc-titles { flex: 1; min-width: 0; }
.etwc-title { margin: 0; font-size: 1rem; font-weight: 700; color: #fff; font-family: inherit; line-height: 1.2; }
.etwc-sub { margin: 2px 0 0; font-size: .8rem; color: var(--c-green-300); }
.etwc-close { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.etwc-close:hover { background: rgba(255, 255, 255, .24); }

/* Conversation */
.etwc-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
@media (prefers-reduced-motion: reduce) { .etwc-log { scroll-behavior: auto; } }
.etwc-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 100%; animation: etwc-in .22s ease both; }
.etwc-user { align-items: flex-end; }
.etwc-bubble { max-width: 88%; padding: 10px 13px; border-radius: 16px; overflow-wrap: anywhere; }
.etwc-bot .etwc-bubble { background: var(--c-white); border: 1px solid #e6dccb; border-bottom-left-radius: 5px; color: var(--c-ink); }
.etwc-user .etwc-bubble { background: var(--c-green-800); color: #fff; border-bottom-right-radius: 5px; }
.etwc-link { color: var(--c-accent-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Typing dots */
.etwc-typing .etwc-bubble { display: inline-flex; gap: 5px; align-items: center; padding: 13px 14px; }
.etwc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-green-600); opacity: .35; animation: etwc-bounce 1.1s infinite ease-in-out; }
.etwc-dot:nth-child(2) { animation-delay: .15s; }
.etwc-dot:nth-child(3) { animation-delay: .3s; }
@keyframes etwc-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes etwc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .etwc-row { animation: none; } .etwc-dot { animation: none; opacity: .7; } .etwc-panel, .etwc-toggle { transition: none; } }

/* Quick reply chips and action buttons */
.etwc-chips { display: flex; flex-wrap: wrap; gap: 7px; max-width: 100%; }
.etwc-chip { margin: 0; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--c-green-600); background: #fff; color: var(--c-green-800); font: inherit; font-size: .87rem; font-weight: 600; cursor: pointer; transition: background-color .15s ease, color .15s ease; text-align: left; }
.etwc-chip:hover { background: var(--c-green-800); color: #fff; border-color: var(--c-green-800); }
.etwc-chips.etwc-used { display: none; }
.etwc-actions { display: flex; flex-direction: column; gap: 7px; width: 88%; }
.etwc-btn { display: block; padding: 10px 14px; border-radius: 12px; text-align: center; font-weight: 700; font-size: .9rem; text-decoration: none; overflow-wrap: anywhere; }
.etwc-btn-main { background: var(--c-accent); color: var(--c-green-900); }
.etwc-btn-main:hover { background: #eca14f; }
.etwc-btn-alt { background: #fff; color: var(--c-green-800); border: 1.5px solid var(--c-green-600); }
.etwc-btn-alt:hover { background: var(--c-green-100); }

/* Input */
.etwc-form { display: flex; gap: 8px; padding: 10px 12px; background: var(--c-white); border-top: 1px solid #e6dccb; flex: none; }
.etwc-input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1.5px solid #cfc3ae; border-radius: 999px; background: #fff; color: var(--c-ink); font: inherit; font-size: 16px; }
.etwc-input:focus { outline: none; border-color: var(--c-green-600); box-shadow: 0 0 0 3px rgba(63, 107, 90, .25); }
.etwc-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--c-accent); color: var(--c-green-900); cursor: pointer; display: grid; place-items: center; padding: 0; }
.etwc-send:hover { background: #eca14f; }
.etwc-foot { margin: 0; padding: 0 14px 10px; background: var(--c-white); font-size: .72rem; color: #5e6b66; text-align: center; flex: none; }
.etwc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Phones: near full-screen panel, smaller round bubble, bubble hides while a page form is being filled in */
@media (max-width: 640px) {
  .etwc-chat { right: 14px; bottom: 14px; }
  .etwc-toggle { width: 54px; height: 54px; padding: 0; justify-content: center; }
  .etwc-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .etwc-chat.etwc-away { display: none; }
  .etwc-panel {
    position: fixed; left: 0; right: 0; top: 0; bottom: auto; width: 100%; max-width: none;
    height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none;
    transform: translateY(24px);
  }
  .etwc-open .etwc-panel { transform: none; }
  .etwc-open .etwc-toggle { display: none; }
  .etwc-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .etwc-form { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .etwc-bubble { max-width: 92%; }
  .etwc-actions { width: 100%; }
}
@media print { .etwc-chat { display: none; } }
