/* Chat splash for phones and tablets. Desktop keeps the full site. */

:root {
  --wl-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --wl-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

.wl-chat {
  display: none;
  flex-direction: column;
  align-items: center;
  background: #0e0e0e;
  color: #f3f3f3;
  color-scheme: dark;
  text-align: left;
}

@media screen and (max-width: 1100px) {
  html.wl-chat-on,
  html.wl-chat-on body {
    overflow: hidden;
    height: 100%;
  }

  .wl-chat {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 10000;
  }
}

.wl-chat,
.wl-chat * {
  font-family: "Gill Sans", Arial, sans-serif;
  font-weight: lighter;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-font-smoothing: antialiased;
}

.wl-chat * {
  color: inherit;
}

.wl-chat p,
.wl-chat h1,
.wl-chat h2,
.wl-chat h3,
.wl-chat a,
.wl-chat button,
.wl-chat input,
.wl-chat textarea,
.wl-chat strong,
.wl-chat span {
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
  letter-spacing: inherit;
}

.wl-chat-dock {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: transparent;
  pointer-events: none;
}

.wl-chat-dock > .wl-chat-frost {
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  top: -40px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 12%,
    rgba(0, 0, 0, 0.75) 24%,
    #000 36%,
    #000 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 12%,
    rgba(0, 0, 0, 0.75) 24%,
    #000 36%,
    #000 100%
  );
}

.wl-chat-dock > .wl-chat-frost > span {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(
    to bottom,
    rgba(14, 14, 14, 0) 0%,
    rgba(14, 14, 14, 0.08) 10%,
    rgba(14, 14, 14, 0.22) 18%,
    rgba(14, 14, 14, 0.46) 26%,
    rgba(14, 14, 14, 0.68) 32%,
    rgba(14, 14, 14, 0.78) 38%,
    rgba(14, 14, 14, 0.78) 100%
  );
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}

.wl-chat-dock > * {
  pointer-events: auto;
}

.wl-chat > header.wl-chat-bar {
  --wl-avatar-open: 1;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  overflow: visible;
}

.wl-chat-id {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  gap: calc(8px + 4px * var(--wl-avatar-open));
  padding: calc(8px + 4px * var(--wl-avatar-open)) 16px calc(8px + 4px * var(--wl-avatar-open));
  padding-top: calc(8px + 8px * var(--wl-avatar-open) + env(safe-area-inset-top));
}

.wl-chat > header.wl-chat-bar > .wl-chat-frost {
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: 0;
  bottom: -40px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0px,
    rgba(0, 0, 0, 0.35) 13px,
    rgba(0, 0, 0, 0.75) 26px,
    #000 40px,
    #000 100%
  );
  mask-image: linear-gradient(
    to top,
    transparent 0px,
    rgba(0, 0, 0, 0.35) 13px,
    rgba(0, 0, 0, 0.75) 26px,
    #000 40px,
    #000 100%
  );
}

.wl-chat > header.wl-chat-bar > .wl-chat-frost > span {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(
    to top,
    rgba(14, 14, 14, 0) 0px,
    rgba(14, 14, 14, 0.08) 11px,
    rgba(14, 14, 14, 0.22) 19px,
    rgba(14, 14, 14, 0.46) 28px,
    rgba(14, 14, 14, 0.68) 35px,
    rgba(14, 14, 14, 0.78) 41px,
    rgba(14, 14, 14, 0.78) 100%
  );
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}

.wl-chat-avatar {
  position: relative;
  flex: none;
  width: calc(64px + 56px * var(--wl-avatar-open, 1));
  height: calc(64px + 56px * var(--wl-avatar-open, 1));
  border-radius: 50%;
  overflow: hidden;
  background: #f3f3f3;
}

.wl-chat-avatar img,
.wl-chat-avatar video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s var(--wl-ease-out);
  pointer-events: none;
}

