.mori-chat-widget,
.mori-chat-widget * {
  box-sizing: border-box;
}

.mori-chat-widget {
  --mori-chat-ink: #211f1c;
  --mori-chat-paper: #fbf9f5;
  --mori-chat-stone: #f1ede7;
  --mori-chat-line: #d9d2c9;
  --mori-chat-muted: #756f68;
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--mori-chat-ink);
  font-family: inherit;
  isolation: isolate;
  transition: bottom .24s ease;
}

.mori-chat-widget.is-footer-visible {
  bottom: max(88px, calc(72px + env(safe-area-inset-bottom)));
}

.mori-chat-widget.is-footer-language-open {
  bottom: max(172px, calc(156px + env(safe-area-inset-bottom)));
}

.mori-chat-widget [hidden] {
  display: none !important;
}

.mori-chat-widget__launcher {
  position: relative;
  display: grid;
  width: 56px;
  height: 56px;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 50%;
  background: var(--mori-chat-ink);
  color: #fff;
  box-shadow: 0 14px 34px rgb(31 27 23 / .22);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.mori-chat-widget .mori-chat-widget__launcher {
  color: #fff;
}

.mori-chat-widget__launcher:hover {
  transform: translateY(-2px);
  background: #302c27;
  box-shadow: 0 18px 38px rgb(31 27 23 / .26);
}

.mori-chat-widget__close:focus-visible,
.mori-chat-widget__channel:focus-visible {
  outline: 2px solid var(--mori-chat-ink);
  outline-offset: 3px;
}

.mori-chat-widget .mori-chat-widget__launcher:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--mori-chat-ink), 0 14px 34px rgb(31 27 23 / .22);
}

.mori-chat-widget__launcher svg {
  grid-area: 1 / 1;
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity .18s ease, transform .22s ease;
}

.mori-chat-widget__launcher-close {
  opacity: 0;
  transform: rotate(-36deg) scale(.78);
}

.mori-chat-widget.is-open .mori-chat-widget__launcher-open {
  opacity: 0;
  transform: rotate(36deg) scale(.78);
}

.mori-chat-widget.is-open .mori-chat-widget__launcher-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.mori-chat-widget__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(380px, calc(100vw - 48px));
  max-height: min(560px, calc(100dvh - 116px));
  overflow: auto;
  border: 1px solid var(--mori-chat-line);
  border-radius: 18px;
  background: var(--mori-chat-paper);
  box-shadow: 0 22px 62px rgb(39 33 28 / .18);
  overscroll-behavior: contain;
  transform-origin: right bottom;
  animation: mori-chat-panel-in .22s cubic-bezier(.22, .8, .3, 1) both;
}

.mori-chat-widget__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 22px 19px;
  border-bottom: 1px solid var(--mori-chat-line);
}

.mori-chat-widget__eyebrow {
  margin: 0 0 10px;
  color: #8a7161;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .18em;
  line-height: 1.2;
}

.mori-chat-widget__header h2 {
  margin: 0;
  color: var(--mori-chat-ink);
  font: inherit;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.35;
}

.mori-chat-widget__header p:last-child {
  margin: 7px 0 0;
  color: var(--mori-chat-muted);
  font-size: 12px;
  line-height: 1.65;
}

.mori-chat-widget__close {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--mori-chat-stone);
  color: var(--mori-chat-ink);
  cursor: pointer;
}

.mori-chat-widget__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.35;
}

.mori-chat-widget__channels {
  padding: 10px;
}

.mori-chat-widget__channel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  color: var(--mori-chat-ink);
  text-decoration: none;
  transition: background-color .18s ease;
}

a.mori-chat-widget__channel:hover {
  background: var(--mori-chat-stone);
}

.mori-chat-widget__channel--primary {
  min-height: 70px;
  padding: 11px 12px;
}

.mori-chat-widget__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 5px 10px;
  color: var(--mori-chat-muted);
  font-size: 9px;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.mori-chat-widget__divider::before,
.mori-chat-widget__divider::after {
  height: 1px;
  flex: 1 1 auto;
  background: var(--mori-chat-line);
  content: '';
}

.mori-chat-widget__divider span {
  flex: 0 0 auto;
}

