/* Oberfläche für die PDF-/Bild-Werkzeuge (Dropzone, Kachel-Raster, Drag&Drop) */

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--bg-soft); padding: 34px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--brand); background: var(--brand-tint); }
.dropzone:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.dropzone .dz-icon { width: 40px; height: 40px; color: var(--brand); }
.dropzone p { margin: .5rem 0 0; color: var(--text-muted); }
.dropzone p strong { color: var(--text); }
.dropzone .small { font-size: .85rem; color: var(--text-faint); }
.dropzone input[type=file] { display: none; }

.pdf-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0; }
.pdf-toolbar .spacer { flex: 1; }
.pdf-count { color: var(--text-muted); font-size: .92rem; }
.pdf-status { font-size: .9rem; color: var(--brand-strong); min-height: 1.2em; margin: 4px 0; }
.pdf-status.err { color: var(--danger); }

.pdf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px; }
.pdf-tile {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 8px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; cursor: grab;
}
.pdf-tile:active { cursor: grabbing; }
.pdf-tile.is-dragging { opacity: .35; }
.pdf-tile.is-over { outline: 2px dashed var(--brand); outline-offset: 2px; }
.pdf-thumb {
  width: 100%; aspect-ratio: 1 / 1.414; background: #fff; border: 1px solid var(--border);
  border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pdf-thumb canvas, .pdf-thumb img { max-width: 100%; max-height: 100%; display: block; }
.pdf-tile .label { font-size: .72rem; color: var(--text-muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-tile .tile-actions { display: flex; justify-content: center; gap: 6px; }
.tile-btn {
  border: 1px solid var(--border-strong); background: var(--bg); border-radius: 6px;
  width: 30px; height: 28px; cursor: pointer; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.tile-btn:hover { color: var(--text); border-color: var(--brand); }
.tile-btn svg { width: 16px; height: 16px; }
.pdf-tile .idx {
  position: absolute; top: 6px; left: 6px; background: var(--brand); color: #fff;
  font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px;
}
.tile-select { position: absolute; top: 5px; right: 6px; width: 18px; height: 18px; cursor: pointer; }

.pdf-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.pdf-empty { color: var(--text-faint); text-align: center; padding: 26px 0; }
.is-busy { opacity: .55; pointer-events: none; }

/* ------------------------------------------------------------------
   Die PDF-/Bild-Werkzeuge brauchen die volle Arbeitsbreite. Daher hier
   das 2-Spalten-Rechner-Layout aus main.css zurück auf den klassischen
   Aufbau: Werkzeug breit, Werbung als Sidebar, Erklärung darunter.
   (Diese Datei wird nur von den PDF-Tools geladen, nach main.css.)
   ------------------------------------------------------------------ */
.tool-layout { grid-template-columns: minmax(0, 1fr) 300px; }
.tool-layout > div { display: block; }
.tool-layout > div > .card.prose {
  position: static; top: auto; grid-column: auto; margin-top: 22px; max-width: 70ch;
  background: var(--surface);
}
.tool-layout > aside { grid-column: auto; }
.tool-layout aside .ad-slot[data-format="sidebar"] { min-height: 600px; position: sticky; top: 84px; }
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } }
