#ile-chat-root {
  --ile-orange: #f26a21;
  --ile-dark: #15191d;
  --ile-panel: #fff;
  --ile-muted: #6b7280;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  width: min(380px, calc(100vw - 28px));
  color: var(--ile-dark);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

#ile-chat-root *, #ile-chat-root *::before, #ile-chat-root *::after { box-sizing: border-box; }
#ile-chat-root [hidden] { display: none !important; }

.ile-invite,
.ile-chat {
  overflow: hidden;
  background: var(--ile-panel);
  border: 1px solid rgba(21,25,29,.12);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15,23,42,.24);
  animation: ile-rise .24s ease-out both;
}

.ile-invite {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  padding: 18px 42px 18px 18px;
}

.ile-invite strong { display: block; margin: 1px 0 5px; font-size: 15px; }
.ile-invite p { margin: 0 0 13px; color: #303841; font-size: 14px; }
.ile-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--ile-orange); color: #fff; font-weight: 800; box-shadow: 0 8px 18px rgba(242,106,33,.26); }
.ile-dismiss, .ile-close { appearance: none; border: 0; background: transparent; cursor: pointer; color: inherit; font-size: 24px; line-height: 1; }
.ile-dismiss { position: absolute; top: 10px; right: 12px; color: #6b7280; }
.ile-reply { appearance: none; border: 0; border-radius: 10px; background: var(--ile-orange); color: #fff; cursor: pointer; font: inherit; font-weight: 700; padding: 10px 15px; box-shadow: 0 7px 16px rgba(242,106,33,.22); }

.ile-chat { height: min(610px, calc(100vh - 42px)); display: grid; grid-template-rows: auto 1fr auto auto auto; }
.ile-chat header { display: grid; grid-template-columns: 44px 1fr auto; gap: 11px; align-items: center; padding: 15px 16px; color: #fff; background: linear-gradient(135deg, #15191d 0%, #293039 100%); }
.ile-chat header strong { display: block; font-size: 15px; }
.ile-status { display: block; margin-top: 2px; color: #b7f7c8; font-size: 11px; }
.ile-close { color: #fff; opacity: .8; }
.ile-messages { overflow-y: auto; padding: 18px 14px; background: linear-gradient(180deg, #f7f8fa, #fff); }
.ile-message { clear: both; max-width: 84%; margin: 7px 0; padding: 10px 12px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ile-message-staff { float: left; border-bottom-left-radius: 5px; background: #fff; box-shadow: 0 4px 12px rgba(15,23,42,.09); }
.ile-message-visitor { float: right; border-bottom-right-radius: 5px; background: var(--ile-orange); color: #fff; }

.ile-typing { display: flex; align-items: center; gap: 4px; width: fit-content; margin: 0 14px 8px; padding: 9px 12px; border-radius: 13px; background: #eef0f2; }
.ile-typing span { width: 7px; height: 7px; border-radius: 50%; background: #7b838d; animation: ile-dot 1.1s infinite ease-in-out; }
.ile-typing span:nth-child(2) { animation-delay: .14s; }
.ile-typing span:nth-child(3) { animation-delay: .28s; }

.ile-details { border-top: 1px solid #eceef1; background: #fff; }
.ile-details summary { cursor: pointer; padding: 10px 14px; color: #525b66; font-size: 12px; font-weight: 700; }
.ile-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 12px; }
.ile-details-grid input { min-width: 0; width: 100%; border: 1px solid #d8dde3; border-radius: 9px; padding: 9px 10px; font: inherit; font-size: 12px; }
.ile-details-grid .ile-phone { grid-column: 1 / 2; }
.ile-save-details { border: 0; border-radius: 9px; background: #293039; color: #fff; cursor: pointer; font-weight: 700; }
.ile-composer { display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: end; border-top: 1px solid #eceef1; padding: 11px; background: #fff; }
.ile-composer textarea { width: 100%; max-height: 100px; resize: none; border: 1px solid #d4d9df; border-radius: 12px; padding: 11px 12px; outline: none; font: inherit; font-size: 14px; }
.ile-composer textarea:focus { border-color: var(--ile-orange); box-shadow: 0 0 0 3px rgba(242,106,33,.13); }
.ile-composer button { width: 44px; height: 42px; border: 0; border-radius: 12px; background: var(--ile-orange); color: #fff; cursor: pointer; font-size: 19px; }

@keyframes ile-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ile-dot { 0%, 65%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 520px) {
  #ile-chat-root { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
  .ile-chat { height: min(680px, calc(100vh - 20px)); }
  .ile-details-grid { grid-template-columns: 1fr; }
  .ile-details-grid .ile-phone { grid-column: auto; }
}

