/* File drop zone */
.drop-zone {
  border: 2px dashed #cfe0f0;
  border-radius: 10px;
  background: #f8fbff;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover, .drop-zone:focus, .drop-zone.dragging {
  border-color: #0078d4;
  background: #eef6ff;
}
.drop-icon { font-size: 30px; line-height: 1; }
.drop-text { margin-top: 10px; font-size: 15px; color: #333; font-weight: 600; }
.drop-link { color: #0078d4; text-decoration: underline; }
.drop-note { margin-top: 6px; font-size: 12px; color: #999; }

/* Selected-file line */
.file-line {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 12px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fafafa;
}
.file-line.show { display: flex; }
.file-line .file-meta { flex: 1; min-width: 0; }
.file-line .file-name {
  font-size: 13px;
  color: #1a1a1a;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-line .file-size { font-size: 11px; color: #888; }
.file-line .rm {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.file-line .rm:hover { background: #fdecea; border-color: #e74c3c; color: #e74c3c; }

/* Options */
.opt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.opt-row label { font-size: 13px; color: #555; }
.opt-row select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  outline: none;
}
.opt-row select:focus { border-color: #0078d4; }

/* Action */
.btn-merge {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-merge:hover:not(:disabled) { background: #005fa3; }
.btn-merge:disabled { opacity: 0.6; cursor: default; }

.pdf-status {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  word-break: break-word;
}
.pdf-status.show { display: block; }
.pdf-status.error { background: #fdecea; border: 1px solid #f5c6c0; color: #c0392b; }
.pdf-status.ok { background: #eaf7ea; border: 1px solid #b6e0b6; color: #107c10; }
.pdf-status.busy { background: #f0f6ff; border: 1px solid #c5ddf9; color: #0078d4; }

/* Rendered pages */
.result-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.result-head.show { display: flex; }
.result-count { font-size: 13px; color: #555; font-weight: 600; }
.btn-download {
  display: inline-block;
  padding: 10px 20px;
  background: #0078d4;
  color: #fff;
  border: 1px solid #0078d4;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-download:hover { background: #005fa3; }

.page-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.page-card {
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  text-align: center;
}
.page-card img {
  width: 100%;
  height: auto;
  border: 1px solid #eee;
  border-radius: 4px;
  display: block;
}
.page-card .page-label { margin-top: 8px; font-size: 12px; color: #666; }
.page-card a.page-dl {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #0078d4;
  border: 1px solid #0078d4;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.15s;
}
.page-card a.page-dl:hover { background: #e8f2fc; }
