/* PDF Splitter — relies on shared ../../assets/css/global.css
   Tool-specific rules below. */

/* ===== PDF info panel ===== */
.ps-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 22px 0 18px;
}
.ps-info-name { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.ps-info-icon { font-size: 1.7rem; flex-shrink: 0; }
.ps-info-title { font-weight: 700; color: var(--text-dark); font-size: 1rem; word-break: break-all; }
.ps-info-sub   { font-size: 0.85rem; color: var(--text-light); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ps-dot { color: var(--text-light); }
.ps-status-ok   { background: rgba(16,185,129,0.1); color: #047857; padding: 2px 10px; border-radius: 50px; font-weight: 600; }
.ps-status-bad  { background: rgba(239,68,68,0.1); color: #dc2626; padding: 2px 10px; border-radius: 50px; font-weight: 600; }
.ps-status-info { background: rgba(55,122,209,0.1); color: var(--primary); padding: 2px 10px; border-radius: 50px; font-weight: 600; }

/* ===== Mode tabs ===== */
.ps-modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.ps-mode {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: var(--text-mid);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.ps-mode:hover { background: rgba(55,122,209,0.05); color: var(--primary); }
.ps-mode.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== Help text ===== */
.ps-help { color: var(--text-mid); font-size: 0.93rem; margin-bottom: 10px; }
.ps-examples { color: var(--text-light); font-size: 0.85rem; margin: 6px 0 12px; }
.ps-examples code {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.85rem;
}

/* ===== Selection toolbar ===== */
.ps-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ps-summary-inline { margin-left: auto; color: var(--text-mid); font-size: 0.92rem; }

/* ===== Thumbnail grid ===== */
.ps-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.ps-thumb {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.ps-thumb:hover { border-color: var(--primary-light); box-shadow: var(--shadow); transform: translateY(-2px); }
.ps-thumb.selected {
  border-color: var(--primary);
  background: rgba(55,122,209,0.06);
  box-shadow: var(--shadow-hover);
}
.ps-thumb.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--primary);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
.ps-thumb-img {
  width: 100%;
  aspect-ratio: 1;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ps-thumb-img canvas { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ps-thumb-fallback {
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px;
}
.ps-thumb-label { text-align: center; font-size: 0.85rem; font-weight: 600; color: var(--text-mid); padding: 6px 8px; border-top: 1px solid var(--border); }
.ps-thumb-note { grid-column: 1 / -1; color: var(--text-light); font-size: 0.88rem; text-align: center; padding: 12px; }

/* ===== Range / Every-N preview ===== */
.ps-preview { margin-top: 10px; }
.ps-preview-ok  { color: #047857; font-weight: 600; margin-bottom: 6px; }
.ps-preview-bad { color: #b91c1c; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius-sm); padding: 10px 14px; }
.ps-preview-list { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow: auto; border: 1px solid var(--border); background: var(--bg-light); border-radius: var(--radius-sm); padding: 8px 14px; }
.ps-preview-list li { border-bottom: 1px dashed var(--border); padding: 6px 0; color: var(--text-mid); font-size: 0.9rem; }
.ps-preview-list li:last-child { border-bottom: none; }

/* ===== Result ===== */
.ps-result {
  margin-top: 24px;
  padding: 28px;
  text-align: center;
  background: linear-gradient(135deg, rgba(55,122,209,0.04) 0%, rgba(16,185,129,0.06) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ps-result-icon { font-size: 2.6rem; margin-bottom: 8px; }
.ps-result h3 { color: var(--text-dark); margin-bottom: 8px; }
.ps-result-meta { color: var(--text-mid); margin-bottom: 18px; font-size: 0.95rem; }
.ps-result .btn { margin: 4px; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .ps-modes { gap: 4px; }
  .ps-mode { padding: 8px 10px; font-size: 0.85rem; }
  .ps-thumb-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .ps-toolbar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ps-summary-inline { margin-left: 0; }
  .ic-control-row { flex-direction: column; align-items: flex-start; }
  .form-input[type="text"], .form-input[type="number"] { width: 100%; max-width: none !important; }
}