.video-upscale-page [hidden] { display: none !important; }
.video-upscale-page .voice-work {
  height: 100dvh;
  min-height: 0;
}
.video-upscale-page .voice-header h1 {
  margin: 0 auto 0 0;
  min-width: 0;
  overflow: hidden;
  font: inherit;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-upscale-page .voice-footer {
  flex: none;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding: 8px 12px;
  min-height: 42px;
}
.video-upscale-page .voice-history-row {
  flex: none;
  height: 56px;
  min-height: 56px;
}
.video-upscale-page .voice-history-row .voice-history-item {
  height: 100%;
  padding: 0 9px;
}
.video-upscale-page .voice-history-item img { flex: none; }
.video-upscale-page .video-history-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1;
  min-width: 0;
  gap: 3px;
  overflow: hidden;
  line-height: 19px;
}
.video-upscale-page .video-history-copy .voice-history-title { width: 100%; }
.video-upscale-page .video-history-copy small,
.video-upscale-page #source-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-upscale-page #video-workspace {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: clamp(10px, 2vw, 22px);
  overflow: auto;
  gap: 10px;
}
.video-upscale-page #request-form {
  display: grid;
  gap: 12px;
  width: min(100%, 440px);
  margin: auto;
}
.video-upscale-page .video-upscale-input { display: grid; gap: 6px; min-width: 0; }
.video-upscale-page .muted { color: var(--un-muted); font-size: 12px; line-height: 1.45; }
.video-upscale-page :is(#video-limits, #guest-note, #model-note, #status, #error) { margin: 0; }
.video-upscale-page :is(#source-note, #model-note, #status):empty { display: none; }
.video-upscale-page #pick-video {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-height: 112px;
  width: 100%;
  border: 1px dashed var(--un-muted);
  border-radius: 14px;
  background: var(--un-card);
  color: var(--un-ink);
  white-space: normal;
}
.video-upscale-page #pick-video small { color: var(--un-muted); font-size: 12px; }
.video-upscale-page #pick-video:not(:disabled):is(:hover, .is-file-drag) {
  border-color: var(--un-coral);
  background: var(--un-soft);
}
.video-upscale-page #model-choice { margin: 0; padding: 0; border: 0; min-width: 0; }
.video-upscale-page #model-choice legend { padding: 0; margin-bottom: 6px; font-size: 13px; }
.video-upscale-page #models, .video-upscale-page .video-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.video-upscale-page .video-model-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--un-line);
  border-radius: 8px;
  background: var(--un-card);
  color: var(--un-ink);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.video-upscale-page .video-model-option:has(input:checked) {
  border-color: var(--un-coral);
  background: var(--un-soft);
}
.video-upscale-page .video-model-option > input {
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--un-coral);
}
.video-upscale-page #job-state { display: none; }
.video-upscale-page #job-state:has(:is(button, progress):not([hidden]), p:not(:empty):not([hidden])) {
  display: grid;
  gap: 5px;
}
.video-upscale-page .has-source #request-form {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  padding-top: 10px;
  margin: 0;
  border-top: 1px solid var(--un-line);
}
.video-upscale-page .has-source .video-upscale-input { flex: 0 1 140px; }
.video-upscale-page .has-source #pick-video {
  min-height: 36px;
  padding: 5px 9px;
  border-style: solid;
  border-radius: 8px;
}
.video-upscale-page .has-source :is(#pick-video small, #video-limits) { display: none; }
.video-upscale-page .has-source #model-note, .video-upscale-page .has-source #job-state { flex-basis: 100%; }
.video-upscale-page .upscale-comparison {
  display: flex;
  flex: 1 0 175px;
  flex-direction: column;
  min-width: 0;
  min-height: 175px;
  gap: 8px;
}
.video-upscale-page .video-screen {
  display: grid;
  flex: 1;
  min-width: 0;
  min-height: 0;
  place-items: center;
  container-type: size;
  overflow: hidden;
  border-radius: 12px;
  background: #181a22;
}
.video-upscale-page .video-compare-stage {
  position: relative;
  width: min(100%, calc(var(--video-ratio, 1.778) * 54vh));
  width: min(100%, calc(var(--video-ratio, 1.778) * 100cqh));
  aspect-ratio: var(--video-ratio, 1.778);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: #181a22;
  --wipe: 50%;
}
.video-upscale-page .video-compare-stage video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.video-upscale-page #output-player { clip-path: inset(0 0 0 var(--wipe)); }
.video-upscale-page #output-player.video-only-result { clip-path: none; }
.video-upscale-page .video-compare-labels {
  position: absolute;
  inset: 10px 10px auto;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-size: 12px;
}
.video-upscale-page .video-compare-labels span {
  color: #fff;
  background: rgb(18 21 26 / 76%);
  padding: 4px 8px;
  border-radius: 6px;
}
.video-upscale-page .video-wipe-line {
  position: absolute;
  inset: 0 auto 0 var(--wipe);
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 5px rgb(18 21 26 / 72%);
  pointer-events: none;
}
.video-upscale-page .video-wipe-line::after {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgb(18 21 26 / 72%);
  color: #fff;
}
.video-upscale-page .video-wipe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: ew-resize;
}
.video-upscale-page .video-compare-stage:focus-within {
  outline: 2px solid var(--un-coral, #cf6754);
  outline-offset: 2px;
}
.video-upscale-page .video-transport {
  display: flex;
  flex: none;
  gap: 8px 12px;
  align-items: center;
  flex-wrap: wrap;
}
.video-upscale-page .video-scrub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 145px;
  min-width: 0;
}
.video-upscale-page .video-scrub input { flex: 1; min-width: 40px; accent-color: var(--un-coral); }
.video-upscale-page #video-time-text { white-space: nowrap; font-variant-numeric: tabular-nums; }
.video-upscale-page :is(#video-player-error, #video-buffer) { flex: none; margin: 0; }
.video-upscale-page progress { width: 100%; accent-color: var(--un-coral); }
@media (max-width: 600px) {
  .video-upscale-page .voice-home-return span:last-child { display: none; }
  .video-upscale-page .voice-side { max-width: calc(100vw - 48px); }
  .video-upscale-page .video-scrub { order: -1; flex-basis: 100%; }
  .video-upscale-page .video-transport { gap: 6px 10px; }
  .video-upscale-page .video-transport :is(button, a) { padding: 5px 7px; font-size: 12px; }
}

.video-upscale-page.video-immersive-open { overflow: hidden; }
.video-upscale-page .upscale-comparison.video-immersive { position: fixed; inset: 0; z-index: 1000; }
.video-upscale-page .upscale-comparison:is(:fullscreen, .video-immersive) {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
           max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: #151720;
  color: #f7f7fa;
  color-scheme: dark;
}
.video-upscale-page .upscale-comparison:is(:fullscreen, .video-immersive) :is(.muted,.voice-quiet) { color: #e3e5ed; }
.video-upscale-page .upscale-comparison:is(:fullscreen, .video-immersive) .voice-button { background: #303445; color: #f7f7fa; }
.video-upscale-page .upscale-comparison:is(:fullscreen, .video-immersive) #video-player-error { color: #ffb6a8; }
