.iv-chat {
  --iv-chat-navy: #071b3d;
  --iv-chat-navy-2: #0b2e68;
  --iv-chat-blue: #0b4ca1;
  --iv-chat-green: #00784f;
  --iv-chat-green-dark: #006340;
  --iv-chat-cyan: #32d7ff;
  --iv-chat-ink: #10213d;
  --iv-chat-muted: #5b6880;
  --iv-chat-line: #dce4f0;
  --iv-chat-soft: #f2f6fb;
  position: relative;
  z-index: 1300;
  color: var(--iv-chat-ink);
  font-family: inherit;
  line-height: 1.45;
}

.iv-chat *,
.iv-chat *::before,
.iv-chat *::after {
  box-sizing: border-box;
}

.iv-chat button,
.iv-chat input {
  font: inherit;
}

.iv-chat button,
.iv-chat a {
  -webkit-tap-highlight-color: transparent;
}

.iv-chat :focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--iv-chat-blue);
}

.iv-chat__launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(86px, calc(68px + env(safe-area-inset-bottom)));
  z-index: 1302;
  display: inline-flex;
  min-width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 2px solid rgba(255, 255, 255, .94);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--iv-chat-blue), var(--iv-chat-navy-2));
  box-shadow: 0 14px 34px rgba(3, 22, 54, .32);
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease, visibility .2s ease, background-color .2s ease;
}

.iv-chat--solo .iv-chat__launcher {
  bottom: max(18px, env(safe-area-inset-bottom));
}

.iv-chat__launcher:hover {
  transform: translateY(-3px);
}

.iv-chat__launcher-icon {
  position: relative;
  display: grid;
  width: 25px;
  height: 22px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}

.iv-chat__launcher-icon::after {
  position: absolute;
  bottom: -5px;
  left: 4px;
  width: 7px;
  height: 7px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  background: var(--iv-chat-navy-2);
  content: "";
  transform: skewY(-35deg);
}

.iv-chat__launcher-text {
  font-size: .92rem;
  font-weight: 750;
  white-space: nowrap;
}

.iv-chat[data-open="true"] .iv-chat__launcher {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(.92);
}

