.brilla-chat-root {
  --brilla-navy: #061528;
  --brilla-blue: #0a4dff;
  --brilla-cyan: #2fd8f2;
  --brilla-gold: #ffb629;
  --brilla-pink: #f555ad;
  --brilla-green: #42d66f;
  --brilla-line: rgba(148, 204, 255, 0.35);
  --brilla-text: #f7fbff;
  position: fixed;
  z-index: 2147483000;
  right: 22px;
  bottom: 22px;
  font-family: inherit;
}

.brilla-chat-root * {
  box-sizing: border-box;
}

.brilla-chat-bubble {
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 24px;
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, .55), transparent 20%),
    linear-gradient(135deg, #0055ff 0%, #1636ba 42%, #29d7ef 100%);
  box-shadow: 0 18px 44px rgba(0, 66, 255, .34), 0 0 0 1px rgba(255, 255, 255, .24) inset;
}

.brilla-chat-bubble__mark {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 900;
  font-size: 34px;
  letter-spacing: -1px;
}

.brilla-chat-bubble__shine {
  position: absolute;
  inset: -45%;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.55) 42%, transparent 58%);
  transform: translateX(-45%) rotate(10deg);
  animation: brilla-chat-shine 4.8s ease-in-out infinite;
}

.brilla-chat-bubble__pulse {
  position: absolute;
  inset: -8px;
  border-radius: 30px;
  border: 1px solid rgba(47, 216, 242, .55);
  animation: brilla-chat-pulse 2.2s ease-in-out infinite;
}

.brilla-chat-panel {
  width: min(430px, calc(100vw - 24px));
  height: min(690px, calc(100vh - 34px));
  border-radius: 26px;
  overflow: hidden;
  color: var(--brilla-text);
  background:
    radial-gradient(circle at 15% 5%, rgba(47, 216, 242, .24), transparent 30%),
    radial-gradient(circle at 85% 22%, rgba(245, 85, 173, .20), transparent 32%),
    linear-gradient(145deg, #071626 0%, #08274c 55%, #061528 100%);
  border: 1px solid rgba(148, 204, 255, .35);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

.brilla-chat-panel::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  top: 80px;
  border-radius: 45%;
  background: linear-gradient(135deg, rgba(47,216,242,.12), rgba(255,182,41,.08));
  filter: blur(1px);
  transform: rotate(-18deg);
  pointer-events: none;
}

.brilla-chat-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  background: rgba(6, 21, 40, .72);
  border-bottom: 1px solid rgba(148, 204, 255, .22);
  backdrop-filter: blur(16px);
}

.brilla-chat-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brilla-chat-logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, #0055ff, #2fd8f2);
  box-shadow: 0 0 22px rgba(47, 216, 242, .25);
}

.brilla-chat-brand strong,
.brilla-chat-brand small {
  display: block;
}

.brilla-chat-brand strong {
  font-size: 17px;
}

.brilla-chat-brand small {
  max-width: 245px;
  color: #a7c7e8;
  font-size: 12px;
  line-height: 1.35;
}

.brilla-chat-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.brilla-chat-progress {
  height: 4px;
  background: rgba(255,255,255,.10);
}

.brilla-chat-progress span {
  display: block;
  height: 100%;
  width: 38%;
  background: linear-gradient(90deg, var(--brilla-gold), var(--brilla-cyan), var(--brilla-pink), var(--brilla-green));
  border-radius: 999px;
}

.brilla-chat-body {
  position: relative;
  z-index: 1;
  height: calc(100% - 86px);
  padding: 18px;
}

.brilla-chat-prechat,
.brilla-chat-thread {
  height: 100%;
}

.brilla-chat-prechat {
  display: grid;
  align-content: start;
  gap: 13px;
}

.brilla-chat-prechat h3 {
  color: #fff;
  font-size: 30px;
  line-height: 1.05;
  margin: 6px 0 0;
}

.brilla-chat-prechat p {
  margin: 0 0 4px;
  color: #bed1e7;
  line-height: 1.45;
}

.brilla-chat-prechat label {
  display: grid;
  gap: 7px;
  color: #cfe4ff;
  font-weight: 800;
  font-size: 13px;
}

.brilla-chat-prechat input,
.brilla-chat-prechat select,
.brilla-chat-composer textarea {
  width: 100%;
  border: 1px solid rgba(148, 204, 255, .35);
  border-radius: 16px;
  background: rgba(2, 13, 28, .68);
  color: #fff;
  padding: 14px 15px;
  outline: none;
  box-shadow: 0 0 0 0 rgba(47, 216, 242, 0);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.brilla-chat-prechat input:focus,
.brilla-chat-prechat select:focus,
.brilla-chat-composer textarea:focus {
  border-color: var(--brilla-cyan);
  box-shadow: 0 0 0 4px rgba(47, 216, 242, .12);
}

.brilla-chat-prechat button,
.brilla-chat-composer button {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffb629, #ff8f2e);
  color: #071626;
  font-weight: 900;
  padding: 15px 18px;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(255, 182, 41, .22);
}

.brilla-chat-thread {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
}

.brilla-chat-messages {
  overflow: auto;
  padding: 4px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brilla-chat-message {
  max-width: 84%;
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 204, 255, .25);
  background: rgba(255,255,255,.09);
  color: #f7fbff;
  line-height: 1.45;
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
}

.brilla-chat-message.is-visitor {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(47,216,242,.26), rgba(0,85,255,.22));
}

.brilla-chat-message.is-admin {
  align-self: flex-start;
  background: rgba(255,182,41,.16);
  border-color: rgba(255,182,41,.34);
}

.brilla-chat-message.is-bot {
  align-self: flex-start;
  background: rgba(255,255,255,.10);
}

.brilla-chat-message small {
  display: block;
  margin-top: 5px;
  color: rgba(223, 238, 255, .62);
  font-size: 11px;
}

.brilla-chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.brilla-chat-composer textarea {
  min-height: 56px;
  resize: none;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  caret-color: #2fd8f2;
}

.brilla-chat-composer textarea::placeholder {
  color: rgba(223, 238, 255, .68) !important;
  -webkit-text-fill-color: rgba(223, 238, 255, .68);
}

.brilla-chat-composer textarea:focus {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

.brilla-chat-composer button {
  min-height: 56px;
  padding-inline: 18px;
}

.brilla-chat-toast {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 92px;
  border-radius: 14px;
  padding: 10px 12px;
  color: #071626;
  background: #ffcf68;
  font-weight: 800;
  box-shadow: 0 14px 32px rgba(0,0,0,.22);
}

@keyframes brilla-chat-shine {
  0%, 45% { transform: translateX(-60%) rotate(10deg); opacity: 0; }
  55% { opacity: 1; }
  72%, 100% { transform: translateX(62%) rotate(10deg); opacity: 0; }
}

@keyframes brilla-chat-pulse {
  0% { transform: scale(.88); opacity: .8; }
  100% { transform: scale(1.35); opacity: 0; }
}

@media (max-width: 520px) {
  .brilla-chat-root {
    right: 12px;
    bottom: 12px;
  }

  .brilla-chat-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    border-radius: 22px;
  }

  .brilla-chat-prechat h3 {
    font-size: 25px;
  }
}
