.eimoit-chatbot {
  --chat-navy: #071b30;
  --chat-blue: #173656;
  --chat-teal: #18b7a0;
  --chat-teal-dark: #0e927f;
  --chat-muted: #587087;
  position: fixed;
  z-index: 1000;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #112b43;
}

.eimoit-chatbot *, .eimoit-chatbot *::before, .eimoit-chatbot *::after { box-sizing: border-box; }
.eimoit-chatbot button, .eimoit-chatbot textarea { font: inherit; }
.site-footer { padding-bottom: max(92px, calc(24px + env(safe-area-inset-bottom))); }

.eimoit-chatbot__launcher {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--chat-navy), var(--chat-blue));
  color: #fff;
  box-shadow: 0 14px 34px rgba(7,27,48,.28);
  cursor: pointer;
  font-weight: 780;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.eimoit-chatbot__launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(7,27,48,.34); }
.eimoit-chatbot__launcher:focus-visible,
.eimoit-chatbot button:focus-visible,
.eimoit-chatbot textarea:focus-visible {
  outline: 3px solid #66e5d2;
  outline-offset: 3px;
}
.eimoit-chatbot__launcher svg { width: 24px; height: 24px; color: var(--chat-teal); }

.eimoit-chatbot__panel {
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 118px - env(safe-area-inset-bottom)));
  min-height: min(410px, calc(100vh - 118px - env(safe-area-inset-bottom)));
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto auto auto auto;
  margin: 0 0 14px auto;
  overflow: hidden;
  border: 1px solid #cfdae4;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(7,27,48,.3);
  transform-origin: bottom right;
  animation: eimoit-chat-in .18s ease-out;
}
.eimoit-chatbot__panel[hidden] { display: none; }

.eimoit-chatbot__header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px 13px 18px;
  background: linear-gradient(110deg, var(--chat-navy), #0d3659);
  color: #fff;
}
.eimoit-chatbot__header > div:first-child { display: flex; align-items: center; gap: 10px; }
.eimoit-chatbot__header h2 { margin: 0; color: #fff; font-size: 1rem; line-height: 1.2; }
.eimoit-chatbot__status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--chat-teal); box-shadow: 0 0 0 4px rgba(24,183,160,.16); }
.eimoit-chatbot__header-actions { display: flex; gap: 4px; }
.eimoit-chatbot__header-actions button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #dce7f0;
  cursor: pointer;
}
.eimoit-chatbot__header-actions button:hover { background: rgba(255,255,255,.11); color: #fff; }
.eimoit-chatbot__header-actions svg { width: 20px; height: 20px; }

.eimoit-chatbot__messages {
  overflow-y: auto;
  padding: 18px;
  background: #f5f8fa;
  overscroll-behavior: contain;
}
.eimoit-chatbot__message { display: flex; margin-bottom: 12px; }
.eimoit-chatbot__message > div {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 15px;
  font-size: .91rem;
  line-height: 1.48;
  white-space: normal;
  overflow-wrap: anywhere;
}
.eimoit-chatbot__message a { color: inherit; text-decoration: underline; font-weight: 750; }
.eimoit-chatbot__message--assistant > div { border: 1px solid #d8e2ea; border-bottom-left-radius: 4px; background: #fff; color: #29445c; }
.eimoit-chatbot__message--user { justify-content: flex-end; }
.eimoit-chatbot__message--user > div { border-bottom-right-radius: 4px; background: var(--chat-blue); color: #fff; }

.eimoit-chatbot__loading { margin: 2px 0 12px; color: var(--chat-muted); font-size: .84rem; }
.eimoit-chatbot__loading::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--chat-teal-dark); animation: eimoit-chat-pulse 1s ease-in-out infinite; }

.eimoit-chatbot__quick-choices { display: flex; gap: 7px; overflow-x: auto; padding: 10px 14px; border-top: 1px solid #e0e7ed; background: #fff; scrollbar-width: thin; }
.eimoit-chatbot__quick-choices button { flex: 0 0 auto; min-height: 34px; padding: 6px 11px; border: 1px solid #badbd5; border-radius: 999px; background: #effaf8; color: #0a6d60; cursor: pointer; font-size: .78rem; font-weight: 740; }
.eimoit-chatbot__quick-choices button:hover { border-color: var(--chat-teal-dark); background: #dff6f2; }
.eimoit-chatbot button:disabled, .eimoit-chatbot textarea:disabled { cursor: wait; opacity: .58; }

.eimoit-chatbot__error { padding: 9px 14px; border-top: 1px solid #f0c9c9; background: #fff0f0; color: #842727; font-size: .8rem; line-height: 1.4; }
.eimoit-chatbot__error[hidden] { display: none; }

.eimoit-chatbot__form { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; padding: 12px 14px; border-top: 1px solid #dce4eb; background: #fff; }
.eimoit-chatbot__form textarea { width: 100%; min-height: 46px; max-height: 105px; resize: vertical; padding: 11px 12px; border: 1px solid #bdcad6; border-radius: 11px; background: #fff; color: #17324a; line-height: 1.35; }
.eimoit-chatbot__form textarea::placeholder { color: #71869a; }
.eimoit-chatbot__send { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--chat-teal); color: #06352f; cursor: pointer; }
.eimoit-chatbot__send:hover { background: #20c8af; }
.eimoit-chatbot__send svg { width: 21px; height: 21px; }

.eimoit-chatbot__privacy { margin: 0; padding: 0 14px 12px; background: #fff; color: #607489; font-size: .69rem; line-height: 1.35; }
.eimoit-chatbot__visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@keyframes eimoit-chat-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes eimoit-chat-pulse { 50% { opacity: .35; transform: scale(.8); } }

@media (max-width: 580px) {
  .eimoit-chatbot { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .eimoit-chatbot__panel { width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)); height: min(620px, calc(100dvh - 92px - env(safe-area-inset-bottom))); min-height: min(410px, calc(100dvh - 92px - env(safe-area-inset-bottom))); margin-bottom: 10px; border-radius: 17px; }
  .eimoit-chatbot__launcher { width: 56px; min-height: 56px; padding: 0; justify-content: center; }
  .eimoit-chatbot__launcher span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
}

@media (prefers-reduced-motion: reduce) {
  .eimoit-chatbot *, .eimoit-chatbot *::before, .eimoit-chatbot *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
