/* EcoBot widget — ecFence */
#ecobot-root {
  --eb-lime: #79E002;
  --eb-lime-ink: #0B0C0D;
  --eb-bg: #0B0C0D;
  --eb-surface: #1F2229;
  --eb-surface-2: #2A2E36;
  --eb-text: #F5F5F7;
  --eb-muted: #A8A9AB;
  --eb-line: rgba(255, 255, 255, .08);
  --eb-radius: 18px;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: "Poppins", "Gotham", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--eb-text);
}
#ecobot-root *, #ecobot-root *::before, #ecobot-root *::after { box-sizing: border-box; }

/* Launcher */
.eb-launcher {
  width: 60px; height: 60px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer;
  background: var(--eb-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28), 0 0 0 2px var(--eb-lime) inset;
  display: grid; place-items: center;
  transition: transform .15s ease;
  margin-left: auto;
}
.eb-launcher:hover { transform: translateY(-2px); }
.eb-launcher:focus-visible { outline: 3px solid var(--eb-lime); outline-offset: 3px; }
.eb-launcher img { width: 44px; height: 44px; object-fit: contain; }
.eb-launcher svg { width: 26px; height: 26px; color: var(--eb-lime); }
.eb-open .eb-launcher { display: none; }

/* Panel */
.eb-panel {
  display: none;
  width: 380px;
  height: min(620px, calc(100vh - 40px));
  background: var(--eb-bg);
  border: 1px solid var(--eb-line);
  border-radius: var(--eb-radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .4);
  overflow: hidden;
  flex-direction: column;
}
.eb-open .eb-panel { display: flex; }

.eb-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 14px 16px;
  border-bottom: 1px solid var(--eb-line);
}
.eb-ava {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--eb-surface);
  display: grid; place-items: center; overflow: hidden;
  font-weight: 600; color: var(--eb-lime); font-size: 13px;
}
.eb-ava img { width: 100%; height: 100%; object-fit: contain; }
.eb-title { font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.eb-sub { font-size: 11.5px; color: var(--eb-muted); }
.eb-head-actions { margin-left: auto; display: flex; gap: 2px; }
.eb-icon {
  width: 34px; height: 34px; border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; color: var(--eb-muted);
  display: grid; place-items: center;
}
.eb-icon:hover { background: var(--eb-surface); color: var(--eb-text); }
.eb-icon:focus-visible { outline: 2px solid var(--eb-lime); }
.eb-icon svg { width: 18px; height: 18px; }

.eb-log {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.eb-msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.eb-bot { align-self: flex-start; background: var(--eb-surface); border-bottom-left-radius: 6px; }
.eb-user { align-self: flex-end; background: var(--eb-lime); color: var(--eb-lime-ink); border-bottom-right-radius: 6px; font-weight: 500; }
.eb-bot a { color: var(--eb-lime); text-decoration: underline; text-underline-offset: 2px; }
.eb-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.eb-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--eb-muted);
  animation: eb-blink 1.2s infinite ease-in-out;
}
.eb-typing i:nth-child(2) { animation-delay: .15s; }
.eb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes eb-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.eb-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.eb-chip {
  border: 1px solid var(--eb-line); background: var(--eb-surface-2); color: var(--eb-text);
  border-radius: 999px; padding: 8px 13px; font: inherit; font-size: 13px; cursor: pointer;
}
.eb-chip:hover { border-color: var(--eb-lime); }
.eb-chip:focus-visible { outline: 2px solid var(--eb-lime); }

/* Talk To Us form */
.eb-form {
  align-self: stretch;
  background: var(--eb-surface);
  border: 1px solid var(--eb-line);
  border-radius: 16px;
  padding: 14px;
  display: grid; gap: 8px;
}
.eb-form h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.eb-form p { margin: 0; color: var(--eb-muted); font-size: 12px; }
.eb-form input, .eb-form select, .eb-form textarea {
  width: 100%; font: inherit; font-size: 13.5px; color: var(--eb-text);
  background: var(--eb-bg); border: 1px solid var(--eb-line); border-radius: 10px;
  padding: 9px 11px;
}
.eb-form textarea { resize: vertical; min-height: 64px; }
.eb-form input:focus, .eb-form select:focus, .eb-form textarea:focus { outline: none; border-color: var(--eb-lime); }
.eb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eb-hp { position: absolute !important; left: -9999px !important; }
.eb-btn {
  border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer;
  background: var(--eb-lime); color: var(--eb-lime-ink); font: inherit; font-weight: 600;
}
.eb-btn[disabled] { opacity: .6; cursor: default; }
.eb-err { color: #FF8A80; font-size: 12px; }

.eb-compose {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 12px; border-top: 1px solid var(--eb-line);
}
.eb-compose textarea {
  flex: 1; resize: none; max-height: 120px;
  font: inherit; color: var(--eb-text);
  background: var(--eb-surface); border: 1px solid var(--eb-line); border-radius: 14px;
  padding: 10px 13px;
}
.eb-compose textarea:focus { outline: none; border-color: var(--eb-lime); }
.eb-send {
  width: 42px; height: 42px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
  background: var(--eb-lime); color: var(--eb-lime-ink); display: grid; place-items: center;
}
.eb-send[disabled] { opacity: .45; cursor: default; }
.eb-send svg { width: 18px; height: 18px; }
.eb-foot { text-align: center; font-size: 10.5px; color: var(--eb-muted); padding: 0 12px 10px; }
.eb-preview-tag { color: var(--eb-lime); }

@media (max-width: 480px) {
  #ecobot-root { right: 14px; bottom: 14px; }
  #ecobot-root.eb-open { inset: 0; }
  .eb-open .eb-panel { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .eb-typing i { animation: none; opacity: .6; }
  .eb-log { scroll-behavior: auto; }
}
