.export-jobs-panel {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 20;
  overflow: hidden;
  width: min(20rem, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-3);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-elevated);
}

.export-jobs-panel[hidden] {
  display: none;
}

.export-jobs-panel.is-collapsed .export-jobs-panel__list {
  display: none;
}

.export-jobs-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.export-jobs-panel__title {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.export-jobs-panel__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-2);
}

.export-jobs-panel__toggle,
.export-jobs-panel__clear,
.export-job__dismiss {
  border: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  font: inherit;
}

.export-job {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.export-job__dismiss {
  justify-self: start;
  font-size: var(--font-size-xs);
}

.export-jobs-panel__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.export-job__link {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.export-job__link:hover .export-job__title {
  color: var(--color-accent);
}

.export-job__meta {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.export-job__title {
  margin: 0;
  overflow: hidden;
  min-width: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.export-job__body {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  column-gap: var(--space-2);
  align-items: start;
  min-width: 0;
}

.export-job__thumb-wrap {
  display: block;
  overflow: hidden;
  align-self: stretch;
  width: 3.25rem;
  min-height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-elevated);
}

.export-job__thumb-wrap--empty {
  background: var(--color-surface-elevated)
    url("/static/icons/film-strip.svg") center / 1rem no-repeat;
}

.export-job__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.export-job__detail {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.export-job__subtitle,
.export-job__message {
  margin: 0;
  overflow: hidden;
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.export-job__status {
  position: relative;
  min-height: 0.75rem;
  min-width: 0;
  width: 100%;
  margin-top: 0.125rem;
}

.export-job__progress-wrap {
  display: block;
  width: 100%;
  overflow: hidden;
  opacity: 1;
  transition: opacity 280ms ease;
}

.export-job__progress-wrap.is-fading {
  opacity: 0;
}

.export-job__progress {
  display: block;
  overflow: hidden;
  width: 100%;
  height: 0.25rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
}

.export-job__progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--color-accent);
  transform: none;
  transition: width 200ms ease;
}

.export-job__progress-bar[data-indeterminate="true"] {
  width: 30%;
  max-width: 30%;
  transition: none;
  animation: export-job-indeterminate 1.4s ease-in-out infinite;
}

.export-job[data-state="failed"] .export-job__progress-bar {
  background: var(--color-error);
}

@keyframes export-job-indeterminate {
  0% {
    transform: translateX(-100%);
  }

  100% {
    /* 30% bar: travel own width past the full track (100/30 ≈ 3.33 → 233%) */
    transform: translateX(233%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .export-job__progress-bar,
  .export-job__progress-wrap {
    transition: none;
  }

  .export-job__progress-bar[data-indeterminate="true"] {
    animation: none;
    width: 100%;
    max-width: 100%;
    transform: none;
  }
}