.wl-chat-avatar video {
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  left: 0;
  top: -5px;
  right: auto;
  bottom: auto;
}

.wl-chat-avatar video.is-idle,
.wl-chat-avatar video.is-thinking,
.wl-chat-avatar video.is-working,
.wl-chat-avatar video.is-speaking {
  width: calc(128.83% + 23.19px);
  height: calc(128.83% + 23.19px);
  top: calc(-14.42% + 8.4px);
  right: auto;
  bottom: auto;
  left: calc(-14.42% - 11.6px);
}

.wl-chat-avatar video.is-working {
  top: calc(-16.75% + 8.4px);
}

.wl-chat-avatar[data-state="idle"] .is-idle,
.wl-chat-avatar[data-state="thinking"] .is-thinking,
.wl-chat-avatar[data-state="working"] .is-working,
.wl-chat-avatar[data-state="speaking"] .is-speaking {
  opacity: 1;
}

.wl-chat-who {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.wl-chat-who > strong,
.wl-chat-who > .wl-chat-role {
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

.wl-chat-who strong {
  color: #f5f5f5;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
}

.wl-chat-role {
  margin-top: 4px;
  color: #8d8d8d;
  font-size: 14px;
  line-height: 20px;
}

.wl-chat-role-text {
  display: inline;
}

.wl-chat-ell {
  display: inline-block;
  font-style: normal;
  font-variant-ligatures: none;
}

.wl-chat-ell i {
  font-style: normal;
  opacity: 1;
}

.wl-chat-role[data-live="1"] .wl-chat-ell i {
  opacity: 0;
  animation: wl-chat-type-1 1.2s steps(1, end) infinite;
}

.wl-chat-role[data-live="1"] .wl-chat-ell i:nth-child(2) {
  animation-name: wl-chat-type-2;
}

.wl-chat-role[data-live="1"] .wl-chat-ell i:nth-child(3) {
  animation-name: wl-chat-type-3;
}

@keyframes wl-chat-type-1 {
  0% { opacity: 0; }
  25%, 100% { opacity: 1; }
}

@keyframes wl-chat-type-2 {
  0%, 25% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

@keyframes wl-chat-type-3 {
  0%, 50% { opacity: 0; }
  75%, 100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wl-chat-role[data-live="1"] .wl-chat-ell i {
    animation: none;
    opacity: 1;
  }
}

.wl-chat-log {
  --wl-chat-gutter: max(16px, calc((100vw - 688px) / 2));
  flex: 1;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 220px var(--wl-chat-gutter) calc(88px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wl-chat-log::-webkit-scrollbar {
  display: none;
}

.wl-chat-row {
  display: flex;
  max-width: min(86%, 520px);
  animation: wl-chat-in 0.2s var(--wl-ease-out);
}

.wl-chat-log > .wl-chat-row:first-of-type {
  margin-top: 16px;
  animation: none;
}

.wl-chat-row.theirs {
  align-self: flex-start;
}

.wl-chat-row.wl-chat-say {
  align-self: stretch;
  display: block;
  width: auto;
  max-width: none;
  animation: none;
}

.wl-chat .wl-chat-line {
  margin: 0;
  color: #f3f3f3;
  font-size: 18px;
  line-height: 28px;
  overflow-wrap: anywhere;
}

.wl-chat-say .wl-chat-line + .wl-chat-line {
  margin-top: 12px;
}

.wl-chat-row.mine {
  align-self: flex-end;
}

.wl-chat-bubble {
  margin: 0;
  padding: 12px 16px;
  border-radius: 20px 20px 20px 6px;
  background: #242424;
  color: #f3f3f3;
  font-size: 18px;
  line-height: 28px;
  overflow-wrap: anywhere;
}

.wl-chat-bubble p {
  margin: 0 0 12px;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 28px;
}

.wl-chat-bubble p:last-child {
  margin-bottom: 0;
}

.wl-chat-suggest {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  align-self: flex-start;
  width: min(100%, 520px);
  margin: 0;
}

.wl-chat-suggest[hidden] {
  display: none;
}

.wl-chat-suggest button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #ececec;
  font-size: 16px;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  will-change: opacity, transform;
  transition: opacity 200ms var(--wl-ease-out), transform 200ms var(--wl-ease-out), background-color 150ms ease;
}

.wl-chat-suggest button:nth-child(2) {
  transition-delay: 40ms, 40ms, 0ms;
}

.wl-chat-suggest button:nth-child(3) {
  transition-delay: 80ms, 80ms, 0ms;
}

.wl-chat-suggest.is-in button {
  opacity: 1;
  transform: translateY(0);
}

.wl-chat-suggest button svg {
  flex: none;
  opacity: 0.7;
}

@media (hover: hover) and (pointer: fine) {
  .wl-chat-suggest button:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .wl-chat-suggest button:active {
    transform: scale(0.97);
    transition-duration: 100ms, 200ms, 150ms;
    transition-delay: 0ms;
  }
}

.wl-chat-suggest button:focus-visible {
  outline: 2px solid #0072c1;
  outline-offset: 3px;
}

.wl-chat .wl-chat-line a {
  color: #29a6ff;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}

.wl-chat .wl-chat-line a[target="_blank"] {
  padding-right: 0;
}

.wl-chat .wl-chat-line a[target="_blank"]::after {
  content: none;
}

.wl-chat .wl-chat-line a[target="_blank"]:hover {
  text-decoration: none;
}

.wl-chat .wl-chat-line a svg {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.22em;
  vertical-align: -0.08em;
}

.wl-chat .wl-chat-line a:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wl-chat-row.mine .wl-chat-bubble {
  border-radius: 20px 20px 6px 20px;
  background: linear-gradient(160deg, #0076d2 0%, #007e9e 52%, #944ed6 100%);
  color: #ffffff;
}

.wl-chat-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  height: auto;
  padding: 16px;
  border-radius: 20px 20px 20px 6px;
  background: #242424;
}

.wl-chat-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9a9a9a;
  animation: wl-chat-dot 1.05s infinite ease-in-out;
}

.wl-chat-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.wl-chat-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.wl-chat-dock {
  padding: 0 0 calc(20px + env(safe-area-inset-bottom));
}

.wl-chat-close:active {
  transform: scale(0.97);
}

.wl-chat-form {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  background: transparent;
}

.wl-voice-track {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 240px;
  height: 48px;
}

.wl-chat-form button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 8px;
  width: 240px;
  height: 48px;
  margin: 0;
  padding: 0 18px 0 16px;
  border: 0;
  border-radius: 24px;
  background: #1b7f3b;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  overflow: hidden;
  cursor: pointer;
  transition: width 0.28s var(--wl-ease-in-out), padding 0.28s var(--wl-ease-in-out), background 0.15s ease;
}

.wl-chat-form .wl-voice-label {
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.wl-chat-form button[type="submit"]:hover:not(:disabled) {
  background: #166e34;
}

@media (prefers-reduced-motion: no-preference) {
  .wl-chat-form button[type="submit"]:active:not(:disabled) {
    transform: scale(0.97);
  }
}

.wl-chat-form button[type="submit"]:disabled {
  background: #2e2e2e;
  color: #6e6e6e;
  cursor: default;
}

.wl-chat-stream {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex: none;
  width: 176px;
  min-width: 0;
  max-width: 0;
  height: 40px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-width 0.28s var(--wl-ease-in-out), opacity 0.28s var(--wl-ease-in-out), margin-right 0.28s var(--wl-ease-in-out);
}

.wl-chat-form[data-voice="streaming"] .wl-chat-stream {
  max-width: 176px;
  margin-right: 16px;
  opacity: 1;
}

.wl-chat-form[data-voice="streaming"] button[type="submit"] {
  width: 48px;
  padding: 0;
  background: #e5484d;
}

.wl-chat-form[data-voice="streaming"] button[type="submit"]:hover:not(:disabled) {
  background: #d03c41;
}

.wl-chat-form[data-voice="streaming"] .wl-voice-label {
  display: none;
}

.wl-chat-stream span {
  width: 2px;
  height: 18px;
  border-radius: 1px;
  background: #f2f2f2;
  transform-origin: center;
  transform: scaleY(0.22);
}

.wl-chat-form button[type="submit"] svg {
  display: none;
  flex: none;
}

.wl-chat-form button[data-mode="voice"] .is-voice,
.wl-chat-form button[data-mode="streaming"] .is-stop {
  display: block;
}

@keyframes wl-chat-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes wl-chat-dot {
  0%,
  70%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.wl-ask {
  display: none;
  position: fixed;
  z-index: 70;
  right: 24px;
  bottom: 24px;
  width: 88px;
  height: 88px;
  margin: 0;
  padding: 0;
  border: 2px solid #f5f5f5;
  border-radius: 50%;
  background: #f5f5f5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  cursor: pointer;
}

.wl-ask-face {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}

.wl-ask-face video {
  position: absolute;
  width: 175%;
  height: 175%;
  object-fit: cover;
  top: 50%;
  left: 50%;
  transform: translate(calc(-54% + 5px), calc(-42% + 12px));
  max-width: none;
  pointer-events: none;
}

.wl-ask-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 8px;
  background: #141414;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  font-family: "Gill Sans", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.wl-ask:hover .wl-ask-tip,
.wl-ask:focus-visible .wl-ask-tip {
  opacity: 1;
}

.wl-ask:focus-visible,
.wl-chat-close:focus-visible {
  outline: 2px solid #0072c1;
  outline-offset: 3px;
}

.wl-chat-close {
  display: none;
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
  cursor: pointer;
}

.wl-chat-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.wl-chat-scrim {
  display: none;
}

@media screen and (min-width: 1101px) {
  html.wl-desk-open,
  html.wl-desk-open body {
    overflow: hidden;
  }

  .wl-chat-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s var(--wl-ease-out), visibility 0.28s var(--wl-ease-out);
  }

  html.wl-desk-open .wl-chat-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .wl-ask {
    display: block;
  }

  html.wl-desk-open .wl-ask {
    display: none;
  }

  .wl-chat {
    display: flex;
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(420px, calc(100vw - 32px));
    height: auto;
    z-index: 1001;
    border: 1px solid #333333;
    border-radius: 28px;
    corner-shape: squircle;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    overscroll-behavior: contain;
    transform: translateX(calc(100% + 16px));
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s var(--wl-ease-out), visibility 0.28s var(--wl-ease-out);
  }

  html.wl-desk-open .wl-chat {
    transform: none;
    visibility: visible;
    pointer-events: auto;
  }

  .wl-chat-log {
    --wl-chat-gutter: 16px;
  }

  .wl-chat-close {
    display: grid;
  }
}

html.wl-desk-instant .wl-chat,
html.wl-desk-instant .wl-chat-scrim {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  body,
  .wl-chat,
  .page-nav,
  body.about-globe-page header {
    transition: none;
  }

  .wl-chat-row {
    animation: none;
  }

  .wl-chat-dots span {
    animation: none;
    opacity: 0.7;
  }

  .wl-chat-stream span,
  .wl-chat-form button[type="submit"],
  .wl-chat-stream {
    animation: none;
    transition: none;
  }

  .wl-chat-suggest button,
  .wl-chat-suggest.is-in button,
  .wl-chat-avatar img,
  .wl-chat-avatar video,
  .wl-chat-scrim {
    transition: none;
  }

  .wl-chat-suggest button,
  .wl-chat-suggest.is-in button {
    opacity: 1;
    transform: none;
  }
}
