/* Create By Asking: the merge and split PDF tool on the merge-pdf page.
   Loaded after style.css and tools.css; reuses the dark .tool-shell look. */

.tool-shell [hidden] { display: none !important; }
.pd-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-pane { display: grid; gap: 14px; }
.pd-pane > p { color: #CBBFE8; font-size: var(--step--1); margin: 0; }

/* drop zone */
.pd-drop { display: grid; justify-items: center; gap: 8px; text-align: center; padding: clamp(18px, 4vw, 30px) 16px; border: 2px dashed rgba(255, 255, 255, 0.2); border-radius: 14px; background: rgba(255, 255, 255, 0.03); transition: border-color 0.15s, background 0.15s; }
.pd-drop.is-over { border-color: #FFC93C; background: rgba(255, 201, 60, 0.08); }
.pd-drop strong { color: #fff; font: 700 var(--step-1)/1.2 var(--display); }
.pd-drop span { color: #A597CC; font-size: var(--step--1); }
.pd-drop .btn { cursor: pointer; }
.pd-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pd-drop:focus-within .btn { outline: 2px solid #fff; outline-offset: 2px; }

/* file list */
.pd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pd-list li { display: grid; grid-template-columns: 28px 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 8px 8px 8px 6px; }
.pd-list li.is-drag { background: rgba(255, 201, 60, 0.16); box-shadow: 0 0 0 1.5px #FFC93C; }
.pd-list li.is-wait { opacity: 0.6; }
.pd-handle { border: 0; background: none; color: #A597CC; cursor: grab; touch-action: none; font-size: 1.1rem; line-height: 1; padding: 8px 4px; user-select: none; }
.pd-list li.is-drag .pd-handle { cursor: grabbing; color: #FFC93C; }
.pd-num { font: 700 0.85rem/1 var(--mono); color: #FFC93C; text-align: center; }
.pd-name { min-width: 0; display: grid; gap: 2px; line-height: 1.3; }
.pd-name b { color: #fff; font-weight: 600; font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-name small { color: #A597CC; font-size: 0.78rem; }
.pd-btns { display: flex; gap: 4px; }
.pd-btns .icon-btn { width: 34px; height: 34px; }
.pd-btns .pd-del:hover { background: rgba(255, 122, 98, 0.3); }
.pd-sum { margin: 0; color: #CBBFE8; font-size: var(--step--1); }

/* split */
.pd-split-file { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 10px 12px; }
.pd-split-opts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.pd-label { display: grid; gap: 6px; font-size: var(--step--1); color: #CBBFE8; }
.pd-label input, .pd-label select { width: 100%; }
.pd-preview { margin: 0; font-size: var(--step--1); color: #CBBFE8; min-height: 1.4em; }
.pd-preview.is-bad { color: #FFC2B5; }

/* progress and messages */
.pd-progress { display: grid; gap: 6px; }
.pd-status { margin: 0; font-size: var(--step--1); color: #CBBFE8; }
.pd-status.is-done { color: #8EE8B4; }
.pd-alert { margin: 0; background: rgba(255, 122, 98, 0.14); color: #FFC2B5; border-radius: 10px; padding: 10px 14px; font-size: var(--step--1); line-height: 1.45; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool-shell .btn:disabled { opacity: 0.45; cursor: default; }
.pd-lock { margin: 0; font-size: 0.78rem; color: #A597CC; }
.pd-lock b { color: #CBBFE8; }

@media (max-width: 600px) {
  .pd-split-opts { grid-template-columns: 1fr; }
  .pd-list li { grid-template-columns: 22px 16px minmax(0, 1fr) auto; gap: 6px; }
  .pd-btns { gap: 3px; }
  .pd-btns .icon-btn { width: 32px; height: 32px; }
}
