/* Beast chat — responsive sizing for phone, tablet and desktop. */

#beastChat,
.beast-page,
.beast-form,
.beast-log {
  min-width: 0;
}

.beast-page {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.beast-log {
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  overscroll-behavior: contain;
}

.beast-bubble {
  max-width: min(82%, 760px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.beast-form {
  min-width: 0;
}

.beast-form input {
  min-width: 0;
  width: 100%;
  font-size: 16px;
}

.beast-send {
  min-height: 44px;
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  #beastChat {
    width: 100%;
  }

  .beast-page {
    height: min(70dvh, 620px);
    min-height: 320px;
    max-height: 70dvh;
    border-radius: 16px;
  }

  .beast-log {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    padding: .8rem;
  }

  .beast-bubble {
    max-width: 92%;
    font-size: .95rem;
  }

  .beast-form {
    display: flex;
    gap: .55rem;
    padding: .7rem;
    align-items: stretch;
  }

  .beast-form input {
    min-height: 46px;
  }

  .beast-send {
    min-width: 72px;
    padding-inline: 1rem;
  }
}

@media (max-width: 430px) {
  .beast-page {
    min-height: 300px;
    height: min(66dvh, 560px);
  }

  .beast-log {
    padding: .65rem;
  }

  .beast-form {
    gap: .45rem;
    padding: .6rem;
  }

  .beast-form input {
    min-width: 0;
    padding-inline: .8rem;
  }

  .beast-send {
    min-width: 64px;
    padding-inline: .8rem;
  }
}

@media (max-width: 340px) {
  .beast-form {
    flex-wrap: wrap;
  }

  .beast-send {
    width: 100%;
  }
}

@media (min-width: 721px) {
  .beast-log {
    scrollbar-gutter: stable;
  }
}

@media (prefers-reduced-motion: reduce) {
  .beast-log { scroll-behavior: auto; }
}
