/* PDF Merger */

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.privacy-callout {
  display: block;
  margin-top: 10px;
  color: #2457a7;
  font-size: 16px;
  font-weight: 800;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-trigger {
  cursor: pointer;
}

.pdf-workspace {
  margin-top: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.pdf-main-panel,
.summary-panel,
.privacy-panel,
.download-panel {
  border: 1px solid #cfdae8;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 253, 0.98));
  box-shadow: 0 20px 48px rgba(19, 44, 82, 0.09);
}

.pdf-main-panel {
  padding: 20px;
}

.pdf-side-panel {
  display: grid;
  gap: 16px;
}

.upload-surface {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border-radius: 24px;
  border: 1px dashed rgba(47, 111, 227, 0.34);
  background:
    radial-gradient(circle at top left, rgba(103, 174, 255, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(47, 111, 227, 0.12), rgba(255, 255, 255, 0.94));
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-surface:hover,
.upload-surface.drag-over {
  transform: translateY(-1px);
  border-color: rgba(47, 111, 227, 0.62);
  box-shadow: 0 22px 40px rgba(47, 111, 227, 0.12);
}

.upload-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(47, 111, 227, 0.14);
  color: #38506e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.upload-icon {
  margin-top: 22px;
}

.upload-surface h2,
.workspace-toolbar h2,
.privacy-panel h2,
.download-panel h2,
.empty-queue h3,
.pdf-item h3 {
  margin: 0;
  font-family: "SF Pro Display", "Sora", "Inter", sans-serif;
  letter-spacing: -0.4px;
}

.upload-surface h2 {
  margin-top: 18px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 0.98;
}

.upload-surface p {
  max-width: 34ch;
  margin: 12px 0 0;
  color: #53657a;
  font-size: 17px;
}

.upload-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.upload-hint {
  color: #556981;
  font-size: 14px;
  font-weight: 600;
}

.quick-steps {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-step {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(47, 111, 227, 0.14);
  color: #435a75;
  font-size: 13px;
  font-weight: 700;
}

.workspace-toolbar {
  margin-top: 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.workspace-toolbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-actions .button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.status-banner {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(47, 111, 227, 0.14);
  color: #41556e;
  font-size: 14px;
  font-weight: 700;
}

.status-banner[data-tone="success"] {
  border-color: rgba(31, 162, 97, 0.18);
  background: rgba(239, 251, 245, 0.92);
  color: #1a6b48;
}

.status-banner[data-tone="error"] {
  border-color: rgba(202, 73, 73, 0.2);
  background: rgba(255, 243, 243, 0.96);
  color: #9b2f2f;
}

.status-banner[data-tone="working"] {
  border-color: rgba(47, 111, 227, 0.24);
  background: rgba(240, 246, 255, 0.96);
  color: #2456a5;
}

.empty-queue {
  margin-top: 18px;
  padding: 32px 20px;
  border-radius: 22px;
  border: 1px dashed #d1dbea;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.empty-queue p {
  max-width: 32ch;
  margin: 10px auto 0;
  color: var(--muted);
}

.pdf-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.pdf-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid #d7dfeb;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(18, 40, 74, 0.06);
}

.pdf-item.dragging {
  opacity: 0.5;
}

.pdf-item-index {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 111, 227, 0.14), rgba(78, 131, 234, 0.26));
  color: #2454a2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.pdf-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pdf-item h3 {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.pdf-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(47, 111, 227, 0.08);
  color: #295dac;
  font-size: 12px;
  font-weight: 700;
}

.pdf-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.pdf-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #d6e0ef;
  background: #ffffff;
  color: #35506f;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.icon-button:hover:not([disabled]) {
  transform: translateY(-1px);
  border-color: rgba(47, 111, 227, 0.32);
  box-shadow: 0 12px 24px rgba(47, 111, 227, 0.08);
}

.icon-button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.icon-button.remove-button {
  color: #9a3c3c;
}

.summary-panel,
.privacy-panel,
.download-panel {
  padding: 22px 20px;
}

.summary-label {
  margin: 0 0 14px;
  color: #5a6f89;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(206, 217, 233, 0.88);
  color: #4a6077;
}

.summary-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.summary-row strong {
  color: var(--text);
  font-size: 18px;
}

.summary-note,
.privacy-panel p,
#downloadMeta {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.download-panel h2,
.privacy-panel h2 {
  font-size: 26px;
  line-height: 1.05;
}

.download-panel .button {
  margin-top: 18px;
  width: 100%;
}

.hidden {
  display: none !important;
}

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

@media (max-width: 760px) {
  .upload-surface,
  .pdf-main-panel,
  .summary-panel,
  .privacy-panel,
  .download-panel {
    border-radius: 24px;
  }

  .upload-surface {
    padding: 24px;
  }

  .pdf-item {
    grid-template-columns: 1fr;
  }

  .pdf-item-actions {
    justify-content: flex-start;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .button {
    flex: 1 1 180px;
  }

  .quick-step {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .upload-surface,
  .icon-button {
    transition: none;
  }
}
