.jetchat-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 99990;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #0a52d6 0%, #0a6cff 55%, #2f8bff 100%); color: #fff;
  box-shadow: 0 10px 30px -8px rgba(10, 82, 214, .6), 0 0 0 3px rgba(255, 255, 255, .92);
  display: grid; place-items: center;
  transition: transform .15s, background .15s;
}
.jetchat-btn:hover { transform: translateY(-2px); }
.jetchat-btn span { grid-area: 1 / 1; display: grid; place-items: center; transition: opacity .15s, transform .2s; }
.jetchat-btn svg { width: 24px; height: 24px; }
.jetchat-btn__close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.jetchat-btn.is-open .jetchat-btn__open { opacity: 0; transform: rotate(90deg) scale(.6); }
.jetchat-btn.is-open .jetchat-btn__close { opacity: 1; transform: none; }

.jetchat-panel {
  position: fixed; right: 20px; bottom: 92px; z-index: 99991;
  width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 120px));
  background: #fff; color: #0e1320;
  border: 1px solid #e3e7ee; border-radius: 24px;
  display: none; flex-direction: column; overflow: hidden;
  box-shadow: 0 2px 4px rgba(14, 19, 32, .04), 0 30px 80px -24px rgba(14, 19, 32, .35);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  transform-origin: bottom right;
}
.jetchat-panel.open { display: flex; animation: jetchat-in .18s ease-out; }
@keyframes jetchat-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.jetchat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid #eef0f4; }
.jetchat-ava img { width: 40px; height: 40px; display: block; }
.jetchat-who { flex: 1; min-width: 0; line-height: 1.25; }
.jetchat-who b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.jetchat-who small { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #667085; font-weight: 600; }
.jetchat-who small i { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .15); }
.jetchat-x { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: #667085; cursor: pointer; display: grid; place-items: center; }
.jetchat-x:hover { background: #f1f3f6; color: #0e1320; }
.jetchat-x svg { width: 18px; height: 18px; }

.jetchat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f8f9fb; }
.jetchat-msg { max-width: 82%; padding: 9px 13px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.jetchat-msg.visitor { align-self: flex-end; background: #0a6cff; color: #fff; border-bottom-right-radius: 6px; }
.jetchat-msg.operator { align-self: flex-start; background: #fff; border: 1px solid #e3e7ee; border-bottom-left-radius: 6px; }
.jetchat-msg img { max-width: 100%; border-radius: 12px; display: block; margin-top: 6px; }
.jetchat-msg > div + img { margin-top: 6px; }
.jetchat-msg > img:first-child { margin-top: 0; }

.jetchat-err { color: #d92d20; font-size: 12.5px; font-weight: 600; padding: 8px 16px 0; background: #fff; }
.jetchat-err[hidden] { display: none; }

.jetchat-lead { display: none; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid #eef0f4; background: #fff; }
.jetchat-lead.show { display: flex; }
.jetchat-lead__title { width: 100%; font-size: 13px; font-weight: 700; color: #2a303c; }
.jetchat-lead__title:empty { display: none; }
.jetchat-lead input {
  flex: 1 1 45%; min-width: 110px; height: 38px; padding: 0 12px;
  border: 1px solid #d5dbe5; border-radius: 10px; background: #fff; color: #0e1320; font: inherit; font-size: 14px;
}
.jetchat-lead input:focus { outline: 0; border-color: #0a6cff; box-shadow: 0 0 0 3px rgba(10, 108, 255, .2); }
.jetchat-lead button { flex: 1 1 45%; height: 38px; border: 0; border-radius: 10px; background: #0e1320; color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

.jetchat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid #eef0f4; background: #fff; }
.jetchat-compose textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 10px 14px;
  border: 1px solid #d5dbe5; border-radius: 14px; background: #fff; color: #0e1320;
  font: inherit; font-size: 14.5px; line-height: 1.4;
}
.jetchat-compose textarea:focus { outline: 0; border-color: #0a6cff; box-shadow: 0 0 0 3px rgba(10, 108, 255, .2); }
.jetchat-file, .jetchat-send {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 14px; cursor: pointer;
  display: grid; place-items: center; border: 0;
}
.jetchat-file { background: #f1f3f6; color: #2a303c; }
.jetchat-file:hover { background: #e6e9ee; }
.jetchat-send { background: #0a6cff; color: #fff; }
.jetchat-send:hover { background: #0052d4; }
.jetchat-file svg, .jetchat-send svg { width: 19px; height: 19px; }

@media (max-width: 520px) {
  .jetchat-btn { right: 14px; bottom: 14px; width: 54px; height: 54px; }
  .jetchat-panel { right: 0; left: 0; bottom: 0; top: 0; width: 100%; height: 100%; border-radius: 0; border: 0; }
  .jetchat-btn.is-open { display: none; }
  html.jetchat-lock, html.jetchat-lock body { overflow: hidden; }
}