.mori-chat-widget__alternatives {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.mori-chat-widget__channel--social {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(31px, auto);
  justify-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 103px;
  padding: 12px 7px 10px;
  border: 1px solid var(--mori-chat-line);
  border-radius: 12px;
  background: rgb(255 255 255 / .48);
  text-align: center;
}

a.mori-chat-widget__channel--social:hover {
  border-color: #beb5aa;
  background: #fff;
}

.mori-chat-widget__channel-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgb(33 31 28 / .09);
}

.mori-chat-widget__channel-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.mori-chat-widget__channel-icon--live {
  background: var(--mori-chat-ink);
  color: #fff;
}

.mori-chat-widget__channel-icon--line {
  color: #06a946;
}

.mori-chat-widget__channel-icon--line svg > path:first-child,
.mori-chat-widget__channel-icon--whatsapp svg > path:first-child,
.mori-chat-widget__channel-icon--messenger svg > path:first-child {
  fill: currentColor;
  stroke: none;
}

.mori-chat-widget__channel-icon--line svg > path:last-child,
.mori-chat-widget__channel-icon--whatsapp svg > path:last-child,
.mori-chat-widget__channel-icon--messenger svg > path:last-child {
  color: #fff;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
}

.mori-chat-widget__channel-icon--whatsapp {
  color: #20ad5a;
}

.mori-chat-widget__channel-icon--messenger {
  color: #1685ee;
}

.mori-chat-widget__channel--social .mori-chat-widget__channel-icon {
  width: 38px;
  height: 38px;
}

.mori-chat-widget__channel--social .mori-chat-widget__channel-icon svg {
  width: 21px;
  height: 21px;
}

.mori-chat-widget__channel-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mori-chat-widget__channel-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mori-chat-widget__channel--social .mori-chat-widget__channel-copy {
  justify-items: center;
  gap: 2px;
}

.mori-chat-widget__channel--social .mori-chat-widget__channel-copy strong {
  overflow: visible;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

.mori-chat-widget__channel-copy small {
  color: var(--mori-chat-muted);
  font-size: 10px;
  line-height: 1.35;
}

.mori-chat-widget__channel--social .mori-chat-widget__channel-copy small {
  font-size: 9px;
  line-height: 1.25;
}

.mori-chat-widget__arrow {
  padding-right: 2px;
  color: #817a72;
  font-size: 14px;
}

.mori-chat-widget__channel--social .mori-chat-widget__arrow {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 0;
  font-size: 11px;
}

.mori-chat-widget__channel.is-disabled {
  color: #8b857e;
  cursor: not-allowed;
  opacity: .64;
}

.mori-chat-widget__channel.is-disabled .mori-chat-widget__channel-icon {
  filter: grayscale(1);
}

@keyframes mori-chat-panel-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 767px) {
  .mori-chat-widget {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .mori-chat-widget.is-footer-visible {
    bottom: max(76px, calc(64px + env(safe-area-inset-bottom)));
  }

  .mori-chat-widget.is-footer-language-open {
    bottom: max(150px, calc(134px + env(safe-area-inset-bottom)));
  }

  .mori-chat-widget__launcher {
    width: 52px;
    height: 52px;
  }

  .mori-chat-widget__panel {
    width: min(360px, calc(100vw - 32px));
    bottom: calc(100% + 12px);
    max-height: calc(100dvh - 96px - env(safe-area-inset-bottom));
  }

  .mori-chat-widget__header {
    padding: 21px 18px 17px;
  }

  .mori-chat-widget__channels {
    padding: 8px;
  }

  .mori-chat-widget__alternatives {
    gap: 6px;
  }

  .mori-chat-widget__channel--social {
    min-height: 99px;
    padding-inline: 5px;
  }
}

@media (max-width: 359px) {
  .mori-chat-widget {
    right: max(12px, env(safe-area-inset-right));
  }

  .mori-chat-widget__panel {
    width: calc(100vw - 24px);
  }

  .mori-chat-widget__channel--social .mori-chat-widget__channel-copy strong {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mori-chat-widget__panel {
    animation: none;
  }

  .mori-chat-widget,
  .mori-chat-widget__launcher,
  .mori-chat-widget__launcher svg,
  .mori-chat-widget__channel {
    transition: none;
  }
}
