body { font-family: system-ui; margin: 2rem; max-width: 1100px; }
video { width: 100%; max-width: 900px; background: #000; display: block; }

/* timeline */
#timeline {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 50px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  margin: 0.75rem 0 1.5rem;
  user-select: none;
}
#timeline .tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 8px;
  background: #999;
}
#timeline .tick-label {
  position: absolute;
  top: 10px;
  font-size: 0.7rem;
  color: #666;
  transform: translateX(-50%);
}
#timeline .playhead {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #d33;
  pointer-events: none;
  z-index: 3;
}
#timeline .pending-marker {
  position: absolute;
  top: 0;
  width: 0;
  height: 100%;
  border-left: 2px dashed #2a7;
  pointer-events: none;
  z-index: 3;
}
#timeline .bar {
  position: absolute;
  top: 22px;
  height: 22px;
  border-radius: 2px;
  cursor: pointer;
  z-index: 1;
}
#timeline .bar.draft     { background: #4a90e2; }
#timeline .bar.queued,
#timeline .bar.cutting,
#timeline .bar.uploading { background: #e2944a; }
#timeline .bar.uploaded  { background: #4ae27a; }
#timeline .bar.download_ready { background: #4ac6e2; }
#timeline .bar.downloaded     { background: #7a8fa6; }
#timeline .bar.failed    { background: #e24a4a; }
#timeline .bar .handle {
  position: absolute;
  top: 0;
  width: 8px;
  height: 100%;
  background: rgba(0,0,0,0.25);
  cursor: ew-resize;
  z-index: 2;
}
#timeline .bar .handle.left  { left: 0; }
#timeline .bar .handle.right { right: 0; }

/* segments list */
#segments { list-style: none; padding: 0; }
#segments li {
  padding: .5rem;
  border: 1px solid #ddd;
  margin: .35rem 0;
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
#segments li.draft input[type=text] { padding: .2rem .35rem; }
#segments li input.time { width: 6.5rem; font-family: monospace; }
#segments li input.title { flex: 1; min-width: 12rem; }
#segments li input.title.auto { font-style: italic; color: #888; }
#segments li input.invalid { border-color: #d33; background: #fdd; }
#segments li .duration { color: #666; font-size: .85rem; min-width: 4rem; }
#segments li .status {
  font-size: .85rem;
  padding: .1rem .4rem;
  border-radius: 4px;
  background: #eee;
}
#segments li button { padding: .25rem .55rem; }
#segments li a.download-file,
#segments li button.redownload {
  font-size: .85rem;
  padding: .1rem .4rem;
  border-radius: 4px;
  background: #4ac6e2;
  color: #04323d;
  text-decoration: none;
}
#segments li .upload-progress {
  position: relative;
  display: inline-block;
  width: 120px;
  height: 10px;
  background: #eee;
  border-radius: 5px;
  overflow: hidden;
  vertical-align: middle;
}
#segments li .upload-progress .bar {
  display: block;
  height: 100%;
  background: #e2944a;
  transition: width .4s ease;
}
#segments li .upload-progress.indeterminate .bar {
  width: 35%;
  animation: upload-slide 1.2s linear infinite;
}
#segments li .upload-progress .pct {
  position: absolute;
  inset: 0;
  font-size: .7rem;
  text-align: center;
  line-height: 10px;
  color: #333;
}
@keyframes upload-slide {
  0%   { margin-left: -35%; }
  100% { margin-left: 100%; }
}

.publish {
  margin-top: 1rem;
  padding: .7rem 1.5rem;
  background: #2a7;
  color: #fff;
  border: 0;
  font-size: 1rem;
  cursor: pointer;
}

li.failed .status { color: #a33; }
.seg-error {
  color: #a33;
  font-size: .8rem;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
button.retry {
  font-size: .8rem;
  padding: .15rem .5rem;
  cursor: pointer;
}
