/* PDF-Werkzeuge – Oberfläche der Werkzeuge */
.pdfw {
  --pdfw-a: var(--pdfw-accent, #e0443e);
  --pdfw-a-dark: color-mix(in srgb, var(--pdfw-a) 78%, #000);
  --pdfw-a-soft: color-mix(in srgb, var(--pdfw-a) 9%, #fff);
  --pdfw-a-line: color-mix(in srgb, var(--pdfw-a) 30%, #fff);
  --pdfw-ink: #1f2430; --pdfw-muted2: #646b78; --pdfw-line2: #e6e1e0; --pdfw-bg2: #faf8f7;
  --pdfw-r: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--pdfw-ink);
  line-height: 1.5;
}
.pdfw *, .pdfw *::before, .pdfw *::after { box-sizing: border-box; }
.pdfw-hidden { display: none !important; }
.pdfw-muted { color: var(--pdfw-muted2); font-size: 14px; margin: 8px 0; }

/* Werkzeug-Kasten */
.pdfw-tool {
  background: #fff; border: 1px solid var(--pdfw-line2); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(30, 20, 20, .05), 0 16px 40px rgba(30, 20, 20, .09);
  padding: clamp(16px, 3vw, 28px); margin: 0 auto 40px; max-width: 1080px;
}
.pdfw-boot { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 220px; color: var(--pdfw-muted2); }
.pdfw-spinner { width: 20px; height: 20px; border: 3px solid var(--pdfw-a-soft); border-top-color: var(--pdfw-a); border-radius: 50%; animation: pdfw-spin .8s linear infinite; }
@keyframes pdfw-spin { to { transform: rotate(360deg); } }

/* Ablagefläche */
.pdfw-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 260px; padding: 28px; text-align: center; cursor: pointer;
  border: 2px dashed var(--pdfw-a-line); border-radius: var(--pdfw-r); background: var(--pdfw-a-soft);
  transition: background .15s, border-color .15s;
}
.pdfw-drop:hover, .pdfw-drop:focus-visible, .pdfw-drop.is-over { background: color-mix(in srgb, var(--pdfw-a) 15%, #fff); border-color: var(--pdfw-a); outline: none; }
.pdfw-drop-ico { color: var(--pdfw-a); }
.pdfw-drop-hint { color: var(--pdfw-muted2); font-size: 15px; }
.pdfw-drop-safe { display: inline-flex; align-items: center; gap: 6px; color: var(--pdfw-muted2); font-size: 13px; margin-top: 4px; }
.pdfw-drop-compact { min-height: 0; padding: 14px; flex-direction: row; flex-wrap: wrap; margin: 12px 0; }
.pdfw-drop-compact .pdfw-btn-lg { padding: 10px 18px; font-size: 15px; }
.pdfw-i { display: inline-flex; vertical-align: middle; }

/* Buttons */
.pdfw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 11px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap;
}
.pdfw-btn:active { transform: translateY(1px); }
.pdfw-btn:disabled { opacity: .5; cursor: not-allowed; }
.pdfw-btn-primary { background: var(--pdfw-a); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--pdfw-a) 30%, transparent); }
.pdfw-btn-primary:hover:not(:disabled) { background: var(--pdfw-a-dark); color: #fff; }
.pdfw-btn-ghost { background: #fff; color: var(--pdfw-ink); border-color: var(--pdfw-line2); }
.pdfw-btn-ghost:hover:not(:disabled) { border-color: var(--pdfw-a); color: var(--pdfw-a-dark); }
.pdfw-btn-danger { background: #fff; color: #b42318; border-color: #f3c7c3; }
.pdfw-btn-link { background: none; border: 0; color: var(--pdfw-a-dark); padding: 8px 6px; text-decoration: underline; font-weight: 550; }
.pdfw-btn-lg { padding: 14px 26px; font-size: 17px; border-radius: 13px; }
.pdfw-btn-sm { padding: 6px 12px; font-size: 14px; }
.pdfw-btn-block { width: 100%; }
.pdfw-dl-size { font-weight: 500; opacity: .8; font-size: .85em; margin-left: 4px; }
.pdfw-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.pdfw-actions-center { justify-content: center; }
.pdfw-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--pdfw-line2); background: #fff; border-radius: 9px; cursor: pointer; color: var(--pdfw-ink); font-size: 15px; padding: 0; }
.pdfw-icon-btn:hover:not(:disabled) { border-color: var(--pdfw-a); color: var(--pdfw-a); }
.pdfw-icon-btn:disabled { opacity: .35; cursor: default; }
.pdfw-icon-btn.is-on { background: #fde8e7; border-color: #f3b5b1; color: #b42318; }

/* Panel & Felder */
.pdfw-panel-title { font-size: 17px; margin: 18px 0 10px; font-weight: 700; }
.pdfw-filehead { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--pdfw-line2); border-radius: 12px; background: var(--pdfw-bg2); margin-bottom: 8px; }
.pdfw-filehead-ico { flex: none; display: grid; place-items: center; width: 42px; height: 48px; border-radius: 8px; background: var(--pdfw-a); color: #fff; font-weight: 800; font-size: 12px; }
.pdfw-filehead-main { display: flex; flex-direction: column; min-width: 0; }
.pdfw-filehead-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdfw-filehead-main span { font-size: 13px; color: var(--pdfw-muted2); }
.pdfw-field { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; min-width: 0; }
.pdfw-field-label { font-size: 13.5px; font-weight: 650; color: #3a3f4b; }
.pdfw-field-hint { font-size: 12.5px; color: var(--pdfw-muted2); }
.pdfw-input {
  width: 100%; padding: 10px 12px; border: 1px solid #d9d4d3; border-radius: 10px; background: #fff;
  font: inherit; font-size: 15px; color: var(--pdfw-ink); min-height: 42px;
}
textarea.pdfw-input { resize: vertical; min-height: 64px; line-height: 1.45; }
.pdfw-input:focus { outline: 2px solid color-mix(in srgb, var(--pdfw-a) 35%, transparent); border-color: var(--pdfw-a); }
.pdfw-input-sm { width: auto; min-height: 34px; padding: 5px 9px; font-size: 14px; border-radius: 8px; }
.pdfw-input-num { width: 70px; }
.pdfw-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.pdfw-span2 { grid-column: 1 / -1; }
.pdfw-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.pdfw-row .pdfw-field { flex: 1 1 240px; }
.pdfw-row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.pdfw-check { display: flex; align-items: center; gap: 9px; margin: 10px 0; font-size: 15px; cursor: pointer; }
.pdfw-check input { width: 18px; height: 18px; accent-color: var(--pdfw-a); }
.pdfw-check-sm { font-size: 13.5px; margin: 6px 0; }
.pdfw-checks { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.pdfw-note { padding: 12px 14px; border-radius: 10px; background: #eef6ff; border: 1px solid #cfe3fb; color: #17406b; margin: 10px 0; }
.pdfw-opt-detail { margin-top: 6px; }

/* Segmente */
.pdfw-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 6px 0; }
.pdfw-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pdfw-seg label { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--pdfw-line2); border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.pdfw-seg label:hover { border-color: var(--pdfw-a-line); }
.pdfw-seg input:checked + label { border-color: var(--pdfw-a); background: var(--pdfw-a-soft); box-shadow: inset 0 0 0 1px var(--pdfw-a); }
.pdfw-seg input:focus-visible + label { outline: 2px solid var(--pdfw-a); outline-offset: 2px; }
.pdfw-seg-label { font-weight: 700; font-size: 15px; }
.pdfw-seg-hint { font-size: 12.5px; color: var(--pdfw-muted2); }

/* Dateiliste */
.pdfw-files { display: flex; flex-direction: column; gap: 8px; }
.pdfw-file { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border: 1px solid var(--pdfw-line2); border-radius: 11px; background: #fff; }
.pdfw-file.is-drag { opacity: .5; }
.pdfw-file.is-target { border-color: var(--pdfw-a); }
.pdfw-file-grip { color: #a7a2a1; cursor: grab; display: inline-flex; }
.pdfw-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.pdfw-file-size { color: var(--pdfw-muted2); font-size: 13px; white-space: nowrap; }
.pdfw-file-move { display: inline-flex; gap: 4px; }

/* Vorschaubilder */
.pdfw-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; margin: 14px 0; }
.pdfw-thumb { position: relative; border: 2px solid transparent; border-radius: 12px; padding: 8px 8px 26px; background: var(--pdfw-bg2); cursor: pointer; transition: border-color .15s, transform .15s; user-select: none; }
.pdfw-thumb:hover { border-color: var(--pdfw-a-line); }
.pdfw-thumb.is-selected { border-color: var(--pdfw-a); background: var(--pdfw-a-soft); }
.pdfw-thumb.is-deleted .pdfw-thumb-frame { opacity: .25; }
.pdfw-thumb.is-deleted::after { content: "wird gelöscht"; position: absolute; left: 50%; top: 42%; transform: translateX(-50%); background: #b42318; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.pdfw-thumb.is-drag { opacity: .4; }
.pdfw-thumb.is-target { border-color: var(--pdfw-a); transform: scale(1.02); }
.pdfw-thumb-frame { aspect-ratio: 1 / 1.3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pdfw-thumb-img { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; transition: transform .2s; }
.pdfw-thumb-canvas { max-width: 100%; max-height: 100%; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); background: #fff; }
.pdfw-thumb-num { position: absolute; left: 0; right: 0; bottom: 5px; text-align: center; font-size: 13px; font-weight: 650; color: var(--pdfw-muted2); }
.pdfw-thumb-check { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--pdfw-line2); display: grid; place-items: center; color: transparent; }
.pdfw-thumb-check svg { width: 16px; height: 16px; }
.pdfw-thumb.is-selected .pdfw-thumb-check { background: var(--pdfw-a); border-color: var(--pdfw-a); color: #fff; }
.pdfw-thumb-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.pdfw-thumb:hover .pdfw-thumb-tools, .pdfw-thumb:focus-within .pdfw-thumb-tools { opacity: 1; }
@media (hover: none) { .pdfw-thumb-tools { opacity: 1; } }
.pdfw-thumbs.is-organize .pdfw-thumb { cursor: grab; }
.pdfw-sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 0 4px; background: linear-gradient(transparent, #fff 30%); }

/* Fortschritt, Fehler */
.pdfw-progress-wrap { margin: 26px auto; max-width: 520px; text-align: center; }
.pdfw-progress { height: 10px; background: var(--pdfw-a-soft); border-radius: 99px; overflow: hidden; }
.pdfw-progress-bar { height: 100%; width: 2%; background: linear-gradient(90deg, var(--pdfw-a), color-mix(in srgb, var(--pdfw-a) 70%, #ffb199)); border-radius: 99px; transition: width .25s; }
.pdfw-status { margin-top: 10px; color: var(--pdfw-muted2); font-size: 15px; }
.pdfw-error { margin: 16px 0; padding: 14px 16px; border-radius: 12px; background: #fff3f2; border: 1px solid #f6c9c5; color: #8a1c13; }

/* Ergebnis */
.pdfw-result { text-align: center; padding: 10px 0; }
.pdfw-result-head { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pdfw-result-ok { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: #e8f7ee; color: #14833b; }
.pdfw-result-head h3 { margin: 0; font-size: 24px; }
.pdfw-result-note { margin: 4px 0 0; color: var(--pdfw-muted2); }
.pdfw-dls { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 22px 0; }
.pdfw-dl-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-height: 220px; overflow: auto; }
.pdfw-next { margin: 22px auto 6px; max-width: 760px; padding-top: 18px; border-top: 1px solid var(--pdfw-line2); }
.pdfw-next-title { font-weight: 700; margin: 0 0 10px; }
.pdfw-next-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pdfw-next-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--pdfw-line2); background: #fff; color: var(--pdfw-ink) !important; text-decoration: none; font-weight: 600; font-size: 15px; }
.pdfw-next-btn:hover { border-color: var(--pdfw-a); color: var(--pdfw-a-dark) !important; background: var(--pdfw-a-soft); }
.pdfw-details { text-align: left; margin: 14px auto; max-width: 820px; }
.pdfw-details summary { cursor: pointer; font-weight: 650; }
.pdfw-pre { white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto; background: var(--pdfw-bg2); border: 1px solid var(--pdfw-line2); border-radius: 10px; padding: 14px; font-size: 13.5px; }
.pdfw-img-preview { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px 0; }
.pdfw-img-preview img { height: 140px; width: auto; border: 1px solid var(--pdfw-line2); border-radius: 6px; }

/* Pipeline */
.pdfw-steps { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; counter-reset: s; }
.pdfw-step { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; border: 1.5px solid var(--pdfw-line2); border-radius: 12px; background: #fff; }
.pdfw-step.is-on { border-color: var(--pdfw-a); background: var(--pdfw-a-soft); }
.pdfw-step-main { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 260px; cursor: pointer; }
.pdfw-step-main input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--pdfw-a); }
.pdfw-step-main > span { display: flex; flex-direction: column; }
.pdfw-step-desc { font-size: 13px; color: var(--pdfw-muted2); }
.pdfw-step-extra { flex: 0 1 220px; }

/* Dialog, Hinweis */
.pdfw-modal-back { position: fixed; inset: 0; z-index: 100000; background: rgba(20, 15, 15, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pdfw-modal { background: #fff; border-radius: 16px; width: min(480px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.pdfw-modal-wide { width: min(760px, 100%); }
.pdfw-modal-progress { padding: 10px 24px; }
.pdfw-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.pdfw-modal-head h3 { margin: 0; font-size: 19px; }
.pdfw-x { border: 0; background: none; cursor: pointer; padding: 6px; color: var(--pdfw-muted2); }
.pdfw-modal-body { padding: 12px 20px; }
.pdfw-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 20px 18px; }
.pdfw-toast { position: fixed; left: 50%; bottom: 24px; z-index: 100001; transform: translate(-50%, 20px); opacity: 0; transition: all .25s; background: #241c1c; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; max-width: min(560px, 92vw); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.pdfw-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.pdfw-toast-error { background: #b42318; }

/* Karten / Raster / Verlinkung */
.pdfw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pdfw-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--pdfw-line2); border-radius: var(--pdfw-r); background: #fff; color: var(--pdfw-ink) !important; text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.pdfw-card:hover { transform: translateY(-2px); border-color: var(--pdfw-a-line); box-shadow: 0 10px 26px rgba(30, 20, 20, .08); }
.pdfw-card-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--pdfw-a-soft); color: var(--pdfw-a); }
.pdfw-card-title { font-weight: 750; font-size: 16.5px; }
.pdfw-card-desc { font-size: 14px; color: var(--pdfw-muted2); line-height: 1.45; }
.pdfw-group { margin: 0 0 30px; }
.pdfw-group-title { font-size: 20px; margin: 0 0 12px; }
.pdfw-group-title a { color: inherit; text-decoration: none; }
.pdfw-hub { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pdfw-hub-variants { list-style: none; margin: 8px 0 0; padding: 0 4px; font-size: 14px; }
.pdfw-hub-variants li { margin: 4px 0; }
.pdfw-related { max-width: 1080px; margin: 50px auto 10px; padding-top: 30px; border-top: 1px solid var(--pdfw-line2); }
.pdfw-related-title { font-size: 24px; margin: 0 0 16px; }
.pdfw-related-sub { font-size: 17px; margin: 26px 0 10px; }
.pdfw-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pdfw-chips a { display: inline-block; padding: 7px 13px; border-radius: 99px; background: var(--pdfw-a-soft); color: var(--pdfw-a-dark); text-decoration: none; font-size: 14px; font-weight: 600; }
.pdfw-chips a:hover { background: color-mix(in srgb, var(--pdfw-a) 16%, #fff); }
.pdfw-related-links { margin-top: 20px; font-size: 15px; }
.pdfw-verzeichnis { columns: 3 260px; column-gap: 32px; }
.pdfw-verzeichnis section { break-inside: avoid; margin-bottom: 22px; }
.pdfw-verzeichnis h3 { margin: 0 0 8px; font-size: 18px; }
.pdfw-verzeichnis ul { margin: 0; padding-left: 18px; }

/* ================= Editor ================= */
.pdfw-ed { position: relative; margin: -8px; }
.pdfw-ed-bar { position: sticky; top: 0; z-index: 20; display: flex; gap: 2px; align-items: stretch; overflow-x: auto; padding: 6px; background: #fff; border: 1px solid var(--pdfw-line2); border-radius: 14px; box-shadow: 0 4px 14px rgba(30, 20, 20, .06); scrollbar-width: thin; }
.admin-bar .pdfw-ed-bar, .pdfw-site .pdfw-ed-bar { top: 70px; }
.pdfw-ed-tool { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 64px; padding: 6px 6px 5px; border: 0; border-radius: 10px; background: none; color: #3a3f4b; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.pdfw-ed-tool:hover { background: var(--pdfw-bg2); color: var(--pdfw-ink); }
.pdfw-ed-tool.is-active { background: var(--pdfw-a-soft); color: var(--pdfw-a-dark); box-shadow: inset 0 0 0 1.5px var(--pdfw-a); }
.pdfw-ed-tool:disabled { opacity: .35; }
.pdfw-ed-mini { min-width: 40px; }
.pdfw-ed-sep { flex: none; width: 1px; background: var(--pdfw-line2); margin: 6px 4px; }
.pdfw-ed-props { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 6px 0; min-height: 44px; }
.pdfw-ed-props.is-empty { min-height: 0; padding: 0; }
.pdfw-ed-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 8px; font-size: 14px; color: var(--pdfw-muted2); }
.pdfw-ed-search { display: flex; gap: 8px; flex-wrap: wrap; }
.pdfw-swatches { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pdfw-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfc9c8; cursor: pointer; padding: 0; }
.pdfw-swatch.is-on { box-shadow: 0 0 0 2px var(--pdfw-a); }
.pdfw-swatch-pick { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.pdfw-tbtn { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--pdfw-line2); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; font-size: 14px; }
.pdfw-tbtn.is-on, .pdfw-tbtn:hover { border-color: var(--pdfw-a); color: var(--pdfw-a-dark); }
.pdfw-ed-pages { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 18px 12px 30px; background: #f1edec; border-radius: 14px; overflow-x: auto; min-height: 300px; }
.pdfw-ed-page { position: relative; flex: none; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .14); }
.pdfw-ed-canvas { position: absolute; inset: 0; display: block; }
.pdfw-ed-layer, .pdfw-ed-lines, .pdfw-ed-forms { position: absolute; inset: 0; }
/* Die Objekt-Ebene liegt oben, darf aber Klicks nicht abfangen – nur die Objekte selbst sind anklickbar. */
.pdfw-ed-layer { pointer-events: none; }
.pdfw-ed-layer > .pdfw-obj { pointer-events: auto; }
.pdfw-ed-lines { pointer-events: none; }
.pdfw-ed-lines > * { pointer-events: auto; }
.pdfw-ed-forms { pointer-events: none; }
.pdfw-ed-forms > * { pointer-events: auto; }
.pdfw-ed-pnum { position: absolute; bottom: -19px; right: 0; font-size: 12px; color: #8b8584; }
.pdfw-ed[data-tool="text"] .pdfw-ed-page, .pdfw-ed[data-tool="image"] .pdfw-ed-page { cursor: text; }
.pdfw-ed[data-tool="image"] .pdfw-ed-page, .pdfw-ed[data-tool="check"] .pdfw-ed-page, .pdfw-ed[data-tool="cross"] .pdfw-ed-page { cursor: copy; }
.pdfw-ed[data-tool="draw"] .pdfw-ed-page, .pdfw-ed[data-tool="rect"] .pdfw-ed-page, .pdfw-ed[data-tool="ellipse"] .pdfw-ed-page, .pdfw-ed[data-tool="line"] .pdfw-ed-page,
.pdfw-ed[data-tool="arrow"] .pdfw-ed-page, .pdfw-ed[data-tool="highlight"] .pdfw-ed-page, .pdfw-ed[data-tool="whiteout"] .pdfw-ed-page, .pdfw-ed[data-tool="redact"] .pdfw-ed-page { cursor: crosshair; touch-action: none; }
.pdfw-ed:not([data-tool="select"]) .pdfw-obj { pointer-events: none; }
.pdfw-obj { position: absolute; touch-action: none; }
.pdfw-ed[data-tool="select"] .pdfw-obj { cursor: move; }
.pdfw-obj.is-sel { outline: 1.5px dashed var(--pdfw-a); outline-offset: 2px; }
.pdfw-obj img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.pdfw-obj svg { display: block; pointer-events: none; }
.pdfw-obj-text { white-space: pre-wrap; word-wrap: break-word; line-height: 1.25; min-height: 1.25em; outline: none; }
.pdfw-obj.is-editing { outline: 1.5px solid var(--pdfw-a); background: rgba(255, 255, 255, .6); cursor: text; }
.pdfw-obj-text:empty::before { content: "Text eingeben …"; color: #aaa; }
.pdfw-obj-redact { background: #000; outline: 2px solid rgba(224, 68, 62, .9); outline-offset: -1px; }
.pdfw-obj-redact::after { content: "wird entfernt"; position: absolute; right: 2px; bottom: 100%; font-size: 10px; color: #b42318; background: #fff; padding: 0 3px; border-radius: 3px; white-space: nowrap; }
.pdfw-handle { display: none; position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: #fff; border: 2px solid var(--pdfw-a); border-radius: 4px; cursor: nwse-resize; }
.pdfw-obj.is-sel .pdfw-handle { display: block; }
.pdfw-drag-preview { position: absolute; border: 1.5px dashed var(--pdfw-a); background: rgba(224, 68, 62, .08); pointer-events: none; }
.pdfw-drag-redact { background: rgba(0, 0, 0, .7); }
.pdfw-drag-whiteout { background: rgba(255, 255, 255, .9); }
.pdfw-drag-highlight { opacity: .45; border: 0; }
.pdfw-draw-preview { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pdfw-tline { position: absolute; border: 1px dashed rgba(31, 111, 235, .35); border-radius: 2px; cursor: text; }
.pdfw-tline:hover { background: rgba(31, 111, 235, .1); border-color: rgba(31, 111, 235, .8); }
.pdfw-tline.is-edited { border-color: rgba(20, 131, 59, .7); }
.pdfw-tedit { position: absolute; z-index: 5; padding: 0 2px; border: 2px solid #1f6feb; border-radius: 3px; outline: none; box-shadow: 0 4px 14px rgba(31, 111, 235, .3); line-height: 1; }
.pdfw-tpatch { position: absolute; white-space: pre; pointer-events: none; padding: 0; overflow: visible; }
.pdfw-ff { position: absolute; border: 1px solid rgba(31, 111, 235, .45); background: rgba(219, 234, 254, .55); border-radius: 2px; padding: 0 3px; font: inherit; color: #111; }
.pdfw-ff:focus { outline: 2px solid #1f6feb; background: rgba(255, 255, 255, .95); }
textarea.pdfw-ff { resize: none; line-height: 1.2; }
.pdfw-ff-check { margin: 0; accent-color: #1f6feb; }
.pdfw-ed-foot { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 8px; margin-top: 10px; background: rgba(255, 255, 255, .95); border-top: 1px solid var(--pdfw-line2); backdrop-filter: blur(6px); }
.pdfw-ed-file { margin-right: auto; font-size: 13.5px; color: var(--pdfw-muted2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
@media (max-width: 640px) {
  .pdfw-ed-tool { min-width: 54px; font-size: 10.5px; }
  .pdfw-ed-file { display: none; }
  .pdfw-ed-pages { padding: 10px 4px 20px; }
}

/* Unterschrift */
.pdfw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--pdfw-line2); margin-bottom: 12px; }
.pdfw-tab { border: 0; background: none; padding: 9px 14px; font: inherit; font-weight: 650; color: var(--pdfw-muted2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pdfw-tab.is-on { color: var(--pdfw-a-dark); border-bottom-color: var(--pdfw-a); }
.pdfw-sig-pad { width: 100%; aspect-ratio: 1000 / 340; border: 1.5px dashed #cfc9c8; border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.pdfw-sig-typed { font-size: 18px; margin-bottom: 10px; }
.pdfw-sig-fonts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.pdfw-sig-font { padding: 14px; border: 1.5px solid var(--pdfw-line2); border-radius: 12px; background: #fff; font-size: 30px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pdfw-sig-font.is-on { border-color: var(--pdfw-a); background: var(--pdfw-a-soft); }
.pdfw-sig-upprev { max-width: 100%; max-height: 140px; display: block; margin-top: 10px; }
.pdfw-sig-saved { display: flex; flex-wrap: wrap; gap: 10px; }
.pdfw-sig-choice { padding: 10px; border: 1.5px solid var(--pdfw-line2); border-radius: 12px; background: #fff; cursor: pointer; }
.pdfw-sig-choice:hover { border-color: var(--pdfw-a); }
.pdfw-sig-choice img { height: 60px; width: auto; display: block; }

/* ================= Erstellen ================= */
.pdfw-cr { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 26px; align-items: start; }
@media (max-width: 860px) { .pdfw-cr { grid-template-columns: 1fr; } }
.pdfw-cr-sec { border: 1px solid var(--pdfw-line2); border-radius: 13px; padding: 4px 16px 10px; margin-bottom: 12px; background: #fff; }
.pdfw-cr-sec > summary { cursor: pointer; font-weight: 750; font-size: 16px; padding: 10px 0 6px; }
.pdfw-cr-sticky { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.pdfw-cr-pages { display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow: auto; padding: 12px; background: #f1edec; border-radius: 13px; }
.pdfw-cr-page { width: 100%; height: auto; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.pdfw-cr-empty { padding: 60px 10px; text-align: center; color: var(--pdfw-muted2); }
.pdfw-cr-status { text-align: center; font-size: 13px; }
.pdfw-cr-img { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pdfw-cr-img .pdfw-input { flex: 1 1 200px; }
.pdfw-cr-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--pdfw-line2); }
.pdfw-cr-totals { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--pdfw-a-soft); font-weight: 700; text-align: right; }
.pdfw-repeat { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pdfw-entry { position: relative; width: 100%; border: 1px dashed #d9d4d3; border-radius: 11px; padding: 6px 12px 4px; background: var(--pdfw-bg2); }
.pdfw-entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.pdfw-entry-tools { display: flex; justify-content: flex-end; gap: 6px; padding-bottom: 6px; }
.pdfw-rte-wrap { border: 1px solid #d9d4d3; border-radius: 10px; overflow: hidden; background: #fff; }
.pdfw-rte-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-bottom: 1px solid var(--pdfw-line2); background: var(--pdfw-bg2); }
.pdfw-rte { min-height: 260px; padding: 14px 16px; outline: none; font-size: 15.5px; line-height: 1.6; }
.pdfw-rte h2 { font-size: 22px; margin: .6em 0 .3em; }
.pdfw-rte h3 { font-size: 18px; margin: .6em 0 .3em; }
.pdfw-rte p { margin: 0 0 .7em; }
