:root {
  color-scheme: light;
  --ink: #15171d;
  --muted: #636a78;
  --line: #d8dde7;
  --panel: #ffffff;
  --surface: #f3f6fb;
  --accent: #d92735;
  --accent-dark: #a91421;
  --focus: #1769e0;
  --good: #16784c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.9)),
    url("https://images.unsplash.com/photo-1611162616475-46b635cb6868?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
}

button,
input,
select {
  font: inherit;
}

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

.workspace {
  width: min(760px, 100%);
  background: var(--panel);
  border: 1px solid rgba(21, 23, 29, 0.12);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(26, 32, 44, 0.18);
  padding: clamp(20px, 4vw, 34px);
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.98;
  max-width: 10ch;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 0.9rem;
}

label {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.input-row,
.action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
select {
  min-width: 0;
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus,
button:focus-visible,
.save-link:focus-visible {
  outline: 3px solid rgba(23, 105, 224, 0.22);
  outline-offset: 2px;
  border-color: var(--focus);
}

button,
.save-link {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.save-link:hover {
  background: var(--accent-dark);
}

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

.button-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
}

.button-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.video-panel {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 26px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.video-panel img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #dfe5ee;
}

.video-meta h2 {
  margin: 0 0 8px;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.video-meta p {
  margin: 4px 0;
  color: var(--muted);
}

.controls,
.progress {
  margin-top: 24px;
}

.progress {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-weight: 800;
}

.bar {
  height: 12px;
  overflow: hidden;
  background: #e5eaf2;
  border-radius: 999px;
  margin: 10px 0;
}

#barFill {
  width: 0%;
  height: 100%;
  background: var(--good);
  border-radius: inherit;
  transition: width 180ms ease;
}

#jobMessage {
  min-height: 22px;
  margin: 0 0 16px;
  color: var(--muted);
}

.save-link {
  width: fit-content;
  background: var(--good);
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .header,
  .input-row,
  .action-row,
  .video-panel {
    grid-template-columns: 1fr;
  }

  .header {
    display: grid;
  }

  h1 {
    max-width: 11ch;
  }

  button,
  .save-link {
    width: 100%;
  }
}
