:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #252d29;
  background: #f5f3ee;
  line-height: 1.5;
}

body {
  max-width: 76rem;
  margin: auto;
  padding: 1.5rem;
}

header,
.heading,
.actions,
.tabs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

header,
.heading {
  justify-content: space-between;
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: #365e52;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1rem;
  margin-block: 1rem;
}

.panel {
  min-width: 0;
  padding: 1rem;
  background: #fffefa;
  border: 1px solid #d9ded7;
  border-radius: 0.75rem;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

button {
  padding: 0.5rem 0.8rem;
  font: inherit;
  color: inherit;
  background: #eef1eb;
  border: 1px solid #aebdb3;
  border-radius: 0.4rem;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

#start,
#microphone[aria-pressed='true'],
[role='tab'][aria-selected='true'] {
  color: white;
  background: #365e52;
  border-color: #365e52;
}

#microphone {
  align-self: center;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 50%;
}

#session-status,
#voice-status,
footer {
  font-size: 0.9rem;
}

#voice-status[data-problem='true'] {
  padding: 0.6rem;
  color: #742a22;
  background: #fff1ed;
  border-left: 3px solid #a24337;
}

#conversation {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 21rem;
  overflow: auto;
  border-block: 1px solid #d9ded7;
  padding-block: 0.75rem;
}

.message {
  align-self: flex-start;
  max-width: 85%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #edf0e9;
  overflow-wrap: anywhere;
}

.message.user {
  align-self: flex-end;
  background: #e2edea;
}

[role='tabpanel'] {
  margin-top: 0.75rem;
}

pre,
#trace {
  box-sizing: border-box;
  max-height: 26rem;
  overflow: auto;
  padding: 0.8rem;
  background: #f2f3ef;
  border-radius: 0.4rem;
  font:
    0.85rem/1.55 ui-monospace,
    monospace;
}

#trace {
  padding-inline-start: 2.4rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  main {
    grid-template-columns: minmax(0, 1fr);
  }

  body {
    padding: 1rem;
  }
}
