[hidden] { display: none !important; }
/* Nur das, was Bootstrap nicht mitbringt: Mobile-Spalte, Lader, Raster, fixe Leiste */
.app { min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 14px 16px calc(110px + env(safe-area-inset-bottom)); }
.app.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

.loader { position: fixed; inset: 0; z-index: 2000; display: none; place-items: center; background: var(--bs-body-bg); }
body.loading .loader, body.busy .loader { display: grid; }
body.busy .loader { background: rgba(var(--bs-body-bg-rgb), .8); }
body.loading > :not(.loader) { visibility: hidden; }

.sticky-nav { position: sticky; top: 0; z-index: 5; padding: 6px 0; }

.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; z-index: 10;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--rb-app, var(--bs-body-bg)); }
.toast-pos { z-index: 1100; transition: bottom .15s ease-out; }   /* Höhe setzt placeToasts() */

/* Upload-Liste */
.thumb { flex: none; width: 48px; height: 48px; border-radius: var(--bs-border-radius); background: var(--bs-secondary-bg) center/cover no-repeat;
  display: grid; place-items: center; color: var(--bs-secondary-color); position: relative; overflow: hidden; }
.min-w-0 { min-width: 0; }
.progress.thin { height: 4px; }

/* Einsortieren */
.tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; width: 100%; border-radius: var(--bs-border-radius);
  background: var(--bs-secondary-bg) center/cover no-repeat; display: grid; place-items: center; color: var(--bs-secondary-color); overflow: hidden; }
