:root {
  --avio-chat-blue: #2d8cff;
  --avio-chat-blue-bright: #55c7ff;
  --avio-chat-ink: #07172c;
  --avio-chat-muted: #7890aa;
  --avio-chat-border: rgba(104, 178, 255, .18);
}

.avio-chat-launcher {
  position: fixed;
  z-index: 1000;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 19px;
  border: 1px solid rgba(112, 198, 255, .55);
  border-radius: 999px;
  color: #041325;
  background: linear-gradient(135deg, #66d8ff, #2f91ff);
  box-shadow: 0 16px 42px rgba(8, 65, 150, .32), 0 0 0 5px rgba(61, 164, 255, .09);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.avio-chat-launcher:hover,
.avio-chat-launcher:focus-visible { transform: translateY(-2px); box-shadow: 0 19px 46px rgba(8, 65, 150, .42), 0 0 0 6px rgba(61, 164, 255, .13); }
.avio-chat-launcher-icon { font-size: 20px; line-height: 1; }

.avio-chat-panel {
  position: fixed;
  z-index: 1001;
  right: 24px;
  bottom: 86px;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  max-height: min(650px, calc(100dvh - 110px));
  overflow: hidden;
  color: #edf7ff;
  background: linear-gradient(160deg, #0e2a48 0%, #07182d 62%, #061326 100%);
  border: 1px solid var(--avio-chat-border);
  border-radius: 22px;
  box-shadow: 0 25px 70px rgba(0, 12, 30, .45), 0 0 0 1px rgba(104, 178, 255, .05);
}

.avio-chat-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 19px 15px; border-bottom: 1px solid rgba(139, 204, 255, .12); }
.avio-chat-header strong { display: block; font-size: 16px; letter-spacing: -.01em; }
.avio-chat-header span { display: block; margin-top: 4px; color: #91b0ca; font-size: 12px; }
.avio-chat-close { width: 31px; height: 31px; border: 0; border-radius: 50%; color: #b8d4e9; background: rgba(255,255,255,.07); font-size: 23px; line-height: 1; cursor: pointer; }
.avio-chat-close:hover { color: white; background: rgba(255,255,255,.14); }
.avio-chat-status { min-height: 22px; padding: 10px 19px 0; color: #81a5c2; font-size: 12px; }
.avio-chat-status-error { color: #ff9e9e; }
.avio-chat-status-loading { color: var(--avio-chat-blue-bright); }
.avio-chat-status-closed { color: #ffcd88; }

.avio-chat-start, .avio-chat-conversation { min-height: 0; }
.avio-chat-welcome { display: flex; gap: 11px; margin: 7px 17px 11px; padding: 13px; border: 1px solid rgba(119, 207, 255, .13); border-radius: 15px; background: rgba(73, 163, 227, .08); }
.avio-chat-welcome > span { font-size: 23px; }
.avio-chat-welcome strong { font-size: 14px; }
.avio-chat-welcome p { margin: 4px 0 0; color: #9eb8ce; font-size: 12px; line-height: 1.45; }
.avio-chat-start-form { display: grid; gap: 9px; padding: 0 17px 18px; }
.avio-chat-start-form input, .avio-chat-start-form textarea, .avio-chat-input { width: 100%; box-sizing: border-box; border: 1px solid rgba(127, 189, 231, .18); border-radius: 12px; outline: none; color: #eff9ff; background: rgba(0, 8, 22, .3); font: inherit; font-size: 13px; }
.avio-chat-start-form input { height: 42px; padding: 0 12px; }
.avio-chat-start-form textarea { min-height: 88px; padding: 11px 12px; resize: vertical; }
.avio-chat-start-form input::placeholder, .avio-chat-start-form textarea::placeholder, .avio-chat-input::placeholder { color: #6d8da8; }
.avio-chat-start-form input:focus, .avio-chat-start-form textarea:focus, .avio-chat-input:focus { border-color: rgba(80, 190, 255, .7); box-shadow: 0 0 0 3px rgba(65, 171, 255, .12); }
.avio-chat-start-form button { min-height: 44px; border: 0; border-radius: 12px; color: #06182d; background: linear-gradient(135deg, #65ddff, #348cff); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.avio-chat-start-form button:disabled, .avio-chat-send:disabled { opacity: .6; cursor: wait; }

.avio-chat-messages { display: flex; flex-direction: column; gap: 10px; max-height: 390px; overflow-y: auto; padding: 7px 15px 14px; }
.avio-chat-empty { padding: 35px 12px; color: #83a2bc; text-align: center; font-size: 13px; }
.avio-chat-message { display: flex; flex-direction: column; max-width: 87%; }
.avio-chat-message-user { align-self: flex-end; align-items: flex-end; }
.avio-chat-message-admin { align-self: flex-start; align-items: flex-start; }
.avio-chat-message-bubble { padding: 10px 12px; border-radius: 14px; color: #edf8ff; background: rgba(60, 147, 228, .17); font-size: 13px; line-height: 1.45; word-break: break-word; }
.avio-chat-message-user .avio-chat-message-bubble { border-bottom-right-radius: 5px; color: #04172c; background: linear-gradient(135deg, #75ddff, #3994ff); }
.avio-chat-message-admin .avio-chat-message-bubble { border-bottom-left-radius: 5px; background: rgba(255,255,255,.09); }
.avio-chat-message time { margin: 4px 4px 0; color: #7595af; font-size: 10px; }
.avio-chat-message-form { display: flex; align-items: flex-end; gap: 8px; padding: 11px 13px 13px; border-top: 1px solid rgba(139, 204, 255, .12); background: rgba(0, 6, 17, .2); }
.avio-chat-input { min-height: 43px; max-height: 110px; padding: 11px 12px; resize: vertical; }
.avio-chat-send { flex: 0 0 42px; width: 42px; height: 42px; border: 0; border-radius: 12px; color: #06182d; background: #63d7ff; font-size: 22px; line-height: 1; cursor: pointer; }

@media (max-width: 640px) {
  .avio-chat-launcher { right: 14px; bottom: 82px; min-height: 46px; padding: 0 15px; }
  .avio-chat-panel { right: 10px; bottom: 78px; left: 10px; width: auto; max-height: calc(100dvh - 98px); border-radius: 18px; }
  .avio-chat-messages { max-height: calc(100dvh - 320px); }
}

@media (prefers-reduced-motion: reduce) {
  .avio-chat-launcher { transition: none; }
}
