
/* Workspace APP Styles */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  background-image: var(--bg-glow);
  position: relative;
  z-index: 10;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 22, 0.8);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.api-key-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.api-key-confirm {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.api-key-confirm:hover:not(:disabled) {
  background: rgba(0, 240, 255, 0.22);
}

.api-key-confirm:disabled {
  cursor: wait;
  opacity: 0.65;
}

.btn-back {
  padding: 8px;
  border-radius: 50%;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--muted);
}

.user-info input {
  font-size: 13px;
  color: var(--ink);
  outline: none;
  width: 110px;
}

.user-info input::placeholder {
  color: var(--muted);
}

/* Workspace 2-Column Grid Layout */
.workspace-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  flex: 1;
  min-height: 0;
  background: rgba(0, 0, 0, 0.2);
  perspective: 1500px;
  transform-style: preserve-3d;
}

@media (max-width: 900px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  backface-visibility: hidden;
}

.workspace-scanline {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 20px var(--cyan), 0 0 40px var(--cyan);
  opacity: 0;
  pointer-events: none;
  z-index: 10030;
}

.compose-panel {
  background: rgba(8, 10, 18, 0.5);
  backdrop-filter: blur(15px);
}

.panel-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 0;
}

.panel-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 1px;
}

/* Job List & Cards */
.job-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-history-controls {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  padding: 4px 0 10px;
}

.job-history-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 10px;
  background: rgba(127, 29, 29, 0.16);
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.5;
}

.job-history-controls button {
  min-height: 40px;
  border: 1px solid rgba(0, 240, 255, 0.24);
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.06);
  color: var(--cyan);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.job-history-controls button:hover:not(:disabled),
.job-history-controls button:focus-visible {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  outline: none;
}

.job-history-controls button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.job-item {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 138px;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.job-item:hover, .job-item.selected {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.job-item.selected {
  border-color: var(--cyan);
  box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.1), 0 0 20px rgba(0, 240, 255, 0.1);
}

.job-item:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.job-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}

.job-mode {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}

.job-title-editor {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 5px;
}

.job-title-input {
  width: 100%;
  min-width: 0;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  outline: none;
  cursor: text;
  text-overflow: ellipsis;
}

.job-title-input:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.job-title-input:focus {
  border-color: rgba(0, 240, 255, 0.52);
  background: rgba(0, 240, 255, 0.055);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.08);
  text-overflow: clip;
}

.job-title-input:disabled {
  opacity: 0.55;
}

.job-title-editor svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  pointer-events: none;
}

.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

.badge.queued { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.badge.submitting { background: rgba(0, 240, 255, 0.15); color: var(--cyan); }
.badge.running { background: rgba(160, 66, 255, 0.15); color: var(--violet); }
.badge.succeeded { background: rgba(0, 255, 135, 0.15); color: var(--success); }
.badge.failed { background: rgba(255, 42, 95, 0.15); color: var(--error); }
.badge.cancelled { background: rgba(255, 255, 255, 0.05); color: var(--muted); }

.job-prompt {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 99px;
  width: 0;
  transition: width 0.4s ease;
}

.progress-bar.is-active {
  animation: progressPulse 1.5s infinite alternate;
}

@keyframes progressPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.3) drop-shadow(0 0 3px var(--cyan)); }
}

.job-error {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255, 42, 95, 0.08);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 12px;
  line-height: 1.4;
}

/* Output & Creation Workspace Panel */
.output-panel {
  background: rgba(4, 5, 9, 0.2);
}