.iv-chat__panel {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(86px, calc(68px + env(safe-area-inset-bottom)));
  z-index: 1301;
  display: grid;
  width: min(390px, calc(100vw - 24px));
  height: min(620px, calc(100dvh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  min-height: min(360px, calc(100dvh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid rgba(7, 27, 61, .18);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(3, 17, 38, .34);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(.97);
  transform-origin: right bottom;
  transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
}

.iv-chat--solo .iv-chat__panel {
  bottom: max(18px, env(safe-area-inset-bottom));
  height: min(620px, calc(100dvh - 102px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  min-height: min(360px, calc(100dvh - 102px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
}

.iv-chat[data-open="true"] .iv-chat__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.iv-chat__header {
  display: grid;
  min-height: 76px;
  padding: 12px 12px 12px 15px;
  align-items: center;
  gap: 10px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 10%, rgba(50, 215, 255, .22), transparent 34%),
    linear-gradient(135deg, var(--iv-chat-navy), var(--iv-chat-navy-2));
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.iv-chat__brand {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .23);
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
}

.iv-chat__brand img {
  display: block;
  width: 31px;
  height: 36px;
  object-fit: contain;
}

.iv-chat__heading {
  min-width: 0;
}

.iv-chat__heading h2 {
  margin: 0;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.25;
}

.iv-chat__status {
  display: flex;
  margin: 4px 0 0;
  align-items: center;
  gap: 6px;
  color: #c5d8ef;
  font-size: .7rem;
}

.iv-chat__status::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #65e5b5;
  box-shadow: 0 0 0 3px rgba(101, 229, 181, .14);
  content: "";
}

.iv-chat__header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.iv-chat__icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.iv-chat__icon-button:hover {
  background: rgba(255, 255, 255, .12);
}

.iv-chat__body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: var(--iv-chat-soft);
}

.iv-chat__messages {
  flex: 1 1 auto;
  min-height: 95px;
  margin: 0;
  padding: 17px 15px 13px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.iv-chat__message {
  display: flex;
  margin: 0 0 12px;
  align-items: flex-end;
  gap: 8px;
}

.iv-chat__message--user {
  justify-content: flex-end;
}

.iv-chat__avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--iv-chat-navy-2);
  font-size: .65rem;
  font-weight: 800;
}

.iv-chat__bubble-wrap {
  display: grid;
  max-width: 82%;
  gap: 7px;
}

.iv-chat__message--user .iv-chat__bubble-wrap {
  justify-items: end;
}

.iv-chat__bubble {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--iv-chat-line);
  border-radius: 16px 16px 16px 5px;
  color: var(--iv-chat-ink);
  background: #fff;
  box-shadow: 0 5px 14px rgba(7, 27, 61, .06);
  font-size: .86rem;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.iv-chat__message--user .iv-chat__bubble {
  color: #fff;
  border-color: var(--iv-chat-green);
  border-radius: 16px 16px 5px 16px;
  background: var(--iv-chat-green);
  box-shadow: 0 7px 16px rgba(0, 120, 79, .16);
}

.iv-chat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.iv-chat__action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid #9fb5cf;
  border-radius: 999px;
  color: var(--iv-chat-blue);
  background: #fff;
  font-size: .75rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.iv-chat__action:hover {
  color: #fff;
  border-color: var(--iv-chat-blue);
  background: var(--iv-chat-blue);
}

.iv-chat__quick {
  flex: 0 0 auto;
  max-height: 220px;
  padding: 10px 12px 12px;
  overflow-y: auto;
  border-top: 1px solid var(--iv-chat-line);
  background: #fff;
  overscroll-behavior: contain;
}

.iv-chat__quick-title {
  margin: 0 0 8px;
  color: var(--iv-chat-muted);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.iv-chat__quick-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
}

.iv-chat__quick-button {
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid #b9c9dc;
  border-radius: 999px;
  color: var(--iv-chat-navy-2);
  background: #f7faff;
  cursor: pointer;
  font-size: .73rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.iv-chat__quick-button:hover {
  color: #fff;
  border-color: var(--iv-chat-blue);
  background: var(--iv-chat-blue);
}

.iv-chat__footer {
  padding: 10px 11px 9px;
  border-top: 1px solid var(--iv-chat-line);
  background: #fff;
}

.iv-chat__form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 46px;
}

.iv-chat__input {
  width: 100%;
  height: 44px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #aabbd0;
  border-radius: 13px;
  color: var(--iv-chat-ink);
  background: #fff;
  font-size: .83rem;
}

.iv-chat__input::placeholder {
  color: #758299;
}

.iv-chat__input:focus {
  border-color: var(--iv-chat-blue);
  outline: 2px solid #fff;
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--iv-chat-blue);
}

.iv-chat__send {
  display: grid;
  width: 46px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--iv-chat-green);
  cursor: pointer;
  font-size: 1.08rem;
}

.iv-chat__send:hover {
  background: var(--iv-chat-green-dark);
}

.iv-chat__note {
  margin: 7px 2px 0;
  color: var(--iv-chat-muted);
  font-size: .64rem;
  text-align: center;
}

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

@media (max-width: 520px) {
  .iv-chat__launcher {
    width: 56px;
    padding: 0;
  }

  .iv-chat__launcher-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .iv-chat__panel {
    right: max(8px, env(safe-area-inset-right));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    height: min(680px, calc(100dvh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    min-height: min(340px, calc(100dvh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    border-radius: 20px;
  }

  .iv-chat--solo .iv-chat__panel {
    height: min(680px, calc(100dvh - 102px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    min-height: min(340px, calc(100dvh - 102px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  }

  .iv-chat__quick {
    max-height: 270px;
  }
}

@media (max-width: 520px) and (max-height: 650px) and (orientation: portrait) {
  .iv-chat__status {
    display: none;
  }

  .iv-chat__messages {
    min-height: 40px;
  }

  .iv-chat__quick {
    max-height: min(150px, 22dvh);
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .iv-chat__panel,
  .iv-chat--solo .iv-chat__panel {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: auto;
    width: min(390px, calc(100vw - 16px));
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .iv-chat__header {
    min-height: 62px;
    padding-block: 8px;
  }

  .iv-chat__brand {
    width: 40px;
    height: 40px;
  }

  .iv-chat__status,
  .iv-chat__note {
    display: none;
  }

  .iv-chat__quick {
    max-height: 100px;
  }

  .iv-chat__messages {
    min-height: 64px;
    padding-block: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iv-chat *,
  .iv-chat *::before,
  .iv-chat *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .iv-chat {
    display: none !important;
  }
}
