/* =====================================================================
   Shivam Tools — PDF Tools page (merge / split / compress / to images)
   Uses only the shared design tokens.
   ===================================================================== */
.pt-root [hidden] { display: none !important; }
.pt-root { min-width: 0; }
.pt-panel { position: relative; min-width: 0; }
.pt-panel:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pt-panel .btn { white-space: normal; text-align: center; }
.pt-panel .dropzone { margin-bottom: 14px; }
.pt-panel .dropzone label.btn { margin: 0; }
.pt-notice { margin: 0 0 14px; }
.pt-static-notice { margin: 0 0 16px; }
.pt-level-hint { margin: -6px 0 16px; }

/* Busy overlay contents */
.pt-panel .busy-overlay { z-index: 5; }
.pt-busy-text { max-width: 36ch; overflow-wrap: anywhere; }
.pt-busy-progress { width: min(280px, 80vw); justify-self: center; }

/* File list */
.pt-list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 6px 0 10px; }
.pt-list-head h3 { font-size: 1rem; margin: 0; }
.pt-empty { margin: 0 0 16px; }
.pt-panel .file-list { margin-bottom: 16px; }
.pt-panel .file-row .file-actions .btn-text { min-width: 40px; min-height: 40px; }
.pt-up .icon { transform: rotate(-90deg); }
.pt-down .icon { transform: rotate(90deg); }

/* Results */
.pt-result:empty { display: none; }
.pt-result { padding-bottom: 18px; }
.pt-result h3, .pt-result-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin: 0 0 6px; }
.pt-result h3 .icon { width: 20px; height: 20px; color: var(--success); flex: none; }
.pt-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pt-result-head > div { min-width: 0; flex: 1 1 220px; }
.pt-result-head p { margin: 0; overflow-wrap: anywhere; }
.pt-stats { margin: 12px 0 14px; }
.pt-result .notice { margin: 0 0 14px; }
.pt-result .btn-row { margin-top: 4px; }

/* Split thumbnails */
.pt-thumbs {
  --pt-ratio: 0.7071;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(110px, 100%), 1fr)); gap: 12px;
  max-height: 460px; overflow-y: auto; overflow-x: hidden; padding: 10px;
  margin-bottom: 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.pt-thumbs:empty { display: none; }
.pt-thumbs:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pt-thumb { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pt-thumb-box {
  position: relative; width: 100%; aspect-ratio: var(--pt-ratio);
  background: #fff; border: 2px solid var(--border); border-radius: 6px; overflow: hidden;
  display: grid; place-items: center;
}
.pt-thumb-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.pt-thumb-ph { color: #94a3b8; font-weight: 700; font-size: 1.1rem; }
.pt-thumb-num { font-size: .78rem; font-weight: 600; color: var(--muted); text-align: center; }
.pt-thumb.is-selected .pt-thumb-box { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }
.pt-thumb.is-selected .pt-thumb-num { color: var(--primary-text); }

/* PDF → images result grid */
.pt-img-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 14px; }
.pt-img-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.pt-img-box { position: relative; aspect-ratio: 0.7071; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.pt-img-box img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.pt-img-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.pt-img-card .btn { width: 100%; }

/* Info section */
.pt-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pt-info-grid .how-steps li { font-size: .93rem; }
.pt-privacy, .pt-credits { margin-top: 24px; }
.pt-privacy h3 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.pt-privacy h3 .icon { width: 20px; height: 20px; color: var(--success); }
.pt-privacy p, .pt-credits p { color: var(--muted); margin: 0; }
.pt-credits h3 { font-size: 1.05rem; }

@media (max-width: 640px) {
  .pt-info-grid { grid-template-columns: minmax(0, 1fr); }
  .pt-tabs [role="tab"] { flex: 1 1 auto; justify-content: center; padding: 8px 12px; }
  .pt-thumbs { max-height: 380px; padding: 8px; gap: 10px; }
  .pt-result-head .btn { width: 100%; }
}