.tab-bar {
  display: flex;
  gap: 4px;
  padding: 16px 24px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-btn {
  padding: 12px 24px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: rgba(255, 255, 255, 0.02);
}

.tab-content {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 32px;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Creation Form Tab layout */
.mode-tabs {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  isolation: isolate;
}

.mode-tabs button {
  padding: 8px 24px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  background: none;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 0.3s;
}

.mode-tabs button.active {
  background: none !important;
  color: var(--cyan) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.mode-tab-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  z-index: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(160, 66, 255, 0.12));
  border: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
  pointer-events: none;
  will-change: left, width;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
}

.form.seedance-form-active {
  width: 100%;
  max-width: min(920px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.form.seedance-form-active .image-inputs {
  display: block;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.form-group label .optional {
  font-size: 11px;
  color: var(--muted);
  font-weight: normal;
  margin-left: 6px;
}

.form textarea, .form input[type="text"] {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: all 0.3s;
}

.form textarea:focus, .form input[type="text"]:focus {
  border-color: var(--cyan);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

/* File Upload Slot for Video mode */
.image-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.file-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/9;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.01);
  padding: 24px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s;
}

.file-slot input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.preview-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--muted);
  z-index: 2;
}

.preview-box img, .preview-box video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.file-meta {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  z-index: 3;
}

.file-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-sub {
  font-size: 10px;
  color: var(--muted);
}

.file-slot:hover, .file-slot.drag-over {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.02);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.05);
}

.form-message {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(0, 255, 135, 0.08);
  color: var(--success);
  border: 1px solid rgba(0, 255, 135, 0.2);
}

.form-message.error {
  display: block;
  background: rgba(255, 42, 95, 0.08);
  color: var(--error);
  border: 1px solid rgba(255, 42, 95, 0.2);
}

/* Result Showcase view */
.result-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 861px) {
  #resultTab {
    overflow: hidden;
  }

  #resultTab .result-view {
    flex: 1;
    min-height: 0;
    gap: 12px;
  }

  #resultTab .result-actions {
    flex: 0 0 auto;
  }

  #resultTab .media-grid {
    flex: 1;
    min-height: 0;
    gap: 12px;
    overflow: auto;
  }

  #resultTab .media-item {
    min-height: 0;
    gap: 8px;
    padding: 12px;
  }

  #resultTab .media-item-image img,
  #resultTab .media-item-video .video-player {
    max-height: min(560px, calc(100dvh - 250px));
  }
}

.result-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.result-meta strong {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  font-weight: 700;
}

.job-provider-error {
  color: #ff8f9d;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.media-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.01);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform: none !important;
  transform-style: flat;
  transition: box-shadow 0.2s ease;
  will-change: auto;
}

.media-item:hover,
.media-item:active,
.media-item:focus-within {
  transform: none !important;
}

.media-item::after {
  content: none !important;
}

.media-item img {
  width: 100%;
  border-radius: var(--radius-sm);
  aspect-ratio: 16/10;
  object-fit: contain;
  background: #020306;
}

.media-item a {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  text-align: center;
  word-break: break-all;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.failed-state {
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 42, 95, 0.03);
  border-color: rgba(255, 42, 95, 0.15);
  color: var(--error);
  text-align: center;
}

/* Custom Video Player design inside Output Panel */
.video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  background: #020204;
  overflow: hidden;
  transform: none !important;
  transition: none !important;
  isolation: isolate;
}

.video-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  transform: none !important;
  transition: none !important;
}

.media-status {
  min-height: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}

.media-status.error {
  color: var(--error);
}

.image-asset-promotion-control {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 13;
}

.image-asset-promotion-trigger {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  background: rgba(8, 10, 15, 0.78);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.image-asset-promotion-trigger:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(20, 22, 29, 0.86);
}

.image-asset-promotion-trigger:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.image-asset-promotion-trigger:disabled,
.image-asset-promotion-control.is-busy .image-asset-promotion-trigger {
  cursor: wait;
  opacity: 0.62;
}

.frame-capture-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: auto;
  z-index: 14;
}

.video-upscale-control {
  position: absolute;
  top: 16px;
  right: 68px;
  bottom: auto;
  z-index: 13;
}

.video-upscale-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 58px;
  height: 42px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 21px;
  background: rgba(8, 10, 15, 0.78);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.video-upscale-trigger svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.video-upscale-trigger:hover {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(20, 22, 29, 0.86);
  transform: translateY(-1px);
}