.tile .ck { position: absolute; right: 5px; top: 5px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  background: rgba(0, 0, 0, .25); display: grid; place-items: center; color: #fff; font-size: .8rem; }
.tile .cap { position: absolute; left: 5px; top: 4px; color: #fff; text-shadow: 0 0 3px #000; font-size: .8rem; }
.tile.on { outline: 3px solid var(--bs-primary); outline-offset: -3px; }
.tile.on .ck { background: var(--bs-primary); border-color: var(--bs-primary); }
.text-thumbs-item { width: 44px; height: 44px; border-radius: var(--bs-border-radius); background: var(--bs-secondary-bg) center/cover no-repeat; }

/* Am PC breiter – gleicher Aufbau, nur mehr Platz (Fokus bleibt mobil) */
@media (min-width: 768px) {
  .app { padding: 22px 32px calc(110px + env(safe-area-inset-bottom)); }
  .folder-bar { margin-left: -32px !important; margin-right: -32px !important; padding-left: 32px !important; padding-right: 32px !important; }
}
/* Leiste unten: auf breiten Bildschirmen nicht über die ganze Breite ziehen */
.dock .btn-lg { display: block; }
.dock .btn-lg, #actionbar { max-width: 480px; margin-left: auto; margin-right: auto; }

/* Nacheinander einsortieren */
.step { background: var(--rb-app, var(--bs-body-bg)); }
.step-inner { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px calc(8px + env(safe-area-inset-bottom)); overflow-y: auto; }
.step-img { position: relative; width: 100%; height: min(45vh, 420px); border-radius: 1rem; background: #000 center/contain no-repeat;
  display: grid; place-items: center; color: #888; font-size: 3rem; }
.step-folders { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.step-folders .btn { padding: .9rem .6rem; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes stepIn { from { opacity: 0; transform: translateX(24px); } }
.step-anim { animation: stepIn .18s ease-out; }
@media (prefers-reduced-motion: reduce) { .step-anim { animation: none; } }

/* Wischen zum Markieren: kein Text-Markieren / Bild-Ziehen */
.tile, .folder-tile { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* offene Aufgabe: kräftig, aber ohne Verlauf */
.sort-banner { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; margin-bottom: 16px; padding: 14px 16px; border-radius: 1rem;
  background: #ffc94d; color: #3b2600; font-weight: 700; font-size: 1.02rem; box-shadow: 0 2px 8px rgba(180, 120, 0, .25); }
.sort-banner .bi { font-size: 1.3rem; line-height: 1; }
.sort-banner .bi-chevron-right { font-size: 1.1rem; }
[data-bs-theme="dark"] .sort-banner { background: #e0a82e; color: #241600; }
.sort-banner:active { transform: scale(.98); }
.folder-tile { min-height: 104px; }
.pv .pv-stage { bottom: calc(60px + env(safe-area-inset-bottom)); }   /* Platz für die Beschreibung – Video-Steuerung bleibt frei */
.pv-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #000; }
.pv-cap .form-control { background: rgba(255,255,255,.14); border: 0; color: #fff; max-width: 640px; margin: 0 auto; }
.pv-cap .form-control::placeholder { color: rgba(255,255,255,.75); }
.pv-cap .form-control:focus { background: rgba(255,255,255,.22); box-shadow: none; color: #fff; }
.pv-pending { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 16px; text-align: center; color: #fff; pointer-events: none; }
.pv-pending-ico { width: 76px; height: 76px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; font-size: 2.2rem; }
.pv-pending-txt { background: rgba(0,0,0,.6); padding: 8px 14px; border-radius: .9rem; font-weight: 600; max-width: 320px; }
.folder-tile.pressed { transform: scale(.96); transition: transform .3s; }
/* App-weit kein Text-Markieren / keine Lupe beim langen Drücken – nur in Eingabefeldern */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* Upload-Fortschritt als Ring */
.up-ring { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.up-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.up-ring circle { fill: none; stroke-width: 10; }
.up-ring .ring-bg { stroke: var(--rb-line, #eee); }
.up-ring .ring-fg { stroke: var(--bs-primary); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset .4s ease; }
.up-ring .ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.up-ring .ring-txt b { font-size: 2rem; font-weight: 800; }
.up-ring .ring-txt span { font-size: .85rem; color: var(--bs-secondary-color); }
.up-had { color: var(--bs-success-text-emphasis); }
.up-ring .ring-ok { font-size: 4rem; line-height: 1; color: var(--bs-success); }
.up-ring.ok .ring-fg { stroke: var(--bs-success); }
.loader-txt { margin-top: 14px; font-weight: 600; color: var(--bs-secondary-color); min-height: 1.5em; }
.section-label.nodate-label { margin-left: 0; margin-right: 0; }
.section-label.nodate-label.with-line { padding-top: 16px; border-top: 1px solid var(--rb-line); }
/* Vorschau beim Einsortieren: Leiste über der Beschreibung, Ordnerliste als Blatt von unten */
.pv.sorting .pv-stage { bottom: calc(122px + env(safe-area-inset-bottom)); }
.pv-sortbar { position: absolute; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 3; display: flex; gap: 8px;
  padding: 8px 12px 0; background: #000; max-width: 664px; margin: 0 auto; }
.pv-sortbar .pv-del { width: 52px; flex: none; }
.pv-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; max-height: 70%; overflow-y: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--rb-app, var(--bs-body-bg)); color: var(--bs-body-color); border-radius: 1.25rem 1.25rem 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.35); }
/* Vorschau beim Einsortieren: Beschreibung oben, Mülleimer + Einsortieren ganz unten */
.pv.sorting .pv-cap { bottom: calc(58px + env(safe-area-inset-bottom)); padding-bottom: 0; }
.pv.sorting .pv-sortbar { bottom: 0; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
body.busy.prep .loader { background: var(--rb-app, var(--bs-body-bg)); }
/* Tipp-Glühbirne gelb */
#up-keep .ko-ico { background: #fff3c4; color: #e0a800; }
[data-bs-theme="dark"] #up-keep .ko-ico { background: #4a3d10; color: #ffd24d; }
/* Einsortieren: Vorbereitung als Fortschritt oben auf der Seite */
.prep-card { margin: 4px 0 14px; padding: 12px 14px; border-radius: 1rem; background: var(--rb-card, #fff); box-shadow: var(--rb-shadow); }
.prep-card .progress { height: 6px; }
.up-target { font-weight: 600; color: var(--bs-primary); }
#up-list.stalled .progress-bar { animation: barBlink 1s ease-in-out infinite; }
/* Text auf Großbuchstaben-Höhe trimmen → mittig zum ✕, egal welche Schrift das Gerät hat */
.sel-bar .fb-sel-txt { text-box: trim-both cap alphabetic; }
