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

* {
  box-sizing: border-box;
}

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

button,
select,
textarea {
  font: inherit;
}

button,
select {
  min-height: 42px;
  border: 1px solid #c8c9c4;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2428;
}

button {
  padding: 0 16px;
  cursor: pointer;
}

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

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  display: grid;
  gap: 22px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d8d9d2;
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #687073;
  font-size: 0.88rem;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1rem;
}

.health,
.meta {
  color: #5d6669;
  font-size: 0.92rem;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.field span,
.toggle {
  color: #4f585b;
  font-size: 0.9rem;
}

.field select {
  width: 100%;
  padding: 0 12px;
}

.toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

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

.panel,
.result-panel {
  border: 1px solid #d8d9d2;
  border-radius: 8px;
  background: #ffffff;
}

.panel {
  min-height: 184px;
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
}

.dropzone {
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px dashed #9ca4a7;
  border-radius: 8px;
  color: #4f585b;
  text-align: center;
  padding: 12px;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.primary {
  background: #1f2428;
  color: #ffffff;
  border-color: #1f2428;
}

.recorder {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4f585b;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #9ca4a7;
}

.dot.active {
  background: #c7332c;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

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

textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid #d8d9d2;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.5;
  color: #1f2428;
  background: #fbfbf8;
}

.transcript-box {
  position: relative;
}

.status-animation {
  position: absolute;
  inset: 1px;
  min-height: 318px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(251, 251, 248, 0.94), rgba(246, 246, 241, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(31, 36, 40, 0.035) 18px 19px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.status-animation.active {
  opacity: 1;
}

.status-animation p {
  margin: 0;
  color: #4f585b;
  font-size: 0.94rem;
}

.wave-bars {
  height: 82px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wave-bars span {
  width: 9px;
  height: 26px;
  border-radius: 999px;
  background: #2f6f73;
  animation: wave 900ms ease-in-out infinite;
}

.wave-bars span:nth-child(2) {
  animation-delay: 90ms;
}

.wave-bars span:nth-child(3) {
  animation-delay: 180ms;
}

.wave-bars span:nth-child(4) {
  animation-delay: 270ms;
}

.wave-bars span:nth-child(5) {
  animation-delay: 360ms;
}

.orbit {
  width: 84px;
  height: 84px;
  position: relative;
  display: none;
  border: 1px solid rgba(47, 111, 115, 0.28);
  border-radius: 50%;
  animation: spin 1700ms linear infinite;
}

.orbit i {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2f6f73;
}

.orbit i:nth-child(1) {
  left: 50%;
  top: -6px;
}

.orbit i:nth-child(2) {
  right: 4px;
  bottom: 12px;
}

.orbit i:nth-child(3) {
  left: 4px;
  bottom: 12px;
}

.scan-line {
  width: min(420px, 72%);
  height: 92px;
  display: none;
  border: 1px solid rgba(47, 111, 115, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent, rgba(47, 111, 115, 0.22), transparent),
    linear-gradient(180deg, rgba(47, 111, 115, 0.08), transparent 45%, rgba(31, 36, 40, 0.06));
  background-size: 38% 100%, 100% 100%;
  background-repeat: no-repeat;
  animation: scan 1500ms ease-in-out infinite;
}

.status-animation.preparing .scan-line,
.status-animation.loading .orbit {
  display: block;
}

.status-animation.preparing .wave-bars,
.status-animation.loading .wave-bars,
.status-animation.postprocess .wave-bars {
  display: none;
}

.status-animation.transcribing .wave-bars,
.status-animation.postprocess .orbit {
  display: flex;
}

.status-animation.postprocess .orbit {
  display: block;
  border-radius: 8px;
  transform: rotate(45deg);
}

.status-animation.done,
.status-animation.error {
  opacity: 0;
}

@keyframes wave {
  0%,
  100% {
    height: 22px;
  }
  50% {
    height: 78px;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan {
  0% {
    background-position: -45% 0, 0 0;
  }
  100% {
    background-position: 145% 0, 0 0;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1120px);
    padding: 18px 0;
  }

  .topbar,
  .result-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .field {
    min-width: min(100%, 220px);
    flex: 1;
  }
}
