/* PDF Stüdyo - tarayıcı tabanlı, sunucuya dosya göndermeyen PDF araçları */
.pdfs-app {
  --ps-accent: #2563eb;
  --ps-accent-2: #1d4ed8;
  --ps-bg: #f7f8fb;
  --ps-card: #ffffff;
  --ps-text: #1f2937;
  --ps-muted: #6b7280;
  --ps-border: #e5e7eb;
  --ps-radius: 14px;
  --ps-shadow: 0 10px 30px rgba(17, 24, 39, .08);
  color: var(--ps-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  background: var(--ps-bg);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  overflow: hidden;
  box-shadow: var(--ps-shadow);
  text-align: left;
}
.pdfs-app *, .pdfs-app *::before, .pdfs-app *::after { box-sizing: border-box; }
.pdfs-app button { font: inherit; cursor: pointer; }
.pdfs-app button:disabled { opacity: .55; cursor: not-allowed; }

.pdfs-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--ps-card);
  border-bottom: 1px solid var(--ps-border);
}
.pdfs-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.pdfs-brand .pdfs-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--ps-accent), #7c3aed); color: #fff; font-size: 17px;
}
.pdfs-brand small { display: block; font-weight: 400; font-size: 11px; color: var(--ps-muted); }
.pdfs-head .pdfs-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.pdfs-body { display: grid; grid-template-columns: 288px minmax(0, 1fr); min-height: 460px; }
.pdfs-side { background: var(--ps-card); border-right: 1px solid var(--ps-border); display: flex; flex-direction: column; min-height: 0; }
.pdfs-side-inner { padding: 12px; overflow-y: auto; max-height: 640px; }

