.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.jr-chat {
  position: fixed;
  z-index: 220;
  right: 22px;
  bottom: 22px;
  color: #0b1630;
  font-family: "DM Sans", sans-serif;
}

.jr-chat-launcher {
  display: flex;
  min-height: 58px;
  padding: 7px 18px 7px 7px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: #0157dd;
  color: #fff;
  box-shadow: 0 16px 42px rgba(0, 43, 130, 0.28);
  cursor: pointer;
}

.jr-chat-launcher-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2d7bf1, #0047bd);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.jr-chat-launcher-mark img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(0, 28, 90, 0.3));
}

.jr-chat-launcher-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.jr-chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100svh - 32px));
  grid-template-rows: auto 1fr auto auto auto;
  overflow: hidden;
  border: 1px solid rgba(1, 87, 221, 0.18);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(4, 29, 80, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
  transform-origin: right bottom;
  visibility: hidden;
}

.jr-chat.is-open .jr-chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.jr-chat.is-open .jr-chat-launcher { opacity: 0; pointer-events: none; }

.jr-chat-header {
  display: flex;
  min-height: 92px;
  padding: 20px;
  align-items: center;
  gap: 12px;
  background: #0157dd;
  color: #fff;
}

.jr-chat-header-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 9px 9px rgba(0, 27, 83, 0.34));
}

.jr-chat-header > div { display: grid; min-width: 0; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.jr-chat-header p { font-family: "Archivo Black", sans-serif; font-size: 1.05rem; text-transform: uppercase; }
.jr-chat-header small { grid-column: 2; color: rgba(255, 255, 255, 0.68); font-family: "IBM Plex Mono", monospace; font-size: 0.58rem; text-transform: uppercase; }
.jr-chat-status-dot { grid-row: 1 / 3; width: 9px; height: 9px; border-radius: 50%; background: #a8ffcf; box-shadow: 0 0 0 5px rgba(168, 255, 207, 0.16); }
.jr-chat-close { display: grid; width: 40px; height: 40px; margin-left: auto; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 50%; background: transparent; color: #fff; font-size: 1.5rem; cursor: pointer; }

.jr-chat-messages {
  display: flex;
  min-height: 0;
  padding: 20px;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: #f5f8fe;
}

.jr-chat-message {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 17px;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.jr-chat-message--assistant { align-self: flex-start; border: 1px solid #dbe4f1; border-bottom-left-radius: 5px; background: #fff; }
.jr-chat-message--user { align-self: flex-end; border-bottom-right-radius: 5px; background: #0157dd; color: #fff; }
.jr-chat-message.is-pending { color: #5f6980; }
.jr-chat-message.is-error { border-color: #ffd2d2; background: #fff3f3; color: #8b2020; }
.jr-chat-contact-action { align-self: flex-start; padding: 10px 13px; border: 1px solid #0157dd; border-radius: 999px; background: #fff; color: #0157dd; cursor: pointer; font: 600 0.64rem "IBM Plex Mono", monospace; text-transform: uppercase; }

.jr-chat-lead { display: grid; max-height: 290px; padding: 15px; gap: 9px; overflow-y: auto; border-top: 1px solid #dbe4f1; background: #fff; }
.jr-chat-lead[hidden] { display: none; }
.jr-chat-lead strong { font-family: "Archivo Black", sans-serif; font-size: 0.9rem; text-transform: uppercase; }
.jr-chat-lead p { color: #5f6980; font-size: 0.74rem; line-height: 1.35; }
.jr-chat-lead > input { min-height: 40px; padding: 9px 11px; border: 1px solid #dbe4f1; border-radius: 11px; color: #0b1630; font: 0.8rem "DM Sans", sans-serif; }
.jr-chat-lead label { display: flex; align-items: flex-start; gap: 8px; color: #5f6980; font-size: 0.68rem; line-height: 1.35; }
.jr-chat-lead label input { margin-top: 2px; accent-color: #0157dd; }
.jr-chat-lead > button { min-height: 40px; border: 0; border-radius: 999px; background: #0157dd; color: #fff; cursor: pointer; font: 600 0.64rem "IBM Plex Mono", monospace; text-transform: uppercase; }
.jr-chat-lead > button:disabled { opacity: 0.55; cursor: wait; }
.jr-chat-lead small { color: #8b2020; font-size: 0.68rem; }

.jr-chat-form { display: grid; padding: 14px; grid-template-columns: 1fr auto; align-items: end; gap: 10px; border-top: 1px solid #dbe4f1; background: #fff; }
.jr-chat-form textarea { width: 100%; min-height: 46px; max-height: 112px; padding: 12px 14px; resize: none; border: 1px solid #dbe4f1; border-radius: 16px; outline: 0; color: #0b1630; font: inherit; line-height: 1.35; }
.jr-chat-form textarea:focus { border-color: #0157dd; box-shadow: 0 0 0 3px rgba(1, 87, 221, 0.1); }
.jr-chat-form button { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; background: #0157dd; color: #fff; cursor: pointer; }
.jr-chat-form button:disabled { opacity: 0.45; cursor: wait; }
.jr-chat-note { padding: 0 16px 14px; background: #fff; color: #6b7488; font-size: 0.68rem; line-height: 1.35; }

@media (prefers-reduced-motion: no-preference) {
  .jr-chat-panel { transition: opacity 180ms ease-out, transform 260ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 260ms; }
  .jr-chat.is-open .jr-chat-panel { transition-delay: 0s; }
  .jr-chat-launcher { transition: opacity 120ms ease; }
  .jr-chat-launcher-mark img { animation: jr-bot-float 2.8s ease-in-out infinite; }
  .jr-chat-launcher:hover .jr-chat-launcher-mark img { animation-duration: 1.25s; }
}

@keyframes jr-bot-float {
  0%, 100% { transform: translateY(1px) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

@media (max-width: 560px) {
  .jr-chat { right: 12px; bottom: 12px; }
  .jr-chat-launcher { min-height: 54px; padding-right: 14px; }
  .jr-chat-launcher-mark { width: 38px; height: 38px; }
  .jr-chat-panel { position: fixed; right: 10px; bottom: 10px; left: 10px; width: auto; height: min(620px, calc(100svh - 20px)); border-radius: 22px; }
}
