:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #5d6872;
  --line: #dce2e8;
  --accent: #1f6feb;
  --accent-strong: #174ea6;
  --mint: #147d64;
  --warning: #ad5b00;
  --shadow: 0 18px 45px rgba(23, 32, 38, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(31, 111, 235, 0.08), transparent 320px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
textarea,
select,
input {
  font: inherit;
}

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

.workspace {
  width: min(100%, 980px);
  background: var(--panel);
  border: 1px solid rgba(220, 226, 232, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.status {
  min-width: 84px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
}

.status.busy {
  border-color: rgba(173, 91, 0, 0.35);
  color: var(--warning);
}

.status.done {
  border-color: rgba(20, 125, 100, 0.35);
  color: var(--mint);
}

.editor-panel {
  display: grid;
  gap: 10px;
}

.field-label,
.control span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 330px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background: #fbfcfd;
  line-height: 1.7;
  outline: none;
}

textarea:focus,
select:focus,
input:focus-visible,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.16);
  outline: none;
}

.text-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.text-button {
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}

.controls-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(150px, 0.8fr) repeat(2, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.control {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.control span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

input[type="range"] {
  accent-color: var(--accent);
  min-height: 44px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 760;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.primary {
  background: var(--accent);
  color: #fff;
}

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

.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.download {
  background: #147d64;
  color: #fff;
}

audio {
  width: 100%;
  margin-top: 22px;
}

@media (max-width: 760px) {
  .workspace {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .status {
    justify-self: start;
  }

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

  .actions button {
    flex: 1 1 150px;
  }
}
