:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #16201c;
  --muted: #69736f;
  --line: #dfe5df;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 20px 60px rgba(22, 32, 28, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(180, 83, 9, 0.06)),
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
}

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

.topbar,
.details-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2.8rem, 3rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #eef2ef;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
}

.status-pill.online {
  background: #d9f5ef;
  color: var(--accent-strong);
}

.status-pill.live {
  background: #fff4d6;
  color: var(--warn);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.primary-action {
  width: 100%;
  height: 58px;
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 850;
  cursor: pointer;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.primary-action.stop {
  background: var(--danger);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.68;
}

.meter-wrap {
  height: 14px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2ef;
}

.meter {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f59e0b);
  transition: width 80ms linear;
}

.details-row {
  min-height: 24px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-error {
  color: var(--danger);
  font-weight: 800;
}

.playback-visual {
  height: 150px;
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.playback-visual span {
  width: 12px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: center;
  animation: pulse 1.1s ease-in-out infinite;
  opacity: 0.35;
}

.playback-visual span:nth-child(2) {
  animation-delay: 0.1s;
}

.playback-visual span:nth-child(3) {
  animation-delay: 0.2s;
}

.playback-visual span:nth-child(4) {
  animation-delay: 0.3s;
}

.playback-visual span:nth-child(5) {
  animation-delay: 0.4s;
}

.playback-visual.active span {
  opacity: 0.85;
}

.transcript {
  min-height: 64px;
  margin-top: 18px;
  color: var(--ink);
  line-height: 1.55;
}

@keyframes pulse {
  0%,
  100% {
    transform: scaleY(0.55);
  }
  50% {
    transform: scaleY(1.75);
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
    align-items: stretch;
  }

  .panel {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

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

  h1 {
    font-size: 2rem;
  }
}
