.pdf-task-progress {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  width: min(24rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  color: #1e293b;
}

.pdf-task-progress[hidden] {
  display: none;
}

.pdf-task-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.pdf-task-progress__track {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.pdf-task-progress__bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  transition: width 180ms ease;
}

.pdf-task-progress[data-indeterminate="true"] .pdf-task-progress__bar {
  width: 38%;
  animation: pdf-progress-indeterminate 1.15s ease-in-out infinite;
}

.pdf-tool-inline-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  color: #475569;
  font-size: 0.875rem;
}

.pdf-tool-inline-status::before {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  border: 2px solid #c7d2fe;
  border-top-color: #4f46e5;
  border-radius: 999px;
  content: "";
  animation: pdf-spin 0.75s linear infinite;
}

.pdf-rotate-controls {
  position: absolute;
  right: 0.5rem;
  bottom: 0.65rem;
  display: flex;
  gap: 0.35rem;
  z-index: 2;
}

.pdf-rotate-button {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #4338ca;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}

.pdf-rotate-button:hover {
  background: #eef2ff;
}

.jpg-selected-scroll {
  max-height: min(34rem, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.jpg-selected-scroll:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.24);
  outline-offset: -3px;
}

@media (min-width: 1024px) {
  .jpg-selected-card,
  .jpg-options-card {
    max-height: calc(100vh - 7rem);
  }

  .jpg-selected-card {
    display: flex;
    flex-direction: column;
  }

  .jpg-selected-header {
    flex: 0 0 auto;
  }

  .jpg-selected-scroll {
    max-height: calc(100vh - 13.5rem);
  }

  .jpg-options-card {
    position: sticky;
    top: 6rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .jpg-convert-action {
    position: sticky;
    bottom: -1.5rem;
    margin: 0 -1.5rem -1.5rem;
    padding: 1rem 1.5rem 1.5rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.72), #fff 25%);
  }
}

@keyframes pdf-progress-indeterminate {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(310%); }
}

@keyframes pdf-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .pdf-task-progress {
    right: 0.75rem;
    bottom: 0.75rem;
    width: calc(100vw - 1.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdf-task-progress__bar,
  .pdf-tool-inline-status::before {
    animation-duration: 2.5s;
  }
}