.video-upscale-control.is-confirming .video-upscale-trigger {
  border-color: rgba(117, 202, 255, 0.9);
  background: rgba(0, 113, 227, 0.92);
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.32);
}

.video-upscale-trigger:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.video-upscale-trigger:disabled,
.video-upscale-control.is-busy .video-upscale-trigger {
  cursor: wait;
  opacity: 0.62;
}

.video-upscale-control.is-busy .video-upscale-trigger svg {
  animation: material-preview-spin 0.9s linear infinite;
}

.frame-capture-trigger {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(8, 10, 15, 0.68);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px) saturate(130%);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.frame-capture-trigger svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.frame-capture-trigger:hover,
.frame-capture-controls.is-open .frame-capture-trigger {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(20, 22, 29, 0.86);
  transform: translateY(-1px);
}

.frame-capture-trigger:focus-visible,
.frame-capture-button:focus-visible,
.frame-capture-color-mode:focus-visible,
.frame-capture-option:focus-within {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.frame-capture-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  bottom: auto;
  min-width: 224px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(45, 42, 43, 0.82);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46), inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(135%);
}

.frame-capture-menu[hidden] { display: none; }

.frame-capture-button {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: 700 16px/1.25 var(--font-display);
  text-align: left;
}

.frame-capture-button:hover { background: rgba(255, 255, 255, 0.1); }

.frame-capture-button:disabled,
.frame-capture-controls.is-busy .frame-capture-button,
.frame-capture-controls.is-busy .frame-capture-trigger {
  cursor: wait;
  opacity: 0.55;
}

.frame-capture-color-mode {
  min-width: 0;
  height: 28px;
  padding: 3px 6px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f7fa;
  font: inherit;
  font-size: 11px;
}

.frame-capture-color-mode option { color: #111827; }

.frame-capture-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  white-space: nowrap;
}

.frame-capture-option input { accent-color: var(--cyan); }

.frame-capture-menu-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
  .frame-capture-controls { top: 10px; right: 10px; bottom: auto; }
  .video-upscale-control { top: 10px; right: 60px; bottom: auto; }
  .frame-capture-menu {
    right: calc(100% + 7px);
    top: 0;
    bottom: auto;
    min-width: 174px;
  }
  .frame-capture-button { min-height: 44px; font-size: 14px; }
  .frame-capture-menu-options { display: none; }
}

.frame-capture-preview {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 3, 8, 0.78);
  backdrop-filter: blur(10px);
}

.frame-capture-preview-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0c0f17;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.frame-capture-preview-panel header,
.frame-capture-preview-panel footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.frame-capture-preview-panel header div { display: grid; gap: 3px; }
.frame-capture-preview-panel header span,
.frame-capture-preview-panel > p { color: var(--muted); font-size: 12px; }
.frame-capture-preview-panel > p { margin: 0; }

.frame-capture-preview-panel button {
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
}

.frame-capture-preview-panel button.primary {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan);
}

.frame-capture-preview-stage {
  min-height: 240px;
  overflow: auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #020306;
}

.frame-capture-preview-stage img {
  display: block;
  max-width: 100%;
  max-height: min(68vh, 780px);
  object-fit: contain;
}

.frame-capture-preview-panel footer { justify-content: flex-end; }

@media (max-width: 640px) {
  .frame-capture-preview { padding: 10px; }
  .frame-capture-preview-panel { max-height: calc(100vh - 20px); padding: 12px; }
  .frame-capture-preview-stage { min-height: 180px; }
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(180deg, transparent, rgba(3, 4, 8, 0.9));
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.video-player:hover .video-controls, .video-player.is-paused .video-controls {
  opacity: 1;
  transform: translateY(0);
}

.video-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.video-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.video-progress {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.video-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.video-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  white-space: nowrap;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.06) 37%, rgba(255, 255, 255, 0.02) 63%);
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
}

.skeleton-job {
  height: 110px;
  border-radius: var(--radius);
  width: 100%;
}

@keyframes skeletonLoading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
