:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f7f7f4;
  color: #1d2521;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

main {
  width: min(720px, 100%);
  min-height: 100vh;
  padding: 40px 20px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 20px;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d8ddd4;
  padding-bottom: 16px;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  font-weight: 650;
}

p,
.status-bar {
  color: #5a665e;
}

.controls,
.status-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

button {
  min-height: 44px;
  border: 1px solid #1d2521;
  border-radius: 6px;
  padding: 0 16px;
  background: #1d2521;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

button:nth-child(2) {
  background: transparent;
  color: #1d2521;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status-bar {
  justify-content: space-between;
  min-height: 28px;
  font-size: 14px;
}

.transcript {
  min-height: 340px;
  border: 1px solid #d8ddd4;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

#messages {
  height: 100%;
  max-height: calc(100vh - 250px);
  min-height: 340px;
  overflow-y: auto;
  padding: 16px;
}

.message {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid #eef0ec;
}

.message:last-child {
  border-bottom: 0;
}

.role {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #637066;
}

.text {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.partial .text {
  color: #5a665e;
}

@media (max-width: 560px) {
  main {
    padding: 24px 14px;
  }

  header,
  .controls,
  .status-bar {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
