/* Bildbearbeitung – Feuerwehr Hallbergmoos */
.page-tool .tool{width:min(1200px,100% - 32px);margin:26px auto 0;display:flex;flex-direction:column;gap:18px;flex:1 0 auto}
.tool-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:18px;align-items:start}
@media(max-width:920px){.tool-grid{grid-template-columns:1fr}}
.tool-card{padding:22px!important;margin:0}
.tool-head{display:flex;align-items:center;gap:12px;margin:0 0 16px;position:static!important;background:none!important;backdrop-filter:none!important;border:0!important;padding:0!important;box-shadow:none!important}
.tool-head::before,.tool-head::after{display:none!important}
.tool-head h2{margin:0!important;font-size:1.35rem!important}
.tool-head .btn{margin-left:auto}
.tool-num{flex:0 0 32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--ui-red);color:#fff;font-family:var(--ui-display);font-weight:700;font-size:1.1rem}
.tool-num.done{background:var(--ui-ok)}
.tool-meta{margin-left:auto;font-size:.85rem;color:var(--ui-muted);font-weight:600}
.muted-note{color:var(--ui-muted);font-size:.8rem;font-weight:400}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important}

/* Dropzone */
.page-tool .dropzone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:30px 18px;border:2px dashed var(--ui-line-strong);border-radius:16px;background:var(--ui-surface-2);cursor:pointer;text-align:center;transition:border-color .15s,background-color .15s}
.page-tool .dropzone:hover,.page-tool .dropzone.dragover{border-color:var(--ui-red);background:var(--ui-red-soft)}
.page-tool .dropzone:focus-within{box-shadow:var(--ui-focus);border-color:var(--ui-red)}
.page-tool .dropzone input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%;padding:0!important;border:0!important}
.page-tool .dropzone.has-files{flex-direction:row;padding:14px;gap:12px}
.page-tool .dz-icon{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;background:var(--ui-red);color:#fff}
.page-tool .dropzone.has-files .dz-icon{width:38px;height:38px}
.page-tool .dz-icon svg{width:55%;height:55%}
.page-tool .dz-title{font-weight:700;color:var(--ui-ink)}
.page-tool .dz-or{font-weight:500;color:var(--ui-muted)}
.page-tool .dz-hint{font-size:.82rem;color:var(--ui-muted)}
@media(hover:none){.page-tool .dz-or{display:none}}

/* Thumbnails */
.thumbs{list-style:none;margin:14px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px}
.thumbs:empty{display:none}
.thumb{position:relative;display:flex;flex-direction:column;gap:4px}
.thumb-select{padding:0;border:2px solid transparent;border-radius:10px;overflow:hidden;cursor:pointer;background:var(--ui-surface-2);display:block;aspect-ratio:1}
.thumb-select img{width:100%;height:100%;object-fit:cover;display:block}
.thumb.active .thumb-select{border-color:var(--ui-red);box-shadow:0 0 0 3px var(--ui-red-soft)}
.thumb-select:focus-visible{outline:none;box-shadow:var(--ui-focus)}
.thumb-name{font-size:.72rem;color:var(--ui-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thumb-remove{position:absolute;top:6px;right:6px;width:26px;height:26px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff;cursor:pointer;font-size:.8rem;display:grid;place-items:center;opacity:.85}
.thumb-remove:hover{background:var(--ui-bad);opacity:1}
.thumbs-actions{display:flex;justify-content:space-between;align-items:center;margin-top:12px}
.thumbs-actions[hidden]{display:none}
.ghost-btn{border:1px solid var(--ui-line-strong);background:transparent;color:var(--ui-ink-2);border-radius:99px;padding:7px 14px;font:inherit;font-size:.85rem;font-weight:600;cursor:pointer;text-decoration:none}
.ghost-btn:hover{color:var(--ui-red);border-color:var(--ui-red)}
.link-btn{background:none;border:0;padding:0;margin-top:8px;font:inherit;font-size:.85rem;font-weight:600;color:var(--ui-red);cursor:pointer;text-decoration:underline}

/* Einstellungen */
fieldset.group{border:0;margin:0 0 6px;padding:0 0 16px;border-bottom:1px solid var(--ui-line)}
fieldset.group:last-of-type{border-bottom:0;padding-bottom:0}
fieldset.group + fieldset.group{padding-top:14px}
fieldset.group legend{padding:0;margin:0 0 10px;font-family:var(--ui-display);font-weight:700;text-transform:uppercase;font-size:1.05rem;letter-spacing:.03em;color:var(--ui-ink)}
.page-tool .label{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin:12px 0 6px;font-weight:600;font-size:.88rem}
.page-tool input[type=text],.page-tool input[type=number],.page-tool select{width:100%}
.sub[hidden]{display:none}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.presets{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
.preset{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:12px;border:1.5px solid var(--ui-line-strong);border-radius:12px;background:var(--ui-surface-2);cursor:pointer;transition:border-color .12s,background-color .12s;font-weight:400!important}
.preset:hover{border-color:var(--ui-red)}
.preset input{position:absolute;opacity:0;width:1px;height:1px}
.preset:has(input:checked){border-color:var(--ui-red);background:var(--ui-red-soft)}
.preset:has(input:focus-visible){box-shadow:var(--ui-focus)}
.preset strong{font-size:.92rem;color:var(--ui-ink)}
.preset small{font-size:.74rem;color:var(--ui-muted)}
.pv{display:block;border:2px solid var(--ui-ink-2);border-radius:3px;margin-bottom:8px;height:26px}
.pv.r45{width:21px}.pv.r11{width:26px}.pv.r916{width:15px}.pv.rfree{width:34px;border-style:dashed}.pv.rcustom{width:30px;border-style:dotted}
.preset:has(input:checked) .pv{border-color:var(--ui-red);background:rgba(196,30,36,.12)}
.crop-grid,.wm-pos{display:grid;gap:6px}
.crop-grid{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,34px)}
.wm-pos{grid-template-columns:repeat(3,44px);grid-template-rows:34px 34px;grid-template-areas:"tl . tr" "bl bc br"}
.wm-pos label:nth-child(1){grid-area:tl}.wm-pos label:nth-child(2){grid-area:tr}.wm-pos label:nth-child(3){grid-area:bl}.wm-pos label:nth-child(4){grid-area:bc}.wm-pos label:nth-child(5){grid-area:br}
.crop-grid label,.wm-pos label{position:relative;cursor:pointer;margin:0!important}
.crop-grid input,.wm-pos input{position:absolute;opacity:0;width:1px;height:1px}
.crop-grid span,.wm-pos span{display:block;width:100%;height:100%;border:1.5px solid var(--ui-line-strong);border-radius:7px;background:var(--ui-surface-2);transition:background-color .12s,border-color .12s}
.crop-grid label:hover span,.wm-pos label:hover span{border-color:var(--ui-red)}
.crop-grid input:checked + span,.wm-pos input:checked + span{background:var(--ui-red);border-color:var(--ui-red)}
.crop-grid input:focus-visible + span,.wm-pos input:focus-visible + span{box-shadow:var(--ui-focus)}
.slider output{font-weight:700;color:var(--ui-red);font-variant-numeric:tabular-nums}
.slider input[type=range]{width:100%;accent-color:var(--ui-red);margin:0}
details.more{margin-top:12px}
details.more summary{cursor:pointer;font-weight:600;font-size:.88rem;color:var(--ui-ink-2)}
details.more input[type=file]{margin-top:10px;font:inherit;font-size:.85rem;width:100%}
.page-tool .depends.is-off{opacity:.4;pointer-events:none}
.page-tool .depends.is-off::before{content:none}

/* Vorschau */
.preview-card{position:sticky;top:96px}
@media(max-width:920px){.preview-card{position:static}}
.preview-stage{position:relative;display:grid;place-items:center;min-height:300px;max-height:62vh;border-radius:14px;padding:14px;
  background:repeating-conic-gradient(var(--ui-surface-2) 0% 25%,var(--ui-surface) 0% 50%) 0 0/22px 22px;border:1px solid var(--ui-line);overflow:hidden}
.preview-stage canvas{max-width:100%;max-height:calc(62vh - 28px);width:auto;height:auto;border-radius:6px;box-shadow:0 10px 30px -10px rgba(0,0,0,.5)}
.preview-stage.croppable canvas{cursor:crosshair}
.preview-empty{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--ui-muted);text-align:center;font-size:.9rem;max-width:240px}
.preview-empty svg{width:42px;height:42px}
.actions{display:flex;flex-direction:column;gap:10px;margin-top:16px}
.btn-xl{display:inline-flex!important;align-items:center;justify-content:center;gap:10px;padding:15px 22px!important;font-size:1.05rem!important;border-radius:13px!important}
.btn-xl svg{width:21px;height:21px}
.btn:disabled{opacity:.6;cursor:wait}
.progress{position:relative;margin-top:12px;height:34px;border-radius:10px;background:var(--ui-surface-2);border:1px solid var(--ui-line);overflow:hidden;display:grid;place-items:center}
.progress[hidden]{display:none}
.progress-bar{position:absolute;inset:0 auto 0 0;width:0;background:linear-gradient(90deg,var(--ui-red),#ff5a3c);opacity:.3;transition:width .2s}
.progress span{position:relative;font-size:.85rem;font-weight:600;color:var(--ui-ink)}

/* Ergebnisse */
.results-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.results-grid li{border:1px solid var(--ui-line);border-radius:12px;overflow:hidden;background:var(--ui-surface-2)}
.results-grid img{display:block;width:100%;aspect-ratio:4/5;object-fit:contain;background:#000}
.res-row{display:flex;gap:6px;padding:10px;flex-wrap:wrap}
.res-row .btn{flex:1;padding:8px 10px!important;font-size:.85rem;text-align:center;text-decoration:none}