.pdfs-drop {
  border: 2px dashed #c7d2fe; border-radius: 12px; background: #eef2ff;
  padding: 16px 12px; text-align: center; color: #3730a3; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pdfs-drop:hover, .pdfs-drop.is-over { background: #e0e7ff; border-color: var(--ps-accent); }
.pdfs-drop b { display: block; font-size: 13px; }
.pdfs-drop span { font-size: 11px; color: #6366f1; }
.pdfs-drop input { display: none; }

.pdfs-files { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.pdfs-file {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px;
  border: 1px solid var(--ps-border); border-radius: 10px; background: #fff; cursor: pointer;
}
.pdfs-file.is-active { border-color: var(--ps-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pdfs-file .pdfs-fico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #f3f4f6; font-size: 13px; flex: none; }
.pdfs-file .pdfs-fmeta { min-width: 0; flex: 1; }
.pdfs-file .pdfs-fname { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdfs-file .pdfs-fsub { font-size: 10.5px; color: var(--ps-muted); }
.pdfs-file .pdfs-fdel { border: none; background: transparent; color: #9ca3af; font-size: 15px; padding: 2px 4px; border-radius: 6px; }
.pdfs-file .pdfs-fdel:hover { color: #dc2626; background: #fee2e2; }

.pdfs-toolsearch { position: relative; margin-top: 12px; }
.pdfs-toolsearch input { width: 100%; padding: 8px 10px; border: 1px solid var(--ps-border); border-radius: 9px; background: #fff; }
.pdfs-toolgroups { margin-top: 10px; }
.pdfs-tgroup { margin-bottom: 8px; }
.pdfs-tgroup-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ps-muted); font-weight: 700; margin: 6px 4px; }
.pdfs-tools { display: flex; flex-direction: column; gap: 3px; }
.pdfs-tool {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; text-align: left; color: var(--ps-text);
}
.pdfs-tool:hover { background: #f3f4f6; }
.pdfs-tool.is-active { background: #eff6ff; border-color: #bfdbfe; color: var(--ps-accent-2); font-weight: 600; }
.pdfs-tool .pdfs-tico { width: 20px; text-align: center; flex: none; }

.pdfs-main { display: flex; flex-direction: column; min-width: 0; }
.pdfs-main-inner { padding: 14px 16px; overflow-y: auto; max-height: 640px; display: flex; flex-direction: column; gap: 12px; }

.pdfs-empty { text-align: center; color: var(--ps-muted); padding: 40px 16px; }
.pdfs-empty .pdfs-big { font-size: 34px; margin-bottom: 6px; }

.pdfs-panel { background: var(--ps-card); border: 1px solid var(--ps-border); border-radius: 12px; padding: 14px; }
.pdfs-panel h3 { margin: 0 0 2px; font-size: 15px; }
.pdfs-panel .pdfs-desc { margin: 0 0 12px; color: var(--ps-muted); font-size: 12px; }
.pdfs-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pdfs-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pdfs-field { display: flex; flex-direction: column; gap: 4px; }
.pdfs-field > label { font-size: 11.5px; font-weight: 600; color: #374151; }
.pdfs-field small { font-size: 10.5px; color: var(--ps-muted); }
.pdfs-field input[type=text], .pdfs-field input[type=number], .pdfs-field input[type=password],
.pdfs-field select, .pdfs-field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--ps-border); border-radius: 8px;
  background: #fff; color: var(--ps-text); font: inherit; font-size: 13px; outline: none;
}
.pdfs-field input:focus, .pdfs-field select:focus, .pdfs-field textarea:focus { border-color: var(--ps-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pdfs-field textarea { min-height: 78px; resize: vertical; }
.pdfs-field input[type=color] { width: 100%; height: 36px; padding: 2px; border: 1px solid var(--ps-border); border-radius: 8px; background: #fff; }
.pdfs-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; }
.pdfs-check input { width: 15px; height: 15px; }

.pdfs-thumbs-wrap { background: var(--ps-card); border: 1px solid var(--ps-border); border-radius: 12px; padding: 12px; }
.pdfs-thumbs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pdfs-thumbs-head b { font-size: 12.5px; }
.pdfs-thumbs-head .pdfs-muted { font-size: 11px; color: var(--ps-muted); }
.pdfs-thumbs-head .pdfs-selall { margin-left: auto; display: flex; gap: 6px; }
.pdfs-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; }
.pdfs-thumb {
  position: relative; border: 2px solid var(--ps-border); border-radius: 8px; overflow: hidden;
  background: #fff; cursor: pointer; padding: 0; aspect-ratio: 0.72; display: grid; place-items: center;
}
.pdfs-thumb img, .pdfs-thumb canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.pdfs-thumb .pdfs-pnum {
  position: absolute; bottom: 3px; right: 3px; background: rgba(17,24,39,.72); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 20px;
}
.pdfs-thumb.is-selected { border-color: var(--ps-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.pdfs-thumb.is-selected::after {
  content: "✓"; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: var(--ps-accent); color: #fff; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
}
.pdfs-thumb.is-drag { opacity: .4; }

.pdfs-runbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pdfs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--ps-border);
  background: #fff; color: var(--ps-text); font-weight: 600; font-size: 13px;
}
.pdfs-btn:hover { background: #f9fafb; }
.pdfs-btn.is-primary { background: var(--ps-accent); border-color: var(--ps-accent); color: #fff; }
.pdfs-btn.is-primary:hover { background: var(--ps-accent-2); }
.pdfs-btn.is-danger { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.pdfs-btn.is-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.pdfs-progress { flex: 1; min-width: 140px; }
.pdfs-bar { height: 8px; background: #e5e7eb; border-radius: 20px; overflow: hidden; }
.pdfs-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ps-accent), #7c3aed); transition: width .2s; }
.pdfs-status { font-size: 11.5px; color: var(--ps-muted); margin-top: 4px; }
.pdfs-status.is-error { color: #b91c1c; font-weight: 600; }

.pdfs-result { display: flex; flex-direction: column; gap: 8px; }
.pdfs-card {
  border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 12px; padding: 12px;
}
.pdfs-card.is-info { border-color: #bfdbfe; background: #eff6ff; }
.pdfs-card.is-warn { border-color: #fed7aa; background: #fff7ed; }
.pdfs-card.is-error { border-color: #fecaca; background: #fef2f2; }
.pdfs-card h4 { margin: 0 0 6px; font-size: 13px; }
.pdfs-card .pdfs-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pdfs-pre {
  white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; background: rgba(255,255,255,.65); border: 1px solid var(--ps-border);
  border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; margin: 6px 0 0;
}
.pdfs-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; background: #e0e7ff; color: #3730a3; font-size: 11px; font-weight: 600; }
.pdfs-hintline { font-size: 11px; color: var(--ps-muted); }

.pdfs-sigbox { border: 1px solid var(--ps-border); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 150px; }
.pdfs-loader { display: flex; align-items: center; gap: 8px; color: var(--ps-muted); font-size: 12px; }
.pdfs-spin { width: 16px; height: 16px; border: 2px solid #c7d2fe; border-top-color: var(--ps-accent); border-radius: 50%; animation: pdfs-spin .7s linear infinite; }
@keyframes pdfs-spin { to { transform: rotate(360deg); } }

.pdfs-foot { padding: 9px 16px; border-top: 1px solid var(--ps-border); background: var(--ps-card); color: var(--ps-muted); font-size: 10.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pdfs-foot .pdfs-dot { color: #22c55e; font-size: 14px; line-height: 1; }

@media (max-width: 860px) {
  .pdfs-body { grid-template-columns: 1fr; }
  .pdfs-side { border-right: none; border-bottom: 1px solid var(--ps-border); }
  .pdfs-side-inner { max-height: 320px; }
  .pdfs-main-inner { max-height: none; }
}
@media (max-width: 540px) {
  .pdfs-grid2, .pdfs-grid3 { grid-template-columns: 1fr; }
  .pdfs-head { flex-wrap: wrap; }
}

/* ---- v2: dark mode, favoriler, presetler, önizleme ---- */
.pdfs-app [hidden] { display: none !important; }
.pdfs-app.pdfs-dark {
  --ps-bg: #0b1220; --ps-card: #111a2b; --ps-text: #e5e7eb; --ps-muted: #94a3b8; --ps-border: #243247;
  --ps-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.pdfs-dark .pdfs-drop { background: #16233a; border-color: #2b4470; color: #c7d2fe; }
.pdfs-dark .pdfs-drop span { color: #93c5fd; }
.pdfs-dark .pdfs-file { background: #0f1728; }
.pdfs-dark .pdfs-file .pdfs-fico { background: #1b2942; }
.pdfs-dark .pdfs-tool:hover { background: #18243a; }
.pdfs-dark .pdfs-tool.is-active { background: #12233f; border-color: #2b4d82; color: #93c5fd; }
.pdfs-dark .pdfs-field input[type=text], .pdfs-dark .pdfs-field input[type=number], .pdfs-dark .pdfs-field input[type=password],
.pdfs-dark .pdfs-field select, .pdfs-dark .pdfs-field textarea, .pdfs-dark .pdfs-name, .pdfs-dark .pdfs-toolsearch input,
.pdfs-dark .pdfs-field input[type=color], .pdfs-dark .pdfs-thumb, .pdfs-dark .pdfs-sigbox { background: #0f1728; color: #e5e7eb; border-color: #243247; }
.pdfs-dark .pdfs-card { background: rgba(17,26,43,.8); border-color: #243247; }
.pdfs-dark .pdfs-card.is-info { background: #12233f; border-color: #2b4d82; }
.pdfs-dark .pdfs-card.is-error { background: #2a1416; border-color: #7f1d1d; }
.pdfs-dark .pdfs-card.is-warn { background: #2a2113; border-color: #92400e; }
.pdfs-dark .pdfs-pre { background: rgba(0,0,0,.25); }
.pdfs-dark .pdfs-btn { background: #16223a; color: #e5e7eb; border-color: #243247; }
.pdfs-dark .pdfs-btn:hover { background: #1b2a45; }
.pdfs-dark .pdfs-modal-box { background: #0f1728; }
.pdfs-dark .pdfs-chip { background: #1e2a44; color: #bfdbfe; }

.pdfs-logo-img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.pdfs-star { opacity: .35; font-size: 14px; padding: 0 2px; line-height: 1; }
.pdfs-star:hover { opacity: .9; }
.pdfs-star.is-on { opacity: 1; color: #f59e0b; }
.pdfs-presetbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 10px; border: 1px dashed var(--ps-border); border-radius: 10px; font-size: 11.5px; color: var(--ps-muted); }
.pdfs-presetbar select { padding: 6px 8px; border: 1px solid var(--ps-border); border-radius: 8px; background: #fff; color: var(--ps-text); font: inherit; font-size: 12px; min-width: 120px; }
.pdfs-dark .pdfs-presetbar select { background: #0f1728; }
.pdfs-name { width: 100%; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--ps-border); border-radius: 8px; background: #fff; color: var(--ps-text); font: inherit; font-size: 12.5px; }
.pdfs-name:focus { outline: none; border-color: var(--ps-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pdfs-thumb[draggable="true"] { cursor: grab; }
.pdfs-thumb[draggable="true"]:active { cursor: grabbing; }
.pdfs-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(2,6,23,.62); display: flex; align-items: center; justify-content: center; padding: 20px; }
.pdfs-modal-box { background: var(--ps-card); border: 1px solid var(--ps-border); border-radius: 14px; width: 100%; max-width: 900px; max-height: 90vh; overflow: auto; padding: 14px; box-shadow: var(--ps-shadow); }
.pdfs-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pdfs-modal-body { text-align: center; }
.pdfs-modal-body canvas { max-width: 100%; height: auto; display: block; margin: 0 auto; border: 1px solid var(--ps-border); border-radius: 8px; }
.pdfs-preview-canvas { cursor: crosshair; }

/* ---- v3 kullanım kolaylığı ---- */
.pdfs-tooltabs { display: flex; gap: 5px; overflow-x: auto; padding: 2px 0 6px; margin-top: 10px; scrollbar-width: thin; }
.pdfs-tab { flex: none; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--ps-border); background: #fff; color: var(--ps-text); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pdfs-tab.is-active { background: var(--ps-accent); border-color: var(--ps-accent); color: #fff; }
.pdfs-dark .pdfs-tab { background: #16223a; }
.pdfs-dark .pdfs-tab.is-active { background: var(--ps-accent); }
.pdfs-smart { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ps-muted); margin: 0 2px 6px; }
.pdfs-smart input { width: 14px; height: 14px; }
.pdfs-quick { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.pdfs-quick button { padding: 5px 9px; border-radius: 8px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; font-size: 11px; font-weight: 600; }
.pdfs-quick button:hover { background: #dbeafe; }
.pdfs-dark .pdfs-quick button { background: #12233f; border-color: #2b4d82; color: #93c5fd; }
.pdfs-fprev { border: none; background: transparent; color: #9ca3af; font-size: 14px; padding: 2px 3px; border-radius: 6px; }
.pdfs-fprev:hover { color: var(--ps-accent); background: #eff6ff; }
.pdfs-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.pdfs-toast { padding: 10px 13px; border-radius: 10px; color: #fff; font-size: 12.5px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); background: #111827; animation: pdfs-toast-in .2s ease-out; }
.pdfs-toast.is-error { background: #b91c1c; }
.pdfs-toast.is-ok { background: #15803d; }
.pdfs-toast.is-info { background: #1d4ed8; }
@keyframes pdfs-toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pdfs-next { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.pdfs-next span { font-size: 11px; color: var(--ps-muted); }
.pdfs-next button { padding: 5px 10px; border-radius: 20px; border: 1px solid var(--ps-border); background: #fff; font-size: 11px; font-weight: 600; }
.pdfs-dark .pdfs-next button { background: #16223a; }
.pdfs-wizard-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pdfs-wizard-chip { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--ps-border); background: #fff; font-size: 12.5px; font-weight: 600; text-align: left; }
.pdfs-wizard-chip:hover { border-color: var(--ps-accent); background: #eff6ff; }
.pdfs-dark .pdfs-wizard-chip { background: #16223a; }
.pdfs-ux-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.pdfs-ux-row label { font-size: 12px; font-weight: 600; }
.pdfs-ux-row input[type=range] { flex: 1; min-width: 120px; }
.pdfs-ux-modal-body { max-height: 70vh; overflow: auto; font-size: 13px; line-height: 1.55; }
.pdfs-history-list { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }
.pdfs-tour-step { padding: 10px 0; border-bottom: 1px solid var(--ps-border); }
.pdfs-tour-step b { display: block; margin-bottom: 3px; }
.pdfs-previewbar { display: flex; gap: 6px; align-items: center; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.pdfs-previewbar button, .pdfs-previewbar select { padding: 5px 9px; border-radius: 8px; border: 1px solid var(--ps-border); background: #fff; font-size: 11.5px; }
.pdfs-dark .pdfs-previewbar button, .pdfs-dark .pdfs-previewbar select { background: #16223a; color: #e5e7eb; }
.pdfs-preview-stage { overflow: auto; max-height: 62vh; text-align: center; background: #e5e7eb; border-radius: 8px; padding: 10px; }
.pdfs-preview-stage canvas { background: #fff; border: 1px solid #cbd5e1; cursor: crosshair; max-width: none; }
.pdfs-hc { --ps-border: #000 !important; --ps-text: #000 !important; --ps-muted: #333 !important; }
.pdfs-hc .pdfs-panel, .pdfs-hc .pdfs-card, .pdfs-hc .pdfs-file, .pdfs-hc .pdfs-thumb { border-width: 2px !important; }
.pdfs-app button:focus-visible, .pdfs-app input:focus-visible, .pdfs-app select:focus-visible, .pdfs-app textarea:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 2px; }
@media (max-width: 700px) {
  .pdfs-runbar { position: sticky; bottom: 0; background: var(--ps-card); padding: 10px; margin: 0 -4px; border-top: 1px solid var(--ps-border); z-index: 6; }
  .pdfs-tooltabs { position: sticky; top: 0; background: var(--ps-card); z-index: 4; }
  .pdfs-preview-stage { max-height: 52vh; }
}

/* v4.1: üst başlık kaldırıldı; eylem butonları ana alan araç çubuğunda */
.pdfs-toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 0 0 8px; border-bottom: 1px solid var(--ps-border); margin-bottom: 2px; }
@media (max-width: 700px) { .pdfs-toolbar { position: sticky; top: 0; background: var(--ps-card); z-index: 4; padding-top: 6px; } }
