.oa-chat {
  --chat-border: #e6ddcc;
  --chat-gold-light: #f0d69f;
  position: fixed;
  z-index: 910;
  inset-inline-end: max(1.5rem, env(safe-area-inset-right));
  inset-block-end: calc(max(1.5rem, env(safe-area-inset-bottom)) + var(--chat-viewport-offset, 0px));
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
}

.oa-chat [hidden],
.oa-chat__launcher[aria-expanded="true"] {
  display: none !important;
}

.oa-chat button {
  cursor: pointer;
}

.oa-chat button:disabled {
  cursor: default;
  opacity: .52;
}

.oa-chat button:focus-visible,
.oa-chat a:focus-visible,
.oa-chat__input:focus-visible {
  outline: 2px solid #95702e;
  outline-offset: 2px;
}

.oa-chat__icon {
  display: block;
  width: 1.24rem;
  height: 1.24rem;
  flex: none;
}

.oa-chat__launcher {
  display: inline-flex;
  min-height: 3.3rem;
  align-items: center;
  gap: .48rem;
  padding: .36rem 1.1rem .36rem .43rem;
  border: 1px solid #a48852;
  border-radius: 2rem;
  background: var(--navy);
  box-shadow: 0 .35rem 1.2rem #0b1c3330;
  color: #fff;
  font: 680 .96rem/1.2 var(--sans);
  transition: background-color .16s ease;
}

.oa-chat__launcher:hover {
  background: #233e5c;
}

.oa-chat__launch-icon {
  display: grid;
  width: 2.26rem;
  height: 2.26rem;
  place-items: center;
  border-radius: 50%;
  background: var(--chat-gold-light);
  color: var(--navy);
}

.oa-chat__launch-icon .icon {
  width: 1.32rem;
  height: 1.32rem;
}

.oa-chat__panel {
  display: flex;
  width: min(27rem, calc(100vw - 2rem));
  height: min(41rem, calc(100vh - 3rem));
  height: min(41rem, calc(100dvh - 3rem));
  height: min(41rem, calc(var(--chat-viewport-height, 100dvh) - 3rem));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ac925e;
  border-radius: .85rem;
  background: #fffdf9;
  box-shadow: 0 1.15rem 3rem #0b1c3342;
  text-align: start;
}

.oa-chat__panel:focus {
  outline: 0;
}

.oa-chat__header {
  display: flex;
  min-height: 4.7rem;
  flex: 0 0 auto;
  align-items: center;
  gap: .55rem;
  padding: .65rem .65rem .65rem .9rem;
  border-bottom: 2px solid #ad8b4a;
  background: var(--navy);
  color: #fff;
}

.oa-chat__brand {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  flex: none;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d9b675;
  border-radius: .43rem;
  background: #faf7ee;
}

.oa-chat__brand img {
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
}

.oa-chat__heading {
  min-width: 0;
  flex: 1 1 auto;
}

.oa-chat__heading h2 {
  margin: 0;
  color: #fff;
  font: 500 1.1rem/1.18 var(--serif);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.oa-chat__heading p {
  margin: .2rem 0 0;
  color: #ead9b9;
  font: 500 .7rem/1.2 var(--sans);
}

.oa-chat__header-button {
  display: grid;
  width: 2.62rem;
  height: 2.62rem;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: .42rem;
  background: transparent;
  color: #f9e7c2;
}

.oa-chat__header-button:hover {
  background: #243953;
  color: #fff;
}

.oa-chat__header-button:focus-visible {
  outline-color: #f0d69f;
}

.oa-chat__sound[aria-pressed="true"] {
  border-color: #d9b675;
  background: #f0d69f;
  color: var(--navy);
}

.oa-chat__log {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1rem .95rem;
  scrollbar-color: #bca780 #fffdf9;
}

.oa-chat__log:focus-visible {
  outline: 2px solid #95702e;
  outline-offset: -3px;
}

.oa-chat__messages {
  display: grid;
  gap: .8rem;
}

.oa-chat__turn {
  display: grid;
  min-width: 0;
  max-width: 94%;
  gap: .35rem;
  justify-self: start;
}

.oa-chat__turn.is-visitor {
  justify-self: end;
}

.oa-chat__bubble {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: .64rem .8rem;
  border: 1px solid #ece4d5;
  border-radius: .18rem .76rem .76rem .76rem;
  background: #f6f1e7;
  color: #1c2c41;
  font-size: .9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.is-visitor .oa-chat__bubble {
  justify-self: end;
  border-color: var(--navy);
  border-radius: .76rem .18rem .76rem .76rem;
  background: var(--navy);
  color: #fff;
}

.oa-chat__links {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .65rem;
  margin: 0;
  padding: 0 .14rem;
  color: #694a17;
  font-size: .81rem;
  font-weight: 650;
  list-style: none;
}

.oa-chat__links a:hover,
.oa-chat__privacy a:hover {
  color: var(--navy);
}

.oa-chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .4rem;
  margin-top: .7rem;
}

.oa-chat__suggestions:empty {
  display: none;
}

.oa-chat__prompt {
  min-height: 2.28rem;
  padding: .38rem .62rem;
  border: 1px solid #d4c098;
  border-radius: 1rem;
  background: #fffdf9;
  color: #614615;
  font: 670 .78rem/1.25 var(--sans);
  text-align: start;
}

.oa-chat__prompt:hover {
  border-color: #a18043;
  background: #fbf0dc;
}

.oa-chat__controls {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  gap: .49rem;
  padding: .58rem .85rem .75rem;
  border-top: 1px solid var(--chat-border);
  background: #fff;
}

.oa-chat__voice-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .34rem;
}

