body {
  margin: 0;
  font-family: system-ui, sans-serif;
  min-height: 100vh;
}

#chatbot-container {
  --chb-accent-color: #f2c94c;
  --chb-border-radius: 100vw;

  position: fixed;
  inset: 0;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.7);
  overflow-y: auto;
  padding-block: 2rem;
}

#chatbot-container[aria-hidden="false"] {
    display: none;
}

#chatbot-container[aria-hidden="true"] {
    display: block;
}

#chatbot-container * {
  box-sizing: border-box;
}

.chb-wrapper {
  display: grid;
  gap: 1rem;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  width: min(100% - 2rem, 60rem);
  margin-inline: auto;
  position: relative;
}

.chb__messages {
  display: grid;
  gap: 1rem;
  align-content: start;
  height: 100%;
  overflow-y: auto;
}

.chb__message {
  width: 80%;
  padding: 0.5em 1.5em;
  background-color: #f2f2f2;
  border-radius: 0.25em;
}

@media (width < 40em) {
  .chb__message {
    width: 100%;
  }
}

.chb__message[data-chb-message="server"] {
  justify-self: start;
  background-color: #fff;
}

.chb__message[data-chb-message="client"] {
  justify-self: end;
  background-color: #ddd;
}

.chb__header {
  display: grid;
  gap: 0.5rem;
  text-align: center;
  color: #fff;
  background-color: #333;
  padding: 1rem;
}

.chb__header * {
  margin: 0;
}

.chb__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chb__input-wrapper {
  display: flex;
  gap: 0.5rem;
  flex-grow: 1;
  border-radius: var(--chb-border-radius);
  border: 1px solid #999;
  background-color: #f2f2f2;
  align-items: center;
  padding-inline: 0.5em;
  overflow: hidden;
}

.chb__input {
  gap: 0.25rem;
  flex-grow: 1;
  padding: 1em;
  border: 0;
  background-color: #f2f2f2;
  outline: none;
}

.chb__voice {
  background-color: var(--chb-accent-color);
  padding: 0.5em 1em;
  border-radius: var(--chb-border-radius);
  cursor: pointer;
  border: 0;
}

.chb__voice > [data-chb-voice-icon] {
    height: 2.5ex;
    width: auto;
    flex: none;
    fill: currentColor;
    display: none;
}

.chb__voice[data-chb-voice="off"] {
  background-color: transparent;
}

.chb__voice[data-chb-voice="speaking"]::before {
    content: "Speak now...";
}

.chb__voice[data-chb-voice="finished"]::before {
    content: "Try again?";
}

.chb__voice[data-chb-voice="off"] > [data-chb-voice-icon] {
    display: inline-block;
}

.chb__button {
  background-color: var(--chb-accent-color);
  padding: 1em 2em;
  border: 0;
  border-radius: 0.5em;
  cursor: pointer;
}
