/* ==========================================================================
   Foto-Cloud – Stylesheet
   Eigenständig, keine externen Schriften oder Bibliotheken.
   ========================================================================== */

:root {
  --accent: #91ff3d;
  --accent-ink: #0a0a0a;
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --border: #e2e2dd;
  --fg: #16171a;
  --muted: #6b6e76;
  --ok: #2f8f46;
  --warn: #b7791f;
  --danger: #c93c3c;
  --info: #2f6fcf;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1012; --surface: #17181b; --surface-2: #1f2024; --border: #2b2d32;
    --fg: #ececee; --muted: #9a9ca3; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1012; --surface: #17181b; --surface-2: #1f2024; --border: #2b2d32;
  --fg: #ececee; --muted: #9a9ca3; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--fg); background: var(--bg); }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Grundgerüst ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-weight: 700; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 14px; font-weight: 800; flex: none; }
.brand img { max-height: 30px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a.is-active { background: var(--surface-2); color: var(--fg); box-shadow: inset 3px 0 0 var(--accent); }
.nav .count { margin-left: auto; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; padding: 0 7px; border-radius: 99px; }
.nav-sep { margin: 14px 10px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: .85rem; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.topbar form { flex: 1; max-width: 460px; }
.topbar input[type="search"] { width: 100%; }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; }
.content { padding: 26px 28px 60px; max-width: 1400px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Karten, Raster ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; display: block; }
.stat b { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .85rem; }
a.stat:hover { border-color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .meta { color: var(--muted); font-size: .82rem; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table th a { text-decoration: none; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table td.actions-cell { text-align: right; white-space: nowrap; }
.table .thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 4px; background: var(--surface-2); display: block; }

/* ---------- Formulare ---------- */
label { font-weight: 550; font-size: .88rem; display: block; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="url"],
input[type="date"], input[type="datetime-local"], input[type="tel"], input[type="color"], select, textarea {
  width: 100%; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 11px; min-height: 38px;
}
input[type="color"] { padding: 3px; width: 60px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fg); }
.field { margin-bottom: 14px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.help { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin-bottom: 8px; }
.check input { margin-top: 3px; accent-color: var(--fg); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 16px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 6px; margin: 0 0 16px; }
legend { font-weight: 650; padding: 0 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; }

/* ---------- Schaltflächen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: .9rem;
  padding: 8px 14px; min-height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(.95); border-color: var(--accent); }
.btn-dark { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { padding: 5px 10px; min-height: 30px; font-size: .82rem; }
.btn-icon { padding: 6px; min-width: 36px; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Hinweise ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge-danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge-info { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface); }
.flash-ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.flash-error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.flash-info { border-color: color-mix(in srgb, var(--info) 35%, transparent); background: color-mix(in srgb, var(--info) 7%, var(--surface)); }
.status-ok { color: var(--ok); } .status-warn { color: var(--warn); } .status-fail { color: var(--danger); } .status-info { color: var(--muted); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s; }
.progress.is-warn > span { background: var(--warn); } .progress.is-danger > span { background: var(--danger); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.is-active { color: var(--fg); border-bottom-color: var(--fg); }
.pager { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.pager a { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; }
.pager a.is-current { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.toast-host { position: fixed; bottom: 18px; right: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: .9rem; }
.toast.is-error { background: var(--danger); color: #fff; }
dialog { border: 1px solid var(--border); border-radius: 14px; padding: 22px; background: var(--surface); color: var(--fg); max-width: min(560px, calc(100vw - 32px)); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,10,12,.55); }
.copy-field { display: flex; gap: 6px; }
.copy-field input { font-family: var(--mono); font-size: .82rem; }

/* ---------- Anmeldung / einfache Seiten ---------- */
.plain { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box.wide { max-width: 860px; }
.auth-box .brand { justify-content: center; padding-bottom: 22px; font-size: 1.1rem; }

/* ---------- Kacheln (Galerieverwaltung) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tile.is-selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.tile .ph { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.tile .ph img { width: 100%; height: 100%; object-fit: contain; }
.tile .ext { font-weight: 800; font-size: 1.1rem; color: var(--muted); letter-spacing: .05em; }
.tile .cap { padding: 6px 8px; font-size: .78rem; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.tile .cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .sel { position: absolute; top: 6px; left: 6px; z-index: 2; width: 20px; height: 20px; accent-color: var(--fg); }
.tile .flags { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tile .flags .badge { background: rgba(0,0,0,.65); color: #fff; }
.tile[draggable="true"] { cursor: grab; }
.tile.is-drop { outline: 2px dashed var(--fg); }
.bulkbar { position: sticky; top: 62px; z-index: 10; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 12px; box-shadow: var(--shadow); }

/* ---------- Upload ---------- */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px 16px; text-align: center; background: var(--surface); transition: border-color .15s, background .15s; }
.dropzone.is-over { border-color: var(--fg); background: var(--surface-2); }
.dropzone p { margin: 6px 0; }
.upl-summary { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: 12px 0 6px; }
.upl-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.upl-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.upl-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl-item .progress { grid-column: 1 / -1; height: 5px; }
.upl-item.is-done .state { color: var(--ok); } .upl-item.is-error .state { color: var(--danger); } .upl-item.is-dup .state { color: var(--warn); }

/* ==========================================================================
   Galerieansicht (Kunden & Studio)
   ========================================================================== */
.vw { --vw-bg: #0e0e10; --vw-fg: #eeeeef; --vw-muted: #9d9ea6; --vw-surface: #18191c; --vw-border: #2a2b30;
  background: var(--vw-bg); color: var(--vw-fg); min-height: 100vh; }
.vw.theme-light { --vw-bg: #fafaf8; --vw-fg: #16171a; --vw-muted: #6b6e76; --vw-surface: #ffffff; --vw-border: #e3e3de; }
.vw .btn { background: var(--vw-surface); color: var(--vw-fg); border-color: var(--vw-border); }
.vw .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.vw .btn-ghost { background: transparent; border-color: transparent; }
.vw input, .vw select, .vw textarea { background: var(--vw-surface); color: var(--vw-fg); border-color: var(--vw-border); }
.vw-head { padding: 26px 28px 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-end; }
.vw-head h1 { font-size: 1.7rem; margin: 0; }
.vw-head .sub { color: var(--vw-muted); margin-top: 4px; }
.vw-brand { display: flex; align-items: center; gap: 10px; color: var(--vw-muted); font-size: .85rem; margin-bottom: 10px; text-decoration: none; }
.vw-brand img { max-height: 34px; width: auto; }
.vw-message { margin: 6px 28px 10px; padding: 12px 16px; background: var(--vw-surface); border: 1px solid var(--vw-border); border-radius: var(--radius); white-space: pre-line; max-width: 900px; }
.vw-toolbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 28px;
  background: color-mix(in srgb, var(--vw-bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--vw-border); }
.vw-toolbar .grow { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: .84rem; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--vw-border); background: transparent; color: var(--vw-fg); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip.is-active { background: var(--vw-fg); color: var(--vw-bg); border-color: var(--vw-fg); }
.chip .n { opacity: .7; font-size: .78rem; }
.vw-counter { font-size: .85rem; color: var(--vw-muted); }
.vw-counter b { color: var(--vw-fg); }
.vw-body { padding: 18px 28px 80px; }
.vw-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.vw-grid.layout-large { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.vw-grid.layout-contact { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.vw-grid.layout-masonry { display: block; columns: 4 240px; column-gap: 10px; }
.vw-grid.layout-masonry .vt { break-inside: avoid; margin-bottom: 10px; }
.vw-grid.layout-masonry .vt .vt-img { aspect-ratio: auto; }
.vw-grid.layout-masonry .vt .vt-img img { height: auto; object-fit: initial; }
.vw-grid.layout-strip { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.vw-grid.layout-strip .vt { flex: 0 0 auto; width: min(70vw, 560px); scroll-snap-align: start; }
.vt { position: relative; background: var(--vw-surface); border-radius: 6px; overflow: hidden; outline: 2px solid transparent; }
.vt.is-checked { outline-color: var(--accent); }
.vt.is-rejected .vt-img { opacity: .38; }
.vt-img { display: block; width: 100%; aspect-ratio: 3 / 2; background: color-mix(in srgb, var(--vw-fg) 6%, transparent); cursor: zoom-in; border: 0; padding: 0; }
.vt-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.layout-large .vt-img img, .layout-strip .vt-img img { object-fit: contain; }
.vt-noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--vw-muted); font-weight: 800; letter-spacing: .06em; }
.vt-bar { display: flex; align-items: center; gap: 4px; padding: 5px 6px; font-size: .78rem; }
.vt-bar .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--vw-muted); padding-left: 2px; }
.layout-contact .vt-bar .name { font-size: .7rem; }
.ib { font: inherit; background: transparent; border: 0; color: var(--vw-muted); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-grid; place-items: center; line-height: 1; }
.ib:hover { color: var(--vw-fg); background: color-mix(in srgb, var(--vw-fg) 10%, transparent); }
.ib.is-on { color: var(--vw-fg); }
.ib.fav.is-on { color: #ff4d6d; }
.ib.sel.is-on { color: var(--accent); }
.ib.rej.is-on { color: #ff6b6b; }
.ib .icon { width: 19px; height: 19px; }
.ib.fav.is-on .icon, .ib.sel.is-on .icon { fill: currentColor; }
.vt-badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; pointer-events: none; }
.vt-badges .badge { background: rgba(0,0,0,.66); color: #fff; }
.vt-label { position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.vt-check { position: absolute; bottom: 38px; left: 8px; width: 22px; height: 22px; accent-color: var(--accent); opacity: 0; transition: opacity .15s; }
.vt:hover .vt-check, .vt-check:checked, .vw.is-picking .vt-check { opacity: 1; }
.stars { display: inline-flex; gap: 1px; }
.stars .ib { padding: 2px; }
.stars .icon { width: 15px; height: 15px; }
.stars .is-on .icon { fill: #f5c542; stroke: #f5c542; }
.vw-more { text-align: center; padding: 26px; color: var(--vw-muted); }
.vw-empty { text-align: center; padding: 60px 20px; color: var(--vw-muted); }
.vw-notice { margin: 0 28px 12px; padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 16%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- Großansicht (Lightbox) ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: #050506; color: #eee; display: grid; grid-template-columns: 1fr auto; }
.lb-stage { position: relative; overflow: hidden; display: grid; place-items: center; touch-action: none; user-select: none; }
.lb-imgwrap { position: relative; max-width: 100%; max-height: 100%; line-height: 0; transform-origin: 0 0; }
.lb-img { max-width: calc(100vw - var(--lb-side, 0px) - 120px); max-height: calc(100vh - 110px); display: block; object-fit: contain; }
.lb.is-zoomed .lb-img { max-width: none; max-height: none; }
.lb.is-zoomed .lb-stage { cursor: grab; place-items: start; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px; padding: 10px 12px; z-index: 5;
  background: linear-gradient(rgba(0,0,0,.6), transparent); }
.lb-top .title { flex: 1; min-width: 0; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ccc; }
.lb-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 12px; z-index: 5; flex-wrap: wrap;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.lb .ib { color: #bbb; } .lb .ib:hover { color: #fff; background: rgba(255,255,255,.1); }
.lb .ib.is-on { color: #fff; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; background: rgba(0,0,0,.35); border: 0; color: #fff; width: 46px; height: 64px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.lb-nav:hover { background: rgba(0,0,0,.6); }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb.ui-hidden .lb-top, .lb.ui-hidden .lb-bottom, .lb.ui-hidden .lb-nav { opacity: 0; transition: opacity .4s; }
.lb-side { width: min(380px, 100vw); background: #141417; border-left: 1px solid #26272b; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.lb-side h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #999; margin: 0 0 8px; }
.lb-side .kv dt { color: #999; }
.lb-side textarea, .lb-side input, .lb-side select { background: #1d1e22; color: #eee; border-color: #303137; }
.lb-side .btn { background: #222327; color: #eee; border-color: #34353b; }
.lb-side .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cmt { padding: 10px 0; border-bottom: 1px solid #26272b; font-size: .9rem; }
.cmt .who { font-weight: 600; font-size: .85rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cmt .when { color: #888; font-size: .76rem; font-weight: 400; }
.cmt .body { white-space: pre-line; margin-top: 3px; word-break: break-word; }
.cmt.is-resolved .body { opacity: .55; }
.cmt.is-reply { margin-left: 18px; }
.cmt .pin { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 800; }
.cmt .tools { display: flex; gap: 10px; margin-top: 4px; font-size: .78rem; }
.cmt .tools button { color: #999; }
.marker { position: absolute; z-index: 3; pointer-events: auto; }
.marker.pt { width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(0,0,0,.45); line-height: 1; }
.marker.rect { border: 2px solid var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.5); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.marker.rect span { position: absolute; top: -11px; left: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.marker.is-draft { border-style: dashed; }
.marker.is-stale { filter: grayscale(1); opacity: .6; }
.lb.is-annotating .lb-stage { cursor: crosshair; }
.version-note { font-size: .82rem; padding: 8px 10px; border-radius: 8px; background: rgba(245,197,66,.14); color: #f5d36b; }
.lb-badge { font-size: .78rem; color: #ccc; padding: 4px 10px; background: rgba(255,255,255,.08); border-radius: 99px; }
.labelpick { display: flex; gap: 6px; flex-wrap: wrap; }
.labelpick button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.labelpick button.is-on { border-color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.5) inset; }
.labelpick .none { background: transparent; border-color: #555; color: #888; font-size: .7rem; }

/* Präsentationsmodus */
.lb.is-presentation { grid-template-columns: 1fr; }
.lb.is-presentation .lb-side { display: none; }
.lb.is-presentation .lb-img { max-width: 100vw; max-height: 100vh; }
.lb-counter { position: absolute; right: 16px; bottom: 16px; z-index: 6; font-size: .85rem; color: #aaa; background: rgba(0,0,0,.4); padding: 3px 10px; border-radius: 99px; }

/* Vergleichsansicht */
.cmp { position: fixed; inset: 0; z-index: 110; background: #050506; display: flex; flex-direction: column; }
.cmp-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #ccc; }
.cmp-grid { flex: 1; display: grid; gap: 6px; padding: 0 6px 6px; min-height: 0; }
.cmp-cell { position: relative; display: grid; grid-template-rows: 1fr auto; min-height: 0; background: #0d0d0f; border-radius: 6px; overflow: hidden; }
.cmp-cell img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.cmp-cell .vt-bar { color: #bbb; }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.nav-open .sidebar { transform: none; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 50px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .vw-head, .vw-body { padding-left: 16px; padding-right: 16px; }
  .vw-toolbar { padding: 8px 16px; }
  .vw-message, .vw-notice { margin-left: 16px; margin-right: 16px; }
  .vw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .vw-grid.layout-large { grid-template-columns: 1fr; }
  .vw-grid.layout-contact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vw-grid.layout-masonry { columns: 2; column-gap: 6px; }
  .vt-check { opacity: 1; }
  .lb { grid-template-columns: 1fr; }
  .lb-side { position: fixed; inset: auto 0 0 0; width: 100%; max-height: 62vh; z-index: 8; border-left: 0; border-top: 1px solid #26272b; border-radius: 14px 14px 0 0; }
  .lb-img { max-width: 100vw; max-height: calc(100vh - 120px); }
  .lb-nav { width: 38px; height: 52px; }
}
@media print {
  .sidebar, .topbar, .actions, .vw-toolbar { display: none !important; }
  .shell { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Auswahlfelder in Werkzeugleisten nicht auf volle Breite ziehen */
.vw-toolbar select, .vw-toolbar select.chip, .bulkbar select, .form-actions select { width: auto; min-height: 32px; }
.vw-toolbar select.chip { padding: 5px 28px 5px 12px; }
.vw-reports { position: relative; }
.vw-reports summary { list-style: none; cursor: pointer; }
.vw-reports summary::-webkit-details-marker { display: none; }
.vw-reports .card { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; right: 0 !important; }
@media (max-width: 860px) {
  .vw-toolbar { position: static; }
  .vw-toolbar .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .vw-toolbar .chip { flex: none; }
  .vt-bar .stars { display: none; }
  .vt-badges .badge:nth-child(n+3) { display: none; }
  .vw-head h1 { font-size: 1.35rem; }
  .bulkbar { position: static; }
}
.btn.menu-toggle { display: none; }
.tile .flags { left: 34px; }
@media (max-width: 860px) { .btn.menu-toggle { display: inline-flex; } }

/* ==========================================================================
   Vereinfachter Galerie-Ablauf (Galerieliste, Dialoge, Einstellungsfenster)
   ========================================================================== */
.gal-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.gal-head .sub { color: var(--muted); margin: 6px 0 16px; }
.gal-tools { display: flex; gap: 8px; align-items: center; }
.gal-tools input[type="search"] { width: 220px; }
.viewtoggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.viewtoggle a { padding: 7px 9px; display: grid; place-items: center; color: var(--muted); }
.viewtoggle a.is-active { background: var(--surface-2); color: var(--fg); }
.gal-section { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 12px; }
.gal-section h2 { font-size: 1.35rem; margin: 0; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.gcard { background: var(--surface); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.06);
  text-decoration: none; display: block; position: relative; transition: transform .15s, box-shadow .15s; }
.gcard:hover { transform: translateY(-2px); box-shadow: 0 4px 22px rgba(0,0,0,.12); }
.gcard .cover { aspect-ratio: 1.74; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.gcard .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gcard .meta { display: flex; justify-content: space-between; gap: 8px; padding: 11px 12px; font-weight: 650; font-size: .9rem; }
.gcard .meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .meta .n { color: var(--muted); font-weight: 400; flex: none; }
.gcard .marks { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.gcard .marks span { background: rgba(255,255,255,.92); color: #222; border-radius: 6px; padding: 3px 5px; display: grid; place-items: center; }
.gcard .marks .icon { width: 15px; height: 15px; }
.gcard.is-private .cover img { filter: grayscale(.6) brightness(.85); }
.glist .table td { vertical-align: middle; }
.glist .table img { width: 72px; height: 44px; object-fit: cover; border-radius: 4px; display: block; }

/* Segment-Auswahl (wie Umschalter mit mehreren Feldern) */
.seg { display: inline-flex; width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; }
.seg label { flex: 1; margin: 0; text-align: center; padding: 10px 8px; border-radius: 9px; cursor: pointer; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.seg.big label { padding: 14px 10px; }
.seg.pill { border-radius: 99px; }
.seg.pill label { border-radius: 99px; padding: 12px; }
.seg.pill label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.seg .icon { width: 30px; height: 30px; }
.seg small { color: var(--muted); font-weight: 400; }

/* Kippschalter */
.switch { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 10px; font-weight: 400; font-size: .95rem; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--border); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 21px; }
.switch input:disabled { opacity: .45; }
.switch span { padding-top: 2px; }
.is-off { opacity: .45; pointer-events: none; }

/* Großes Einstellungsfenster */
dialog.big { max-width: min(860px, calc(100vw - 24px)); padding: 0; }
dialog.big .dlg-head { padding: 26px 30px 6px; }
dialog.big .dlg-head h2 { font-size: 1.6rem; margin-bottom: 8px; }
dialog.big .dlg-close { position: absolute; top: 18px; right: 18px; }
dialog.big .dlg-body { padding: 0 30px; max-height: calc(100vh - 290px); overflow-y: auto; }
dialog.big .dlg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 30px; border-top: 1px solid var(--border); }
.dlg-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: 18px -30px 0; padding: 0 30px; overflow-x: auto; }
.dlg-tabs button { font: inherit; background: none; border: 0; padding: 10px 12px; color: var(--fg); cursor: pointer; display: flex; gap: 7px; align-items: center; border-bottom: 2px solid transparent; white-space: nowrap; border-radius: 8px 8px 0 0; }
.dlg-tabs button.is-active { color: var(--info); border-bottom-color: var(--info); background: color-mix(in srgb, var(--info) 8%, transparent); }
.set-row { display: grid; grid-template-columns: 220px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row > h4 { margin: 2px 0 0; font-size: .98rem; }
.set-row .help { margin-top: 2px; }
.set-note { text-align: center; color: var(--muted); padding: 18px 10px; border-bottom: 1px solid var(--border); }
.editor-bar { display: flex; gap: 2px; border: 1px solid var(--border); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 4px 6px; background: var(--surface-2); }
.editor-bar button { font: inherit; background: none; border: 0; padding: 4px 9px; border-radius: 5px; cursor: pointer; color: var(--fg); }
.editor-bar button:hover { background: var(--surface); }
.editor-bar + textarea { border-radius: 0 0 8px 8px; }
.linkbox { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.linkbox span { padding: 9px 11px; background: var(--surface-2); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; direction: rtl; text-align: left; }
.linkbox input { border: 0; border-radius: 0; font-family: var(--mono); }
.mini-preview { border: 1px solid var(--border); border-radius: 10px; padding: 10px; max-height: 240px; overflow: hidden; display: flex; flex-wrap: wrap; }
.mini-preview img { height: var(--h, 60px); flex-grow: 1; object-fit: cover; margin: var(--g, 3px); border-radius: var(--r, 4px); min-width: 30px; max-width: 160px; }
.opener-preview { border: 1px solid var(--border); border-radius: 10px; min-height: 110px; display: grid; place-items: center; text-align: center; padding: 18px;
  background-size: cover; background-position: center; color: var(--fg); font-weight: 700; }
.opener-preview.has-cover { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.6); min-height: 160px; }
.hue { width: 100%; accent-color: var(--fg); }
.hue-track { height: 10px; border-radius: 99px; background: linear-gradient(90deg, hsl(0,40%,92%), hsl(60,40%,92%), hsl(120,40%,92%), hsl(180,40%,92%), hsl(240,40%,92%), hsl(300,40%,92%), hsl(359,40%,92%)); margin-top: 4px; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.mode-cards label { margin: 0; text-align: center; padding: 22px 12px; border-radius: 9px; cursor: pointer; }
.mode-cards input { position: absolute; opacity: 0; }
.mode-cards label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 5px rgba(0,0,0,.14); }
.mode-cards .icon { width: 38px; height: 38px; display: block; margin: 0 auto 10px; }
.mode-cards strong { display: block; font-size: 1.05rem; }
.mode-cards small { color: var(--muted); }
.gal-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu .menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; width: 280px; box-shadow: var(--shadow); }
@media (max-width: 700px) {
  .set-row { grid-template-columns: 1fr; gap: 8px; }
  dialog.big .dlg-head, dialog.big .dlg-body, dialog.big .dlg-foot { padding-left: 16px; padding-right: 16px; }
  .dlg-tabs { margin: 14px -16px 0; padding: 0 16px; }
  .gal-tools input[type="search"] { width: 150px; }
  .mode-cards { grid-template-columns: 1fr; }
}

/* ---------- Gruppen-Überschriften und Listenansicht (Abstimmungs-Modus) ---------- */
.vw-group { grid-column: 1 / -1; flex-basis: 100%; width: 100%; margin: 18px 0 2px; font-size: .95rem; font-weight: 650; color: var(--vw-muted, var(--muted)); column-span: all; }
.vw-group:first-child { margin-top: 0; }
.vw-grid.layout-list { grid-template-columns: 1fr; gap: 4px; }
.vw-grid.layout-list .vt { display: grid; grid-template-columns: 110px 1fr; align-items: center; }
.vw-grid.layout-list .vt-img { aspect-ratio: 3 / 2; }
.vw-grid.layout-list .vt-bar { padding: 6px 12px; flex-wrap: wrap; }
.vw-grid.layout-list .vt-bar .name { order: -1; flex-basis: 100%; color: var(--vw-fg); font-size: .9rem; }
.vw-grid.layout-list .vt-badges { left: 116px; top: auto; bottom: 8px; }
.vw-grid.layout-list .vt-check { bottom: 8px; }
.vt-size { color: var(--vw-muted); margin-left: 6px; }
.vw-message ul, .vw-message ol, .pv-welcome ul, .pv-welcome ol { margin: 4px 0; padding-left: 22px; }
.vw-message a, .pv-welcome a { color: inherit; }

/* ---------- Präsentations-Modus ---------- */
.pv { --pv-fg: #17181a; --pv-muted: #6d6f75; --pv-row: 240px; --pv-gap: 8px; --pv-radius: 8px;
  background: var(--pv-bg, #fff); color: var(--pv-fg); min-height: 100vh; }
.pv-dark { --pv-fg: #f0f0f2; --pv-muted: #a0a2a8; }
.pv-size-s { --pv-row: 170px; } .pv-size-l { --pv-row: 340px; }
.pv-gap-s { --pv-gap: 3px; } .pv-gap-l { --pv-gap: 20px; }
.pv-square { --pv-radius: 0; }
.pv-font-serif .pv-title { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.pv-font-light .pv-title { font-weight: 300; letter-spacing: .02em; }
.pv-font-mono .pv-title { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 500; }
.pv-opener { min-height: 46vh; display: grid; place-items: center; text-align: center; padding: 60px 20px 70px; position: relative;
  background-size: cover; background-position: center; }
.pv-opener.has-cover { min-height: 92vh; color: #fff; }
.pv-opener.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.15), rgba(0,0,0,.45)); }
.pv-opener-inner { position: relative; max-width: 900px; }
.pv-title { margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.pv-fs-s { font-size: clamp(1.4rem, 3vw, 2rem); } .pv-fs-m { font-size: clamp(1.8rem, 4.5vw, 3rem); } .pv-fs-l { font-size: clamp(2.2rem, 6.5vw, 4.4rem); }
.pv-opener.has-cover .pv-title { text-shadow: 0 2px 18px rgba(0,0,0,.45); }
.pv-meta { margin: 14px 0 0; opacity: .8; font-size: .95rem; }
.pv-down { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: inherit; text-decoration: none; font-size: 1.6rem; opacity: .7; }
.pv-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 24px;
  background: color-mix(in srgb, var(--pv-bg, #fff) 90%, transparent); backdrop-filter: blur(8px); }
.pv-bar .grow { flex: 1; }
.pv-bar-title { font-weight: 600; }
.pv-bar .btn:not(.btn-primary), .pv-bar select { background: transparent; color: var(--pv-fg); border-color: color-mix(in srgb, var(--pv-fg) 22%, transparent); }
.pv-welcome { max-width: 760px; margin: 18px auto 6px; padding: 0 24px; text-align: center; line-height: 1.65; color: var(--pv-fg); }
.pv-body { padding: 16px 24px 60px; }
.pv-grid { display: flex; flex-wrap: wrap; gap: var(--pv-gap); }
.pv-grid::after { content: ""; flex-grow: 999999; }
.pv-item { position: relative; flex-grow: calc(var(--r) * 100); width: calc(var(--r) * var(--pv-row)); padding: 0; border: 0; background: color-mix(in srgb, var(--pv-fg) 6%, transparent);
  border-radius: var(--pv-radius); overflow: hidden; cursor: zoom-in; display: block; }
.pv-item i { display: block; }
.pv-item img, .pv-item .vt-noimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s, opacity .2s; }
.pv-item:hover img { transform: scale(1.025); }
.pv-grid .vw-group { color: var(--pv-muted); margin: 26px 0 4px; }
.pv .vw-more { color: var(--pv-muted); }
.pv-foot { text-align: center; color: var(--pv-muted); padding: 30px 20px 40px; font-size: .85rem; }
@media (max-width: 700px) {
  .pv { --pv-row: 140px; } .pv-size-s { --pv-row: 100px; } .pv-size-l { --pv-row: 220px; }
  .pv-body, .pv-bar { padding-left: 10px; padding-right: 10px; }
  .pv-bar { position: static; }
}
input:not([type]) { width: 100%; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; min-height: 38px; }
input:not([type]):focus { outline: none; border-color: var(--fg); }
.linkbox input:not([type]) { border: 0; border-radius: 0; }
.vw input:not([type]) { background: var(--vw-surface); color: var(--vw-fg); border-color: var(--vw-border); }
.pv-welcome ul, .pv-welcome ol { display: inline-block; text-align: left; margin: 6px auto; }
.pv-bar select, .pv-bar select.chip { width: auto; min-height: 32px; padding: 5px 28px 5px 12px; }

/* ==========================================================================
   Galerie-Verwaltung im picdrop-Stil
   ========================================================================== */
.gm-body { background: #fff; }
.gm { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.gm-panel { background: #f4f4f2; padding: 14px 12px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.gm-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .82rem; }
.gm-back .icon { width: 15px; height: 15px; }
.gm-titlebar { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 4px; }
.gm-titlebar h1 { font-size: 1.05rem; line-height: 1.3; margin: 0; flex: 1; word-break: break-word; }
.gm-iconbtn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: #e8e8e5; cursor: pointer; }
.gm-iconbtn .icon { width: 16px; height: 16px; }
.menu-item { display: block; width: 100%; text-align: left; font: inherit; font-size: .9rem; padding: 7px 8px; border: 0; background: none; border-radius: 6px; color: var(--fg); text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
.gm-titlebar .menu .menu-pop { left: 0; right: auto; }
.gm-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 6px; }
.gm-tools > * { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; background: #e8e8e5; border: 0; border-radius: 8px;
  font: inherit; font-size: .76rem; color: var(--fg); text-decoration: none; cursor: pointer; }
.gm-tools > *:hover { background: #dededa; }
.gm-tools .icon { width: 20px; height: 20px; }
.gm-wide { width: 100%; justify-content: flex-start; font-size: .86rem; padding: 8px 12px; }
.gm-state { font-size: .76rem; color: var(--muted); margin: 2px 2px 0; line-height: 1.5; }
.gm-h { font-size: 1rem; margin: 18px 0 6px; }
.gm-input { min-height: 34px !important; font-size: .88rem; background: #fff !important; }
.gm-flags { display: flex; align-items: center; gap: 2px; margin-top: 8px; }
.gm-flags .grow { flex: 1; }
.gm-flags button { background: none; border: 1px solid transparent; border-radius: 6px; padding: 4px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.gm-flags button.is-active { border-color: var(--fg); background: #fff; }
.gm-flags .icon { width: 17px; height: 17px; }
.icon.filled { fill: currentColor; }
.gm-arrange label { font-size: .8rem; margin: 8px 0 4px; }
.gm-row { display: flex; gap: 6px; }
.gm-row select { min-height: 34px; font-size: .86rem; padding: 4px 8px; background: #fff; }
.gm-toggle { margin: 0 !important; width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 7px; background: #e8e8e5; cursor: pointer; color: var(--muted); }
.gm-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.gm-toggle:has(input:checked) { background: var(--fg); color: #fff; }
.gm-toggle .icon { width: 16px; height: 16px; }
.gm-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.gm-foot a { font-size: .82rem; color: var(--muted); text-decoration: none; padding: 7px 10px; border-radius: 7px; background: #e8e8e5; text-align: center; }
.gm-foot a.is-active { color: var(--fg); }
.gm-main { padding: 18px 28px 120px; min-width: 0; position: relative; }
.gm-float { position: sticky; top: 8px; z-index: 15; height: 0; display: flex; justify-content: center; }
.gm-float .btn { box-shadow: var(--shadow); }
.gm-brand { margin: 26px 0 34px; min-height: 40px; }
.gm-brand img { max-height: 90px; max-width: 340px; }
.gm-brand span { font-size: 1.4rem; font-weight: 300; letter-spacing: .04em; color: #555; }
.gm-title { margin: 0 0 16px; }
.gm-empty { border: 2px dashed var(--border); border-radius: 12px; padding: 60px 20px; text-align: center; color: var(--muted); cursor: pointer; }
.gm-empty .icon { width: 42px; height: 42px; }
.gm-none { text-align: center; color: var(--muted); padding: 40px; }
.mgroup { margin-bottom: 26px; }
.mgroup-h { font-size: 1rem; font-weight: 600; margin: 0 0 12px; }
.mgroup-h span { color: var(--muted); font-weight: 400; }
.mgrid { display: flex; gap: 14px; align-items: flex-start; }
.mcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.mt { margin: 0; position: relative; }
.mt-img { position: relative; border-radius: 8px; overflow: hidden; background: #f0f0ee; outline: 3px solid transparent; outline-offset: -1px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.mt-open { display: block; line-height: 0; }
.mt-open img { width: 100%; height: auto; display: block; }
.mt-ext { display: grid; place-items: center; aspect-ratio: 3 / 2; font-weight: 800; color: var(--muted); letter-spacing: .06em; line-height: 1; }
.mt figcaption { text-align: center; font-size: .78rem; color: #8a8c92; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-btn { position: absolute; z-index: 2; background: #fff; border: 0; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer; color: #222;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px; font: inherit; font-size: .82rem; text-decoration: none; opacity: 0; transition: opacity .12s; }
.mt-btn .icon { width: 17px; height: 17px; }
.mt-sel { top: 8px; left: 8px; }
.mt-sel .on { display: none; }
.mt-flag { top: 8px; right: 8px; }
.mt-dl { bottom: 8px; left: 8px; padding: 6px 10px; }
.mt-more { bottom: 8px; right: 8px; }
.mt:hover .mt-btn, .mt.is-selected .mt-sel, .mt-flag.is-set, .gm.is-selecting .mt-sel { opacity: 1; }
.mt.is-selected .mt-img { outline-color: #3e7bfa; }
.mt.is-selected .mt-sel { background: #3e7bfa; color: #fff; }
.mt.is-selected .mt-sel .on { display: block; }
.mt.is-selected .mt-sel .icon:not(.on) { display: none; }
.mt.is-dragover .mt-img { outline: 3px dashed #3e7bfa; }
.mt-badges { position: absolute; left: 8px; right: 50px; top: 44px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.mt-badges span { background: rgba(255,255,255,.92); border-radius: 5px; padding: 1px 6px; font-size: .7rem; color: #333; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.mt:not(:hover) .mt-badges { top: 8px; }
.pop { position: absolute; z-index: 60; background: #fff; border-radius: 10px; box-shadow: 0 6px 30px rgba(0,0,0,.2); padding: 6px; min-width: 200px; }
.pop .menu-item { display: flex; gap: 8px; align-items: center; }
.pop .icon { width: 16px; height: 16px; }
.selbar { position: fixed; left: 252px; right: 16px; bottom: 14px; z-index: 40; background: #2b2b2e; color: #fff; border-radius: 10px; display: flex; align-items: center; gap: 14px; padding: 10px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.selbar-n { font-size: 1.1rem; min-width: 26px; text-align: center; }
.selbar-thumbs { flex: 1; display: flex; gap: 6px; overflow: hidden; border-left: 1px solid #444; padding-left: 14px; }
.selbar-thumbs img { height: 46px; width: auto; border-radius: 3px; }
.selbar-actions { display: flex; gap: 2px; border-left: 1px solid #444; padding-left: 10px; }
.selbar button { background: none; border: 0; color: #ddd; padding: 8px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
.selbar button:hover { background: #3c3c40; color: #fff; }
.selbar .icon { width: 20px; height: 20px; }
.selbar-close { border-left: 1px solid #444 !important; border-radius: 0 !important; padding-left: 14px !important; }
.drop-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(62,123,250,.12); border: 4px dashed #3e7bfa; display: grid; place-items: center; font-size: 1.4rem; font-weight: 600; color: #2a5bd7; pointer-events: none; }
@media (max-width: 860px) {
  .gm { grid-template-columns: 1fr; }
  .gm-panel { position: static; height: auto; }
  .gm-foot { margin-top: 10px; }
  .gm-main { padding: 12px 12px 120px; }
  .selbar { left: 8px; right: 8px; flex-wrap: wrap; }
  .selbar-thumbs { display: none; }
}
.mt-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: center; font-size: .72rem; color: #9a9ca2; margin-top: 2px; }
.mt-meta:empty { display: none; }

/* ==========================================================================
   Kundenansicht im picdrop-Stil (Abstimmungs-Modus)
   ========================================================================== */
body:has(.vwc), body:has(.pv) { background: #fff; }
.vwc { --vw-fg: #16171a; --vw-muted: #8a8c92; --vw-surface: #fff; --vw-border: #e3e3de; background: #fff; }
.vw-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); margin: 0 0 4px; }
.vw-crumbs > * + *::before { content: "/"; margin-right: 6px; color: #c4c5c9; }
.vw-crumbs strong { color: var(--fg); font-weight: 600; }
.vw-welcome { max-width: 760px; margin: -12px 0 26px; line-height: 1.65; }
.vwc .vw-notice { margin: 0 0 18px; }
.vw-count { font-size: .84rem; padding: 4px 2px; }
.gm-select { width: 100%; min-height: 34px; font-size: .86rem; padding: 4px 8px; background: #fff; margin-top: 8px; }
.gm-flags .n { font-size: .72rem; margin-left: 2px; }
.gm-flags button { display: inline-flex; align-items: center; }
.gm-foot button { font: inherit; font-size: .82rem; color: var(--muted); padding: 7px 10px; border-radius: 7px; background: #e8e8e5; border: 0; cursor: pointer;
  display: flex; justify-content: center; align-items: center; gap: 6px; }
.gm-foot button .icon { width: 15px; height: 15px; }
.gm-foot button:hover, .gm-foot a:hover { color: var(--fg); }
.vwc .mt-open, .pv .mt-open { border: 0; padding: 0; margin: 0; width: 100%; background: none; cursor: zoom-in; }
.mt-open img { aspect-ratio: auto; }
.mt.is-rejected .mt-open img { opacity: .4; filter: grayscale(.6); }
.vwc.is-selecting .mt-sel { opacity: 1; }
.mt-cap { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.mt-name { flex: 1; min-width: 0; text-align: center; font-size: .78rem; color: #8a8c92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-ic { background: none; border: 0; padding: 3px; border-radius: 6px; color: #b5b7bc; cursor: pointer; display: grid; place-items: center; }
.mt-ic .icon { width: 17px; height: 17px; }
.mt-ic:hover { color: #222; background: #f1f1ef; }
.mt-ic.fav.is-on { color: #e0245e; }
.mt-ic.fav.is-on .icon { fill: currentColor; }
.mt-ic.sel.is-on { color: #fff; background: #2f8f46; }
.menu-item.is-active { background: #f1f1ef; font-weight: 600; }
.menu-stars { display: flex; gap: 2px; padding: 4px 6px; }
.menu-stars .ib { color: #c4c5c9; }
.menu-stars .ib.is-on { color: #e6a700; }
.menu-stars .ib.is-on .icon { fill: currentColor; }
@media (hover: none) {
  .mt-btn { opacity: 1; padding: 4px; }
  .vwc .mt-sel, .vwc .mt-dl, .vwc .mt-flag:not(.is-set) { display: none; }
  .gm .mt-dl { font-size: 0; gap: 0; }
}

/* ---------- Präsentations-Modus (picdrop-Stil) ---------- */
.pv-cover { position: relative; min-height: 100vh; min-height: 100svh; background-size: cover; background-repeat: no-repeat; color: #fff;
  display: flex; justify-content: center; align-items: flex-start; text-align: center; padding: 11vh 24px 80px; }
.pv-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.32), rgba(0,0,0,0) 38%, rgba(0,0,0,0) 75%, rgba(0,0,0,.25)); }
.pv-cover .pv-title { position: relative; max-width: 1000px; text-shadow: 0 2px 22px rgba(0,0,0,.35); }
.pv-cover .pv-down { color: #fff; opacity: .9; font-size: 0; bottom: 22px; animation: pv-bob 2.4s ease-in-out infinite; }
.pv-cover .pv-down .icon { width: 34px; height: 34px; stroke-width: 1.6; }
@keyframes pv-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
.pv-head { text-align: center; padding: 70px 24px 44px; margin: 0 24px; border-bottom: 1px solid color-mix(in srgb, var(--pv-fg) 14%, transparent); }
.pv-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 34px 20px 8px; }
.pv-pill { font: inherit; font-size: .9rem; font-weight: 500; border: 0; border-radius: 99px; padding: 11px 26px; background: #2b2b2e; color: #fff; cursor: pointer; }
.pv-pill:hover { background: #000; }
.pv-dark .pv-pill { background: #f0f0f2; color: #111; }
.pv-pill-light { background: transparent; color: var(--pv-fg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pv-fg) 30%, transparent); }
.pv-pill-light:hover { background: color-mix(in srgb, var(--pv-fg) 8%, transparent); }
.pv-select { width: auto; border-radius: 99px; min-height: 42px; padding: 6px 30px 6px 16px; background-color: transparent; color: var(--pv-fg); }
.pv-manage { position: fixed; top: 12px; right: 12px; z-index: 30; display: inline-flex; gap: 6px; align-items: center; background: rgba(255,255,255,.92); color: #222;
  border-radius: 99px; padding: 6px 12px; font-size: .8rem; text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.pv-manage .icon { width: 15px; height: 15px; }
.pv .vw-sections .mgrid, .pv .vw-sections .mcol { gap: var(--pv-gap); }
.pv .mgroup { margin-bottom: var(--pv-gap); }
.pv .mgroup-h { color: var(--pv-muted); margin: 26px 0 10px; }
.pt .mt-img { border-radius: var(--pv-radius); box-shadow: none; background: color-mix(in srgb, var(--pv-fg) 6%, transparent); }
.pt .mt-open img { transition: transform .35s; }
.pt:hover .mt-open img { transform: scale(1.02); }
.pv-body { padding-top: 26px; }
@media (max-width: 700px) {
  .pv-cover { padding-top: 14vh; }
  .pv-head { padding: 46px 12px 30px; margin: 0 10px; }
}

/* ---------- Titelbild-Dialog mit Bildausschnitt ---------- */
.cover-focus { position: relative; display: block; width: fit-content; max-width: 100%; margin: 6px auto 0; cursor: crosshair; line-height: 0; }
.cover-focus img { max-width: 100%; max-height: 58vh; border-radius: 6px; user-select: none; }
.cover-dot { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid #e5372f;
  box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 2px 10px rgba(0,0,0,.35); pointer-events: none; transition: left .15s, top .15s; }
.cover-empty { border: 2px dashed var(--border); border-radius: 10px; padding: 40px 20px; text-align: center; color: var(--muted); }
#dlg-cover .form-actions { align-items: center; }
#dlg-cover .form-actions .grow { flex: 1; }
#dlg-cover form { margin: 0; }

/* ---------- Großansicht im picdrop-Stil ---------- */
.pop { z-index: 130; }
.lb { background: #141414; grid-template-columns: var(--lb-side, 0px) minmax(0, 1fr); }
.lb-side { order: -1; width: auto; background: #fff; color: #16171a; border-left: 0; border-right: 1px solid #e6e6e3; padding: 18px 14px; gap: 18px; }
.lb-side[hidden] { display: none; }
.lb-side h3 { color: #8a8c92; }
.lb-side .kv dt { color: #8a8c92; }
.lb-side textarea, .lb-side input, .lb-side select { background: #fff; color: #16171a; border-color: #dcdcd8; }
.lb-side .btn { background: #f1f1ef; color: #16171a; border-color: #e2e2de; }
.lb-side .chip { color: #16171a; border-color: #dcdcd8; }
.lb-side .chip.is-active { background: #16171a; color: #fff; }
.lb-side .cmt { border-bottom-color: #ececea; }
.lb-side .cmt .tools button { color: #777; }
.lb-side .list li { border-color: #ececea; }
.lb-info h2 { font-size: .95rem; margin: 0 0 12px; word-break: break-all; }
.lb-info p { margin: 0 0 4px; font-size: .78rem; color: #555; line-height: 1.5; }
.lb-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; height: 100dvh; }
.lb-stage { flex: 1; min-height: 0; }
.lb-img { max-width: calc(100vw - var(--lb-side, 0px) - 80px); max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); }
.lb.is-zoomed .lb-imgwrap { max-width: none; max-height: none; margin: auto; }
.lb.is-zoomed .lb-img { height: auto; }
.lb-top { left: auto; right: 0; background: none; padding: 10px 12px; }
.lb-top .ib { color: #ddd; }
.lb-bar { flex: none; display: flex; align-items: center; gap: 4px; padding: 8px 12px; min-height: 52px; color: #ddd; flex-wrap: wrap; }
.lb-bar .grow { flex: 1; }
.lb-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding-right: 10px; margin-right: 6px; border-right: 1px solid #333; }
.lb-tb { font: inherit; font-size: .84rem; background: none; border: 0; color: #e6e6e6; display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.lb-tb:hover { background: rgba(255,255,255,.09); color: #fff; }
.lb-tb .icon { width: 18px; height: 18px; }
.lb-tb.is-on { color: #fff; }
.lb-tb.is-on:not(.fav) { background: #2f8f46; }
.lb-tb.fav.is-on { color: #ff4f7f; }
.lb-tb.fav.is-on .icon, .lb-tb .icon.filled { fill: currentColor; }
.lb-stars { font-size: .8rem; color: #e6a700; padding: 0 6px; }
.lb-zoom { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: #ddd; }
.lb-zoom input[type=range] { width: 110px; accent-color: #fff; background: none; border: 0; padding: 0; min-height: 0; }
.lb-zoom span { min-width: 38px; }
.lb-counter { position: static; background: none; padding: 0 8px; color: #ccc; font-size: .82rem; }
.lb-bar .ib { color: #ddd; }
.lb.ui-hidden .lb-bar, .lb.ui-hidden .lb-top { opacity: 0; transition: opacity .4s; }
.lb.is-presentation .lb-img { max-width: 100vw; max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); }
@media (max-width: 860px) {
  .lb { grid-template-columns: minmax(0, 1fr); }
  .lb-side { order: 0; border-right: 0; }
  .lb-tb span { display: none; }
  .lb-zoom input[type=range] { display: none; }
  .lb-img { max-width: 100vw; }
}
.lb-side .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lb-top .ib, .lb-top .lb-badge { background: rgba(0,0,0,.5); }
.lb-top .ib:hover { background: rgba(0,0,0,.75); }
.lb-main { grid-column: -2 / -1; grid-row: 1; }
.lb-side { grid-row: 1; }
.lb .lb-img[style*="width"] { max-width: none; max-height: none; height: auto; }