.oa-chat__voice-tools:not(:has(button:not([hidden]))) {
  display: none;
}

.oa-chat__voice-button {
  display: inline-flex;
  min-height: 2.31rem;
  align-items: center;
  gap: .33rem;
  padding: .35rem .48rem;
  border: 1px solid #ded3bd;
  border-radius: .35rem;
  background: #fffdf8;
  color: #24334a;
  font: 650 .78rem/1.2 var(--sans);
  text-align: start;
}

.oa-chat__voice-button :is(.icon, .oa-chat__icon) {
  width: 1rem;
  height: 1rem;
}

.oa-chat__voice-button:hover {
  border-color: #b1945f;
  background: #f6efdf;
}

.oa-chat__voice-button[aria-pressed="true"] {
  border-color: #b38e4e;
  background: #f2dda9;
  color: #24334a;
}

.oa-chat__status {
  margin: 0;
  color: #644818;
  font-size: .76rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.oa-chat__status:empty {
  position: absolute;
  margin: -1px;
  clip-path: inset(50%);
}

.oa-chat__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.75rem;
  gap: .38rem;
  margin: 0;
}

.oa-chat__input {
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem .62rem;
  border: 1px solid #b9b0a0;
  border-radius: .38rem;
  background: #fff;
  color: var(--navy);
  font: 400 1rem/1.25 var(--sans);
}

.oa-chat__input::placeholder {
  color: #58616c;
  opacity: 1;
}

.oa-chat__send {
  display: grid;
  width: 2.75rem;
  min-height: 2.75rem;
  place-items: center;
  padding: 0;
  border: 1px solid var(--navy);
  border-radius: .38rem;
  background: var(--navy);
  color: #fff;
}

.oa-chat__send:hover {
  background: #284562;
}

.oa-chat__privacy {
  margin: .12rem 0 0;
  color: #52606d;
  font-size: .71rem;
  line-height: 1.35;
}

.oa-chat__privacy a {
  font-weight: 670;
}

.oa-chat__screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 540px) {
  .oa-chat {
    inset-inline-end: max(.75rem, env(safe-area-inset-right));
    inset-block-end: calc(max(.75rem, env(safe-area-inset-bottom)) + var(--chat-viewport-offset, 0px));
  }

  .oa-chat__panel {
    width: calc(100vw - 1.5rem);
    height: min(42rem, calc(100vh - 1.5rem));
    height: min(42rem, calc(100dvh - 1.5rem));
    height: min(42rem, calc(var(--chat-viewport-height, 100dvh) - 1.5rem));
    max-height: calc(100dvh - max(1.5rem, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    border-radius: .68rem;
  }

  .oa-chat__voice-button,
  .oa-chat__prompt {
    min-height: 2.5rem;
  }
}

@media (max-width: 360px) {
  .oa-chat__header {
    gap: .35rem;
    padding-inline: .5rem;
  }

  .oa-chat__heading h2 {
    font-size: 1rem;
  }

  .oa-chat__header-button {
    width: 2.42rem;
  }

  .oa-chat__controls,
  .oa-chat__log {
    padding-inline: .64rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oa-chat__launcher {
    transition: none;
  }
}
