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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.panel {
  width: min(980px, 100%);
  background: #ffffff;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 32, 42, 0.08);
  padding: 28px;
}

.heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #46627f;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  max-width: 620px;
  font-size: 2.25rem;
}

h2 {
  font-size: 1rem;
  color: #2f4054;
}

.status-pill {
  min-width: 96px;
  border: 1px solid #c8d5e3;
  border-radius: 999px;
  padding: 8px 12px;
  color: #24425f;
  background: #eef5fb;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 18px;
  margin-top: 34px;
}

label {
  display: grid;
  gap: 8px;
  color: #34495e;
  font-weight: 700;
}

select {
  min-width: 220px;
  height: 44px;
  border: 1px solid #b9c8d8;
  border-radius: 6px;
  background: #ffffff;
  color: #17202a;
  padding: 0 12px;
}

.turn-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

button {
  min-width: 150px;
  height: 44px;
  border: 1px solid #1b6ac9;
  border-radius: 6px;
  color: #ffffff;
  background: #1b6ac9;
  font-weight: 800;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #1559ad;
}

button:disabled {
  border-color: #c7d0da;
  background: #d7dee7;
  color: #7a8794;
  cursor: not-allowed;
}

#stopButton:not(:disabled) {
  border-color: #b33535;
  background: #c94141;
}

#stopButton:hover:not(:disabled) {
  background: #a93131;
}

.secondary-button {
  min-width: 90px;
  height: 36px;
  border-color: #b9c8d8;
  background: #ffffff;
  color: #2f4054;
}

.secondary-button:hover:not(:disabled) {
  background: #eef5fb;
}

.translation-box {
  margin-top: 26px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 18px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: min(560px, 58vh);
  margin-top: 14px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #ffffff;
}

.empty-state {
  margin: 0;
  color: #6b7b8d;
}

.chat-message {
  display: flex;
  width: 100%;
}

.chat-message.speaker-one {
  justify-content: flex-start;
}

.chat-message.speaker-two {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(620px, 78%);
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #f7fafc;
  padding: 12px 14px;
}

.chat-message.speaker-two .chat-bubble {
  background: #eef5fb;
  border-color: #c8d5e3;
}

.chat-bubble.translation {
  border-style: dashed;
}

.chat-meta {
  margin: 0 0 6px;
  color: #46627f;
  font-size: 0.8rem;
  font-weight: 800;
}

.message-text {
  margin: 0;
  white-space: pre-wrap;
  color: #17202a;
  font-size: 1rem;
  line-height: 1.42;
}

.chat-bubble.translation .message-text {
  font-weight: 800;
}

@media (max-width: 640px) {
  .panel {
    padding: 20px;
  }

  .heading-row,
  .controls,
  .turn-controls {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 1.55rem;
  }

  select,
  button {
    width: 100%;
  }

  .chat-thread {
    height: min(520px, 62vh);
  }

  .chat-bubble {
    max-width: 92%;
  }
}
