* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px 16px;
  background: #f3f5f9;
  color: #182230;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 28px;
  background: #fff;
  border: 1px solid #e2e7ef;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgb(24 34 48 / 8%);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
}

.intro {
  margin: 0 0 22px;
  color: #596579;
}

.preview-area {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 220px;
  place-items: center;
  background: #101722;
  border-radius: 12px;
}

video {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: contain;
}

.preview-message {
  position: absolute;
  margin: 0;
  padding: 10px 14px;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.controls {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.controls > label:not(.checkbox-row) {
  margin-top: 8px;
  font-weight: 650;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #c9d2df;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: #255ed6;
}

button,
.download-link {
  display: inline-block;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: #255ed6;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.download-link:hover {
  background: #194bb5;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status {
  min-height: 1.5em;
  margin: 4px 0 0;
  color: #465369;
}

progress {
  width: 100%;
  height: 12px;
  accent-color: #255ed6;
}

.download-link {
  margin-top: 6px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  body {
    padding: 16px 10px;
  }

  .app {
    padding: 20px 16px;
  }

  .preview-area {
    min-height: 180px;
  }
}
