.ie-chat-root {
  position: fixed !important;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #333;
  transition: left 0.28s ease, right 0.28s ease, bottom 0.28s ease;
}

.ie-chat-root .fa {
  font-family: FontAwesome, "Font Awesome 4.7", sans-serif !important;
  font-style: normal;
  font-weight: normal;
}

/* ── Launcher ── */
.ie-chat-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  background: #2b2b2b;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  text-align: left;
  max-width: calc(100vw - 32px);
}

.ie-chat-launcher:hover {
  transform: translateY(-2px);
  background: #333;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.ie-chat-launcher-icon {
  align-items: center;
  background: #f12a43;
  border-radius: 50%;
  display: flex;
  flex-shrink: 0;
  height: 40px;
  justify-content: center;
  width: 40px;
  font-size: 17px;
}

.ie-chat-launcher-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.ie-chat-launcher-copy strong {
  font-size: 14px;
  font-weight: 700;
}

.ie-chat-launcher-copy small {
  color: #bbb;
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}

.ie-chat-root.is-open .ie-chat-launcher {
  display: none;
}

/* ── Panel ── */
.ie-chat-panel {
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 500px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ddd;
}

.ie-chat-panel.is-open {
  display: flex;
}

.ie-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #2b2b2b;
  color: #fff;
  flex-shrink: 0;
}

.ie-chat-header-brand {
  align-items: center;
  display: flex;
  gap: 10px;
}

.ie-chat-header-logo {
  align-items: center;
  background: #444;
  border: 2px solid #f12a43;
  border-radius: 50%;
  display: flex;
  height: 36px;
  justify-content: center;
  width: 36px;
  font-size: 15px;
  color: #fff;
}

.ie-chat-header small {
  color: #aaa;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.ie-chat-close {
  border: 0;
  background: transparent;
  color: #ccc;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.ie-chat-close:hover {
  color: #fff;
}

.ie-chat-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ── Intro (start form) ── */
.ie-chat-intro {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
  overflow: auto;
}

.ie-chat-intro[hidden],
.ie-chat-body[hidden] {
  display: none !important;
}

.ie-chat-welcome {
  margin: 0 0 14px;
  color: #555;
  line-height: 1.5;
  font-size: 14px;
}

.ie-chat-email-note {
  background: #f5f5f5;
  border-left: 3px solid #888;
  border-radius: 0 6px 6px 0;
  color: #555;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.ie-chat-logged-as {
  background: #f5f5f5;
  border-radius: 8px;
  color: #555;
  font-size: 13px;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.ie-chat-field {
  display: block;
  margin-bottom: 12px;
}

.ie-chat-field span {
  color: #444;
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
}

.ie-chat-field span em {
  color: #f12a43;
  font-style: normal;
}

.ie-chat-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  background: #fff;
}

.ie-chat-field input:focus {
  border-color: #666;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.ie-chat-field input.ie-chat-invalid {
  border-color: #c62828;
}

.ie-chat-status {
  font-size: 12px;
  color: #666;
  margin: 4px 0 12px;
  min-height: 0;
}

.ie-chat-status:empty {
  display: none;
  margin: 0;
}

.ie-chat-status-error {
  color: #b71c1c;
}

.ie-chat-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.ie-chat-btn-primary {
  background: #2b2b2b;
  color: #fff;
  margin-top: auto;
  padding: 11px 16px;
  width: 100%;
}

.ie-chat-btn-primary:hover {
  background: #f12a43;
}

/* ── Chat body ── */
.ie-chat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.ie-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 14px;
  background: #f7f7f7;
}

.ie-chat-msg {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.ie-chat-msg-visitor {
  align-items: flex-end;
}

.ie-chat-msg-admin,
.ie-chat-msg-system,
.ie-chat-msg-bot {
  align-items: flex-start;
}

.ie-chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ie-chat-msg-visitor .ie-chat-bubble {
  background: #333;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ie-chat-msg-admin .ie-chat-bubble {
  background: #fff;
  border: 1px solid #ddd;
  border-bottom-left-radius: 4px;
}

.ie-chat-msg-bot .ie-chat-bubble {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 3px solid #888;
  border-bottom-left-radius: 4px;
  color: #444;
}

.ie-chat-msg-bot .ie-chat-time::before {
  content: 'Auto-help · ';
}

.ie-chat-msg-system .ie-chat-bubble {
  background: #eee;
  border: 1px solid #ddd;
  color: #555;
  font-style: italic;
}

.ie-chat-time {
  color: #999;
  font-size: 10px;
  margin-top: 4px;
}

.ie-chat-compose {
  background: #fff;
  border-top: 1px solid #e5e5e5;
  flex-shrink: 0;
  padding: 10px 12px 12px;
}

.ie-chat-topics-label {
  color: #888;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.ie-chat-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ie-chat-topic {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 999px;
  color: #444;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
}

.ie-chat-topic:hover {
  background: #eee;
  border-color: #bbb;
}

.ie-chat-form {
  align-items: flex-end;
  display: flex;
  gap: 8px;
}

.ie-chat-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
}

.ie-chat-form textarea:focus {
  border-color: #666;
  outline: none;
}

.ie-chat-btn-send {
  align-items: center;
  background: #2b2b2b;
  border-radius: 8px;
  color: #fff;
  display: flex;
  height: 42px;
  justify-content: center;
  min-width: 42px;
  padding: 0;
}

.ie-chat-btn-send:hover {
  background: #f12a43;
}

@media (max-width: 480px) {
  .ie-chat-root {
    right: 12px;
    bottom: 12px;
  }

  .ie-chat-launcher-copy small {
    display: none;
  }

  .ie-chat-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-height: none;
  }
}
