:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --ink: #1e2420;
  --muted: #5c665f;
  --line: #d8d0c4;
  --panel: #fffdf8;
  --accent: #1f6f61;
  --accent-dark: #15564b;
  --danger: #9f2f2f;
  --shadow: 0 20px 55px rgba(43, 36, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.app {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  min-height: 220px;
  display: flex;
  align-items: end;
  padding: 36px;
  color: white;
  background:
    linear-gradient(rgba(17, 38, 34, 0.48), rgba(17, 38, 34, 0.74)),
    url("https://images.unsplash.com/photo-1518495973542-4542c06a5843?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  max-width: 560px;
  margin: 16px 0 0;
  font-size: 1.08rem;
}

.panel {
  margin-top: 24px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.controls {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 8px;
  min-width: min(280px, 100%);
  color: var(--muted);
  font-weight: 700;
}

select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  min-width: 112px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

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

#stopBtn {
  background: var(--danger);
}

.status {
  min-height: 28px;
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.diagnostics {
  min-height: 22px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.conversation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.box,
.audio-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
}

h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.box p {
  min-height: 100px;
  margin: 0;
  color: var(--muted);
}

.audio-box {
  margin-top: 16px;
}

audio {
  width: 100%;
}

@media (max-width: 720px) {
  .app {
    width: min(100% - 20px, 1040px);
    padding: 10px 0 24px;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .conversation {
    grid-template-columns: 1fr;
  }

  .buttons,
  button {
    width: 100%;
  }
}
