:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #151b1f;
  --muted: #68747c;
  --line: #d8e0e4;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b42318;
  --active: #2563eb;
  --shadow: 0 1px 2px rgba(20, 35, 44, 0.07);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(980px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

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

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
}

.status-pill,
.mini {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--ok);
  border-color: rgba(21, 128, 61, 0.32);
}

.status-pill.bad {
  color: var(--bad);
  border-color: rgba(180, 35, 24, 0.32);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.worker-panel {
  border-color: rgba(180, 83, 9, 0.35);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.stack {
  display: grid;
  gap: 13px;
}

.two,
.players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input[type="file"] {
  min-height: 46px;
}

textarea {
  resize: vertical;
}

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

button {
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  padding: 9px 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

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

button.secondary {
  min-height: 36px;
  background: #fff;
  color: var(--accent-dark);
}

button.full {
  width: 100%;
  margin-top: 12px;
}

.primary-action {
  min-height: 54px;
  font-size: 18px;
}

.download-action {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.download-action:hover {
  background: var(--accent-dark);
}

.timeline {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  min-height: 48px;
}

.timeline span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
}

.timeline strong {
  overflow-wrap: anywhere;
}

.timeline small {
  color: var(--muted);
  font-weight: 750;
  text-align: right;
}

.timeline .active {
  border-color: rgba(37, 99, 235, 0.45);
}

.timeline .active span {
  background: var(--active);
}

.timeline .done span {
  background: var(--ok);
}

.timeline .fail span {
  background: var(--bad);
}

.timeline .fail small {
  color: var(--bad);
}

.player-panel {
  min-width: 0;
}

.player-panel.enhanced {
  border-color: rgba(15, 118, 110, 0.42);
}

audio {
  width: 100%;
  display: block;
}

.decision {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  padding: 14px;
  min-height: 54px;
  font-weight: 750;
}

.decision.ok {
  border-color: rgba(21, 128, 61, 0.35);
  color: var(--ok);
}

.decision.warn {
  border-color: rgba(180, 83, 9, 0.35);
  color: var(--warn);
}

.decision.bad {
  border-color: rgba(180, 35, 24, 0.35);
  color: var(--bad);
}

.output {
  width: 100%;
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f1720;
  color: #d9e4ec;
  padding: 12px;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 18px, 640px);
    padding-top: 12px;
  }

  .topbar,
  .two,
  .players {
    grid-template-columns: 1fr;
    display: grid;
  }

  h1 {
    font-size: 28px;
  }

  .timeline li {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .timeline small {
    grid-column: 2;
    text-align: left;
  }
}
