/* The PDF merge / split tool: the two panels, the drop targets, the file list
   and the page grid. Hero, content sections, cards, table and FAQ all come from
   tool_page.css. */

/* The starfield behind the hero is a full-size absolutely positioned image at
   z-index 0, so anything interactive on top of it needs its own stacking
   context or the image swallows every click. */
.pt {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto 56px auto;
  padding: 0 16px;
}

.pt-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.pt-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.pt-tab:hover {
  color: #fff;
}

.pt-tab.is-active {
  background: #6e00ff;
  color: #fff;
}

.pt-panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.pt-privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 20px;
}

.pt-privacy i {
  color: #9c6bff;
  font-size: 16px;
}

/* ---- drop target ---- */

.pt-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.26);
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.pt-drop.is-over {
  border-color: #8c46ff;
  background: rgba(110, 0, 255, 0.18);
}

.pt-drop i {
  color: #9c6bff;
  font-size: 30px;
}

.pt-drop-title {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}

.pt-drop-hint {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 20px;
}

.pt-drop label {
  margin: 4px 0 0 0;
}

/* ---- the file list ---- */

.pt-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
}

.pt-files:empty {
  margin: 0;
}

.pt-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.24);
  cursor: grab;
}

.pt-file.is-dragging {
  opacity: 0.45;
}

.pt-file.is-error {
  border-color: rgba(255, 122, 122, 0.5);
}

.pt-file-handle {
  color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
  line-height: 1;
}

.pt-file-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 52px;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  color: rgba(13, 0, 31, 0.4);
  font-size: 20px;
}

.pt-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.pt-file-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.pt-file-name {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-file-meta {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12.5px;
}

.pt-file.is-error .pt-file-meta {
  color: #ff9a9a;
}

.pt-file-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.pt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pt-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.pt-empty {
  margin: 16px 0 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  text-align: center;
}

/* ---- controls ---- */

.pt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.pt-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  min-width: 0;
  flex: 1 1 260px;
}

.pt-field-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
}

.pt-field input[type="text"] {
  width: 100%;
  border-radius: 10px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 22px;
  padding: 11px 14px;
}

.pt-field input[type="text"]:focus {
  outline: none;
  border-color: #8c46ff;
  background: rgba(0, 0, 0, 0.42);
}

.pt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pt-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pt-chip:hover {
  background: rgba(255, 255, 255, 0.16);
}

.pt-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 16px 0 0 0;
  padding: 0;
  border: none;
}

.pt-modes legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 10px;
}

.pt-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.pt-radio input {
  accent-color: #6e00ff;
  width: 16px;
  height: 16px;
}

/* ---- the page grid ---- */

.pt-summary {
  margin: 16px 0 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  word-break: break-word;
}

.pt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
  margin-top: 16px;
  max-height: 460px;
  overflow-y: auto;
  padding: 4px;
}

.pt-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pt-page:hover {
  background: rgba(255, 255, 255, 0.14);
}

.pt-page.is-selected {
  border-color: #8c46ff;
  background: rgba(110, 0, 255, 0.22);
}

/* The canvas is given a placeholder size so the grid does not reflow when a
   thumbnail arrives; a page is roughly A4, so the ratio is close enough that
   the cell barely moves once the real drawing lands. */
.pt-page-canvas {
  width: 128px;
  height: 181px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pt-page-canvas.is-ready {
  background: #fff;
  opacity: 1;
}

.pt-page-number {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pt-page.is-selected .pt-page-number {
  color: #fff;
  font-weight: 600;
}

/* ---- running, and what comes out ---- */

.pt-run {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.pt-notice {
  margin: 12px 0 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 0.5px solid rgba(255, 122, 122, 0.45);
  background: rgba(255, 80, 80, 0.12);
  color: #ffc7c7;
  font-size: 14px;
  line-height: 21px;
}

/* Progress and completion go to a line of their own rather than into the
   button's label. Swapping a label changes the button's width, which shifts
   everything beside it -- including the control the pointer is resting on. The
   line holds its height whether or not it has anything to say. */
.pt-status {
  margin: 0;
  min-height: 21px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13.5px;
  line-height: 21px;
}

.pt-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 0.5px solid rgba(140, 70, 255, 0.4);
  background: rgba(110, 0, 255, 0.12);
}

.pt-result-all {
  width: 100%;
  margin-bottom: 12px;
}

.pt-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.pt-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.26);
}

.pt-result-name {
  flex: 1 1 auto;
  min-width: 0;
  color: #fff;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-result-meta {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12.5px;
  white-space: nowrap;
}

.pt-result-download {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .pt-panel {
    padding: 16px;
  }

  .pt-tab {
    font-size: 14px;
    padding: 10px 12px;
  }

  .pt-drop {
    padding: 24px 14px;
  }

  .pt-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    max-height: 380px;
  }

  .pt-page-canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.414;
  }

  .pt-result-item {
    flex-wrap: wrap;
  }

  .pt-result-name {
    flex: 1 1 100%;
  }

  .pt-run .tp-btn {
    width: 100%;
  }
}
