body {
  margin: 0;
  background: #111;
  color: #ddd;
  font: 14px sans-serif;

  display: flex;
  flex-direction: column;
  align-items: center;

  min-height: 100vh;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;

  width: 100%;
  max-width: 900px;
  padding: 24px;
  margin: 0;
  box-sizing: border-box;
  
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

#chat::-webkit-scrollbar {
  width: 6px;
}

#chat::-webkit-scrollbar-track {
  background: transparent;
}

#chat::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 999px;
}

#chat li {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 68ch;

  line-height: 1.5;

  margin: 10px 0;
  box-sizing: border-box;
}

.user {
  margin-left: auto;

  width: fit-content;
  max-width: 72%;
  transform: translateX(-8px);

  background: #234;
  border-bottom-right-radius: 4px;
}

.assistant {
  margin-right: auto;

  width: fit-content;
  max-width: 82%;
  transform: translateX(8px);

  background: #222;
  border-left: 4px solid #456;

  padding-left: 22px;
  border-bottom-left-radius: 4px;
}

.assistant p {
  margin: 0.25em 0;
}

.assistant ul,
.assistant ol {
  margin: 0.25em 0;
  padding-left: 1.2em;
}

.assistant li {
  margin: 0.1em 0;
}

.assistant .greynote {
    display: inline;
    margin-left: 6px;
    margin-top: 0.15rem;
    text-align: right;
    font-size: 0.68em;
    color: #777;
    opacity: 0.6;
    letter-spacing: 0.02em;
    user-select: none;
}

#disclaimer {
    color: silver;
    padding: 0.5em;
    font-style: italic;
    font-size: .9em;
    text-align: center;
}

#bar {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;

  width: 100%;
  max-width: 900px;

  display: flex;
  align-items: flex-end;
  gap: 10px;

  padding: 12px;

  background: #1a1a1a;

  border: 1px solid #2a2a2a;
  border-radius: 14px;

  box-sizing: border-box;
}

#msg {
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;

  background: transparent;
  color: #ddd;
  font: 15px sans-serif;

  min-height: 24px;
  max-height: 200px;
  overflow-y: auto;
}

button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #345;
  color: white;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
}

.speakBtn {
    margin-left: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    font-size: 14px;
    vertical-align: middle;
    transition: opacity 0.15s ease;
}

.speakBtn:hover {
    opacity: 1;
}

#recBtn.recording {
    box-shadow: 0 0 8px red;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    50% {
        opacity: 0.5;
    }
}