:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #0071e3;
  --accent-pressed: #005cbf;
  --success: #1d7a46;
  --warn: #9a6700;
  --danger: #c41e3a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.workspace,
.panel,
.dropzone,
.player-card,
.progress-panel {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--surface);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.brand p,
.muted {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: #fff;
}

.logo-wrap img {
  width: 22px;
  height: 22px;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef7ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.stage {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 180px;
  padding: 28px;
  border-radius: 16px;
  border-style: dashed;
  text-align: center;
  cursor: pointer;
}

.dropzone strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.dropzone span {
  color: var(--muted);
  font-size: 13px;
}

.dropzone.dragover {
  border-color: rgba(0, 113, 227, 0.4);
  background: #f3f9ff;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compare[hidden],
.progress-panel[hidden] {
  display: none !important;
}

.player-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
}

.player-label {
  padding: 10px 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

video {
  display: block;
  width: 100%;
  max-height: 360px;
  background: #111;
}

.progress-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ececf0;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0071e3, #32ade6);
  transition: width 160ms ease;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
}

.panel {
  padding: 16px;
  border-radius: 16px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 14px;
}

.facts {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  text-align: right;
  word-break: break-word;
}

.actions {
  display: grid;
  gap: 8px;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button:disabled,
.button-link[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.primary {
  border: 0;
  background: var(--accent);
  color: #fff;
}

.primary:hover:not(:disabled) {
  background: var(--accent-pressed);
}

.status {
  min-height: 36px;
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
}

.status[data-tone="success"] { color: var(--success); }
.status[data-tone="warn"] { color: var(--warn); }
.status[data-tone="error"] { color: var(--danger); }

.queue {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.queue li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f7f7f8;
  font-size: 12px;
}

.queue .state {
  color: var(--muted);
  white-space: nowrap;
}

.bullets {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.bullets li + li {
  margin-top: 6px;
}

@media (max-width: 900px) {
  .workspace,
  .compare {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
