:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #14202b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.app {
  max-width: 720px;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.status {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #4b6578;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
}

.badge {
  flex: 0 0 auto;
  min-width: 82px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  background: #d8dde3;
  color: #25313b;
}

.badge.connecting,
.badge.translating {
  background: #ffe2a8;
}

.badge.listening,
.badge.speaking {
  background: #b9eed7;
}

.badge.error {
  background: #ffd0d0;
  color: #8a1f1f;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 10px;
  margin-bottom: 14px;
}

button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
}

button:disabled {
  opacity: 0.45;
}

.primary {
  background: #087f8c;
  color: white;
}

.secondary {
  background: #d9e1e7;
  color: #14202b;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #d8dde3;
}

#meterFill {
  width: 0%;
  height: 100%;
  background: #d1495b;
  transition: width 90ms linear;
}

.text-practice {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #ffffff;
}

.text-practice label {
  color: #4b6578;
  font-size: 13px;
  font-weight: 800;
}

.text-practice textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid #cbd5dd;
  border-radius: 8px;
  padding: 12px;
  color: #14202b;
  font: inherit;
  font-size: 18px;
  line-height: 1.35;
}

.captions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

article,
.log {
  padding: 16px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #ffffff;
}

article span {
  display: block;
  margin-bottom: 8px;
  color: #5c7080;
  font-size: 13px;
  font-weight: 800;
}

article p {
  min-height: 54px;
  margin: 0;
  font-size: 21px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.log {
  margin-top: 12px;
}

.log h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.entry {
  padding: 10px 0;
  border-top: 1px solid #e8edf1;
}

.entry:first-child {
  border-top: 0;
}

.entry strong {
  display: block;
  margin-bottom: 4px;
  color: #4b6578;
  font-size: 13px;
}

.entry p {
  margin: 3px 0;
  line-height: 1.35;
}
