/* Grainhold – Layout angelehnt an die DPreview-Fotogalerie:
   dunkle Kopfzeile, helle Übersichtsseiten, dunkler Bildbetrachter mit Infospalte und Filmstreifen. */

:root {
  --page-width: min(2560px, 96vw);
  --bg: #f3f3f1;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --border: #dedcd7;
  --text: #1d1d1b;
  --muted: #74726c;
  --accent: #d9822b;
  --accent-ink: #ffffff;
  --accent-hover: #c06e1c;
  --danger: #c0392b;
  --ok: #2e7d4f;
  --fav: #e0245e;
  --top: #161616;
  --top-text: #e9e7e2;
  --top-muted: #9a978f;
  --viewer-bg: #111111;
  --viewer-panel: #1b1b1b;
  --viewer-line: #2c2c2c;
  --viewer-text: #e6e4df;
  --viewer-muted: #8f8c85;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18181a;
    --surface: #222224;
    --surface-2: #2a2a2c;
    --border: #38383b;
    --text: #ecebe7;
    --muted: #9b9993;
    --top: #0d0d0d;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.05rem; margin-bottom: 14px; }

/* Alle Ansichten nutzen dieselbe Breite (--page-width): auf grossen Bildschirmen fast die ganze Fläche */
.container { width: 100%; max-width: var(--page-width); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Kopfzeile ---------- */
.topbar { background: var(--top); color: var(--top-text); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: var(--page-width); margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--accent); }
.mainnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.mainnav a { text-decoration: none; color: var(--top-muted); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 18px 10px 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
.mainnav a:hover { color: var(--top-text); }
.mainnav a.active { color: var(--top-text); border-bottom-color: var(--accent); }
.usernav { display: flex; align-items: center; gap: 14px; font-size: .85rem; }
.usernav a { color: var(--top-muted); text-decoration: none; }
.usernav form { margin: 0; }
.user-chip { width: 30px; height: 30px; border-radius: 50%; background: #333; color: var(--top-text) !important; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.linkbtn { background: none; border: 0; color: var(--top-muted); font: inherit; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--accent); }

/* ---------- Seitenkopf ---------- */
.crumbs { font-size: .8rem; color: var(--muted); margin: 22px 0 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 1.9rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: 18px; }
.page-head .page-title { margin-bottom: 6px; }
.eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin-bottom: 6px; }

/* ---------- Schaltflächen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: 600 .85rem var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: .78rem; }

.badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 3px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge-draft { background: #444; color: #fff; position: static; vertical-align: middle; margin-left: 8px; }
.album-cover .badge-draft { position: absolute; margin: 0; }
.badge-cover { background: var(--accent); color: #fff; }
.badge-fav { background: var(--fav); color: #fff; left: auto; right: 8px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* ---------- Album-Übersicht (wie DPreview „Sample Galleries“) ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; margin-bottom: 48px; }
.album-card { background: var(--surface); text-decoration: none; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); transition: transform .15s, box-shadow .15s; }
.album-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.album-card:hover h3 { color: var(--accent); }
.album-cover { position: relative; aspect-ratio: 3 / 2; background: #2a2a2a; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-empty { height: 100%; display: grid; place-items: center; color: #888; font-size: .85rem; }
.album-meta { padding: 12px 14px 14px; }
.album-meta h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.album-sub { display: flex; gap: 12px; color: var(--muted); font-size: .8rem; }

/* ---------- Album-Seite ---------- */
.album-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.album-head .page-title { margin-bottom: 8px; }
.album-facts { display: flex; flex-wrap: wrap; gap: 0; color: var(--muted); font-size: .85rem; }
.album-facts span + span::before { content: "·"; margin: 0 8px; }
.album-desc { max-width: 720px; margin: 10px 0 0; }
.album-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 12px 14px 10px; text-decoration: none; font-size: .85rem; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-weight: 400; }
.album-head + .thumb-grid { margin-top: 20px; }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 48px; }
.thumb { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; }
.thumb > a { display: block; aspect-ratio: 1; background: var(--surface-2); }
.thumb > a img { width: 100%; height: 100%; object-fit: cover; transition: opacity .15s; }
.thumb > a:hover img { opacity: .85; }
.thumb figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; font-size: .75rem; color: var(--muted); }
.thumb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.thumb-tools { display: flex; gap: 2px; flex-shrink: 0; }
.fav-btn, .dl-btn { background: none; border: 0; font-size: 1rem; line-height: 1; padding: 4px 6px; cursor: pointer; color: var(--muted); text-decoration: none; border-radius: 3px; }
.fav-btn:hover, .dl-btn:hover { background: var(--surface-2); color: var(--text); }
.fav-btn[aria-pressed="true"] { color: var(--fav); }
.thumb.is-fav { border-color: var(--fav); }

/* ---------- Bildbetrachter (dunkel, mit Infospalte & Filmstreifen) ---------- */
html:has(body.page-viewer) { overflow-x: hidden; }
body.page-viewer { background: var(--viewer-bg); color: var(--viewer-text); height: 100vh; overflow: hidden; }
body.page-viewer .flash { display: none; }
.viewer { display: flex; flex-direction: column; height: calc(100vh - 56px); }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--viewer-line); font-size: .85rem; }
.viewer-back { color: var(--viewer-text); text-decoration: none; font-weight: 600; }
.viewer-back:hover { color: var(--accent); }
.viewer-count { color: var(--viewer-muted); }
.viewer-body { flex: 1; display: flex; min-height: 0; }
.viewer-stage { flex: 1; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 20px 64px; min-width: 0; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); user-select: none; }
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 96px; display: grid; place-items: center; font-size: 3rem; color: var(--viewer-muted); text-decoration: none; border-radius: var(--radius); transition: background .15s, color .15s; }
.nav-arrow:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-prev { left: 8px; }
.nav-next { right: 8px; }
/* Seitenleiste: Standard 20 % der Fensterbreite, mindestens 320 px (so breit war sie früher fest), mit der Maus
   am linken Rand ziehbar (--info-width, siehe app.js) */
.viewer-info { width: clamp(320px, var(--info-width, 20vw), 70vw); min-width: 0; flex-shrink: 0; background: var(--viewer-panel); border-left: 1px solid var(--viewer-line); padding: 20px; overflow-y: auto; }
.viewer-title { font-size: 1rem; font-weight: 700; word-break: break-all; margin-bottom: 16px; }
.viewer-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.viewer-actions .btn:not(.btn-primary) { background: transparent; color: var(--viewer-text); border-color: var(--viewer-line); }
.viewer-actions .btn:not(.btn-primary):hover { border-color: var(--viewer-muted); }
.fav-toggle .fav-on { display: none; color: var(--fav); }
.fav-toggle.is-fav .fav-on { display: inline; }
.fav-toggle.is-fav .fav-off { display: none; }
.info-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--viewer-muted); padding-bottom: 8px; border-bottom: 1px solid var(--viewer-line); margin-bottom: 0; }
.exif { display: grid; grid-template-columns: auto 1fr; margin: 0; font-size: .85rem; }
.exif dt, .exif dd { padding: 7px 0; border-bottom: 1px solid var(--viewer-line); margin: 0; }
.exif dt { color: var(--viewer-muted); padding-right: 16px; }
.exif dd { text-align: right; }
.viewer-hint { font-size: .75rem; color: var(--viewer-muted); margin-top: 20px; }
.filmstrip { position: relative; display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; border-top: 1px solid var(--viewer-line); background: #0b0b0b; flex-shrink: 0; scrollbar-width: thin; }
.filmstrip a { flex: 0 0 auto; width: 72px; height: 54px; opacity: .45; border: 2px solid transparent; border-radius: 2px; transition: opacity .15s; }
.filmstrip a:hover { opacity: .85; }
.filmstrip a.current { opacity: 1; border-color: var(--accent); }
.filmstrip img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Formulare & Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel.narrow { max-width: 640px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.admin-cols.wide-left { grid-template-columns: 2fr 1fr; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input, textarea, select {
  font: 400 .92rem var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 11px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input:disabled { background: var(--surface-2); color: var(--muted); }
label.check, .form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: .9rem; }
label.check input { width: auto; accent-color: var(--accent); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.checklist { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.checklist label { padding: 5px 0; }
details summary { cursor: pointer; font-weight: 600; font-size: .9rem; margin: 6px 0 14px; color: var(--accent); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.danger-zone h2 { color: var(--danger); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0 0 24px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); }
.table a { font-weight: 600; text-decoration: none; }
.table a:hover { color: var(--accent); }
.table tr.inactive td { opacity: .55; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stats b { display: block; font-size: 1.5rem; }
.stats span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Upload */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 32px 16px; border: 2px dashed var(--border); border-radius: var(--radius); cursor: pointer; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.dropzone input { display: none; }
.progress { margin-top: 14px; position: relative; height: 22px; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.progress span { position: absolute; inset: 0 auto 0 0; background: var(--accent); width: 0; transition: width .2s; }
.progress em { position: relative; font-style: normal; font-size: .75rem; padding-left: 10px; line-height: 20px; font-weight: 600; }
.upload-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 220px; overflow-y: auto; font-size: .8rem; }
.upload-list li { display: grid; grid-template-columns: 1fr 120px 110px; gap: 10px; align-items: center; padding: 3px 0; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.upload-list li.ok .up-state { color: var(--ok); }
.upload-list li.err .up-state { color: var(--danger); }

/* Permalinks */
.share-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.share-list li { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.share-list li.expired { opacity: .6; }
.share-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: .9rem; }
.share-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.share-url { display: flex; gap: 6px; }
.share-url input { font-family: ui-monospace, Menlo, monospace; font-size: .78rem; padding: 5px 8px; }
.share-url form { margin: 0; }

.admin-grid .thumb figcaption { gap: 4px; }
.admin-grid .thumb figcaption form { margin: 0; }
.admin-grid .linkbtn { color: var(--muted); font-size: 1rem; }
.thumb.is-cover { border-color: var(--accent); }

/* Anmelden */
.page-auth main { display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .form { margin: 20px 0; }

/* Meldungen */
.flash { max-width: calc(var(--page-width) - 48px); margin: 16px auto 0; padding: 10px 16px; border-radius: var(--radius); font-size: .9rem; width: calc(100% - 48px); }
.flash-ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.flash-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.alert { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); padding: 10px 12px; border-radius: var(--radius); font-size: .88rem; margin-top: 12px; }
.empty { text-align: center; padding: 80px 16px; color: var(--muted); }
.empty-code { font-size: 4rem; font-weight: 800; color: var(--border); }
.empty .btn { margin-top: 12px; }

.footer { padding: 24px 0; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 24px; }

/* ====================================================================== */
/* Studio-Funktionen: Auswahl, Kommentare, Workflow, Branding             */
/* ====================================================================== */
:root {
  --kind-comment: #3b82c4;
  --kind-crop: #8b5cf6;
  --kind-retouch: #e0457b;
  --kind-correction: #e08a1e;
  --warn: #b7791f;
}
.mt { margin-top: 20px; }
.mb { margin-bottom: 12px; }
.nowrap { white-space: nowrap; }
.clamp { max-width: 420px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.text-danger { color: var(--danger); }
form.inline, .inline-form { display: inline; margin: 0; }
.brand-logo { height: 28px; width: auto; max-width: 140px; object-fit: contain; }
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fav); color: #fff; font-size: .68rem; letter-spacing: 0; margin-left: 4px; vertical-align: 1px; }
.guest-chip { color: var(--top-text); font-size: .8rem; border: 1px solid #333; border-radius: 99px; padding: 3px 10px; }
.pill-ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.pill-warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.linkbtn-dark { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn-dark:hover { color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: .88rem; }
.notice-action { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.selection-bar { position: sticky; top: 56px; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .9rem; }
.selection-bar.is-done { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }
.badge-comments { background: rgba(0, 0, 0, .65); color: #fff; left: auto; right: 8px; text-transform: none; }
.badge-version { background: rgba(0, 0, 0, .65); color: #fff; top: auto; bottom: 40px; text-transform: none; }
.thumb .badge-comments + .badge-fav, .admin-grid .badge-fav + .badge-comments { top: 34px; }
.fav-btn:disabled { cursor: default; opacity: .8; }

.dialog { border: 0; border-radius: 8px; padding: 24px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dialog h2 { font-size: 1.2rem; }

/* Bildbetrachter: Zoom, Tabs, Kommentare, Markierungen */
.viewer-bar-right { display: flex; align-items: center; gap: 14px; }
.viewer-tool { background: none; border: 1px solid var(--viewer-line); color: var(--viewer-text); border-radius: var(--radius); padding: 4px 10px; font: 600 .78rem var(--font); cursor: pointer; }
.viewer-tool:hover, .viewer-tool.active { border-color: var(--accent); color: var(--accent); }
.viewer-stage.zoomed { display: block; overflow: auto; padding: 0; cursor: grab; }
.viewer-stage.zoomed.panning { cursor: grabbing; }
.viewer-stage.zoomed .viewer-img { max-width: none; max-height: none; margin: 0 auto; }
.viewer-stage.zoomed .nav-arrow { display: none; }
.anno-layer { position: absolute; pointer-events: none; }
.anno-layer.marking { pointer-events: auto; cursor: crosshair; outline: 2px dashed var(--accent); outline-offset: 2px; }
.anno { position: absolute; pointer-events: auto; cursor: pointer; --c: var(--kind-comment); }
.anno.kind-crop { --c: var(--kind-crop); }
.anno.kind-retouch { --c: var(--kind-retouch); }
.anno.kind-correction { --c: var(--kind-correction); }
.anno.pending { --c: #fff; }
.anno-pin { width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); display: grid; place-items: center; }
.anno-pin span { color: #fff; font: 700 .72rem var(--font); }
.anno.pending.anno-pin span { color: #111; }
.anno-rect { border: 2px solid var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(0, 0, 0, .3); background: color-mix(in srgb, var(--c) 12%, transparent); }
.anno-rect span { position: absolute; top: -11px; left: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 700 .7rem var(--font); border: 2px solid #fff; }
.anno.pending.anno-rect span { color: #111; }
.anno.resolved { opacity: .35; }
.anno.hl { z-index: 2; transform: scale(1.15); }
.anno-rect.hl { transform: none; box-shadow: 0 0 0 3px var(--c); }
.info-tabs { display: flex; border-bottom: 1px solid var(--viewer-line); margin-bottom: 4px; }
.info-tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--viewer-muted); font: 600 .75rem var(--font); text-transform: uppercase; letter-spacing: .08em; padding: 8px 4px; cursor: pointer; margin-bottom: -1px; }
.info-tabs button.active { color: var(--viewer-text); border-bottom-color: var(--accent); }
.info-tabs .count:not(:empty) { display: inline-block; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; margin-left: 4px; letter-spacing: 0; }
.comment-list { list-style: none; margin: 0 0 12px; padding: 0; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--viewer-line); font-size: .85rem; transition: background .3s; }
.comment.resolved { opacity: .55; }
.comment.flash-hl { background: rgba(255, 255, 255, .06); }
.comment-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.comment-body { margin: 6px 0; white-space: pre-wrap; word-break: break-word; }
.comment-actions { display: flex; gap: 12px; align-items: center; }
.comment .linkbtn-dark, .reply .linkbtn-dark { color: var(--viewer-muted); }
.reply { margin: 6px 0 6px 12px; padding-left: 10px; border-left: 2px solid var(--viewer-line); }
.reply.from-admin { border-left-color: var(--accent); }
.reply p { margin: 2px 0 0; white-space: pre-wrap; }
.reply-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.empty-comments { padding: 10px 0; }
.anno-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font: 700 .68rem var(--font); background: var(--kind-comment); }
.kind-tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--kind-comment); }
.kind-tag.kind-crop, .anno-num.kind-crop { background: var(--kind-crop); }
.kind-tag.kind-retouch, .anno-num.kind-retouch { background: var(--kind-retouch); }
.kind-tag.kind-correction, .anno-num.kind-correction { background: var(--kind-correction); }
.comment-form { display: flex; flex-direction: column; gap: 8px; }
.viewer-info textarea { background: #111; color: var(--viewer-text); border-color: var(--viewer-line); }
.comment-form-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-form-row .btn-primary { margin-left: auto; }
.comment-form .btn:not(.btn-primary), .reply-form .btn:not(.btn-primary), [data-panel] > .btn { background: transparent; color: var(--viewer-text); border-color: var(--viewer-line); }
[data-mark-btn].active { border-color: var(--accent) !important; color: var(--accent) !important; }
.kind-picker { display: flex; gap: 4px; flex-wrap: wrap; }
.kind-picker label { position: relative; }
.kind-picker input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.kind-picker span { display: inline-block; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--viewer-line); font-size: .74rem; cursor: pointer; color: var(--viewer-muted); }
.kind-picker input:checked + span { color: #fff; border-color: transparent; background: var(--kind-comment); }
.kind-picker .kind-crop input:checked + span { background: var(--kind-crop); }
.kind-picker .kind-retouch input:checked + span { background: var(--kind-retouch); }
.kind-picker .kind-correction input:checked + span { background: var(--kind-correction); }
.kind-picker input:focus-visible + span { outline: 2px solid var(--accent); }
.filmstrip a.is-fav { box-shadow: inset 0 -3px 0 var(--fav); }

/* Dashboard / Workflow-Board */
.dash-cols { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; margin-bottom: 40px; }
.dash-main { min-width: 0; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.segmented a { padding: 7px 14px; font-size: .82rem; font-weight: 600; text-decoration: none; color: var(--muted); background: var(--surface); }
.segmented a.active { background: var(--text); color: var(--bg); }
/* Spalten teilen sich die Breite; erst auf schmalen Bildschirmen seitlich scrollen (siehe unten) */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 8px; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 240px; }
.board-col header { display: flex; justify-content: space-between; padding: 10px 12px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.board-col header .count { color: var(--muted); }
.board-cards { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 8px; transition: background .15s; }
.board-cards.over { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.board-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; cursor: grab; box-shadow: var(--shadow); }
.board-card:hover strong { color: var(--accent); }
.board-card.dragging { opacity: .4; }
.board-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; pointer-events: none; }
.board-card-body { padding: 8px 10px 10px; font-size: .82rem; }
.board-card-meta { display: flex; gap: 8px; color: var(--muted); font-size: .75rem; margin: 2px 0 6px; }
.board-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.activity h2 { margin-bottom: 10px; }
.activity-list { list-style: none; margin: 0 0 12px; padding: 0; font-size: .84rem; }
.activity-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.activity-list li.is-new { background: color-mix(in srgb, var(--accent) 8%, transparent); margin: 0 -10px; padding: 9px 10px; }
.activity-icon { flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .75rem; }
.activity-list a { font-weight: 600; text-decoration: none; }

/* Albumverwaltung */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.subnav a { font-size: .8rem; text-decoration: none; padding: 5px 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); }
.subnav a:hover { border-color: var(--accent); color: var(--accent); }
.status-select { width: auto; padding: 7px 10px; font-weight: 600; font-size: .85rem; }
.table.compact td { padding: 8px 10px; vertical-align: top; }
.note-row td { padding-top: 0 !important; font-style: italic; color: var(--muted); font-size: .85rem; }
.admin-comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow-y: auto; }
.admin-comments li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: .86rem; }
.admin-comments li.is-resolved { opacity: .55; }
.admin-comments img { width: 64px; height: 64px; object-fit: cover; border-radius: 3px; }
.admin-comments p { margin: 4px 0 0; white-space: pre-wrap; }
.quote { margin: 12px 0 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface); font-style: italic; max-width: 720px; }
.color-row { display: flex; align-items: center; gap: 12px; font-weight: 400; }
.color-row input[type=color] { width: 56px; height: 36px; padding: 2px; }
.logo-preview { background: var(--top); padding: 12px; border-radius: var(--radius); display: inline-block; }
.logo-preview img { max-height: 48px; }
input[type=range] { padding: 0; accent-color: var(--accent); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.panel h2.mt { margin-top: 22px; }

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .dash-cols { grid-template-columns: 1fr; }
  .selection-bar { top: 56px; }
  .admin-cols, .admin-cols.wide-left { grid-template-columns: 1fr; }
  body.page-viewer { height: auto; overflow: auto; }
  .viewer { height: auto; }
  .viewer-body { flex-direction: column; }
  .viewer-stage { padding: 12px 0; min-height: 60vh; }
  .viewer-img { max-height: 75vh; }
  .nav-arrow { width: 40px; height: 72px; font-size: 2.2rem; background: rgba(0, 0, 0, .35); }
  .viewer-info { width: 100%; border-left: 0; border-top: 1px solid var(--viewer-line); }
  .viewer-resizer { display: none; }
  .viewer-hint { display: none; }
}
@media (max-width: 600px) {
  .container, .topbar-inner { padding: 0 16px; }
  .topbar-inner { gap: 12px; }
  .brand { font-size: .75rem; }
  .brand-mark { display: none; }
  .mainnav a { padding: 18px 6px 15px; font-size: .72rem; }
  .page-title { font-size: 1.5rem; }
  .thumb-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .album-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .flash { width: calc(100% - 32px); }
  .upload-list li { grid-template-columns: 1fr 80px; }
  .up-bar { display: none; }
  .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(5), .table td:nth-child(5) { display: none; }
}

/* Projekte & Ordner */
.folder-card .album-cover::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -40px 40px -30px rgba(0,0,0,.35); pointer-events: none; }
.folder-tag { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; }
.folder-tree { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.folder-tree li a { display: block; padding: 4px 6px; border-radius: 4px; text-decoration: none; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-tree li a:hover { background: var(--bg); }
.folder-tree li a.active { background: var(--accent); color: #fff; }
.folder-tree .muted { font-size: .75rem; }
.project-cols { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: start; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list > li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.item-list > li:last-child { border-bottom: 0; }
.item-list img, .item-list .item-icon { width: 64px; height: 44px; object-fit: cover; border-radius: 3px; background: #2a2a2a; flex: none; display: grid; place-items: center; color: #aaa; font-size: 1.2rem; }
.item-list .item-main { flex: 1; min-width: 160px; }
.item-list details { width: 100%; }
.item-list details form { margin-top: 8px; }
.form.row-form { display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.row-form label { flex: 1; min-width: 160px; }
.project-ref { color: var(--muted); font-size: .75rem; }
@media (max-width: 800px) { .project-cols { grid-template-columns: 1fr; } }

/* Benutzermenü & Kundenansicht */
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 200px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; z-index: 30; }
.usermenu-panel a, .usermenu-panel button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 4px;
  color: var(--text) !important; text-decoration: none; font: inherit; font-size: .88rem; background: none; border: 0; cursor: pointer; }
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--surface-2); }
.usermenu-panel form { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.usermenu-name { padding: 8px 10px 10px; font-weight: 700; font-size: .88rem; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.usermenu-name span { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.preview-bar { background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--muted); font-size: .8rem; padding: 7px 0; }
main.container > .page-title:first-child, main.container > .page-head:first-child,
main.container > .admin-cols:first-child, main.container > form:first-child { margin-top: 28px; }
@media (max-width: 600px) {
  .has-nav .brand > span { display: none; }
  .has-nav .brand .brand-mark { display: block; }
  .has-nav .mainnav { gap: 0; }
}
.badge-master { background: rgba(0, 0, 0, .65); color: #fff; top: auto; bottom: 64px; left: auto; right: 8px; letter-spacing: .08em; }
.badge-xmp { background: rgba(0, 0, 0, .65); color: #fff; top: auto; bottom: 40px; left: auto; right: 52px; letter-spacing: .08em; }
.badge-raw { background: rgba(0, 0, 0, .65); color: #fff; top: auto; bottom: 40px; left: auto; right: 8px; letter-spacing: .08em; }
.token-panel { border-color: var(--accent); }
.steps { margin: 0; padding-left: 20px; line-height: 1.7; font-size: .92rem; }
.steps code, .token-panel code { background: var(--surface-2); padding: 1px 5px; border-radius: 3px; font-size: .85em; }
.filter-chip { font-size: .85rem; color: var(--muted); margin: -8px 0 14px; }

/* Workflow-Board: auf sehr grossen Bildschirmen etwas mehr Platz für die Neuigkeiten */
@media (min-width: 2000px) { .dash-cols { grid-template-columns: 1fr 360px; } }
/* Mittlere Breiten: «Neuigkeiten» unter das Board, damit alle Spalten Platz haben; nur ganz schmal seitlich scrollen */
@media (max-width: 1180px) { .dash-cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .board { grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; } }

/* Rechte im Benutzerformular */
fieldset.rights { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 0; display: grid; gap: 6px; }
fieldset.rights legend { padding: 0 6px; font-weight: 600; }

/* Reiter «Entwicklung» im Bildbetrachter */
.develop-group { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--viewer-muted); margin: 18px 0 2px; }
.develop-history { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.develop-history > li { padding: 10px 0; border-bottom: 1px solid var(--viewer-line); }
.develop-history-head { display: flex; justify-content: space-between; gap: 12px; }
.develop-history ul { margin: 4px 0 0; padding-left: 18px; color: var(--viewer-muted); }
.info-tabs button { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; font-size: .68rem; padding: 8px 3px; }

/* Griff zum Verstellen der Seitenleiste im Bildbetrachter */
.viewer-resizer { flex: 0 0 9px; margin: 0 -4px; z-index: 5; cursor: col-resize; position: relative; touch-action: none; }
.viewer-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: transparent; transition: background .15s, width .15s, left .15s; }
.viewer-resizer:hover::after, .viewer-resizer:focus-visible::after, body.is-resizing .viewer-resizer::after { background: var(--accent); width: 3px; left: 3px; }
.viewer-resizer:focus { outline: none; }
body.is-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.is-resizing .viewer-img { pointer-events: none; }

/* Ausgeblendete Elemente bleiben ausgeblendet, auch wenn eine Klasse (z. B. .btn) eine Anzeigeart setzt */
[hidden] { display: none !important; }
/* Schaltflächen in der Seitenleiste des Bildbetrachters dürfen umbrechen statt abgeschnitten zu werden */
.viewer-actions .btn { white-space: normal; text-align: center; flex-wrap: wrap; row-gap: 0; }

/* Freigaben mit Stufe: Häkchen links, Auswahl der Stufe rechts */
.access-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.access-row .check { flex: 1; min-width: 0; }
.access-row select { width: auto; max-width: 15rem; padding: 4px 8px; font-size: .82rem; }
.audit-values { font-size: .78rem; color: var(--muted); margin-top: 2px; word-break: break-word; }
.audit-values b { font-weight: 600; color: var(--text, inherit); }

/* Anmeldung: zweiter Faktor */
.auth-card.auth-wide { max-width: 520px; }
.qr { margin: 10px 0; }
.qr svg { display: block; width: 190px; height: 190px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.totp-secret { display: block; margin-top: 4px; font-size: .9rem; letter-spacing: .05em; word-break: break-all; user-select: all; }
.recovery-codes { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.recovery-codes code { font-size: 1rem; letter-spacing: .04em; }

/* Passkeys */
.passkey-login { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.auth-card .passkey-login:first-of-type { border-top: 0; padding-top: 0; }
.passkey-login .alert { margin-top: 10px; }

/* Kundenportal «Meine Aufträge» */
.portal-todo { border-color: var(--accent); }
.portal-project { margin-bottom: 12px; }
.portal-project-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; }
.portal-project-head h2 { margin: 0; }
.portal-card { display: flex; flex-direction: column; }
.portal-card .album-cover { display: block; position: relative; }
.portal-card h3 a { text-decoration: none; }
.portal-card:hover { transform: none; }
.portal-facts { margin-top: 8px; min-height: 1.2em; }
.portal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.badge-new { background: var(--accent); color: #fff; }
.portal-contact { margin-top: 28px; }
.auth-logo { display: block; max-width: 180px; max-height: 80px; margin: 0 auto 18px; object-fit: contain; }
.share-send { margin-top: 8px; }

/* Papierkorb und Datenschutz */
.tag-redacted { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--border, #ddd); color: var(--muted); font-size: .75rem; }
.inline-details { display: inline-block; vertical-align: top; }
.inline-details > summary { list-style: none; cursor: pointer; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] { display: block; margin-top: 10px; max-width: 520px; }
.inline-details[open] > .form { margin-top: 10px; padding: 12px; border: 1px solid var(--border, #ddd); border-radius: 8px; }

/* Betriebsseite */
.plain-list { margin: 6px 0 0; padding-left: 18px; }
.plain-list li { margin: 2px 0; }
.admin-cols > .panel { min-width: 0; }
.table-scroll { overflow-x: auto; }

/* Bewertung, Freigabe, Vergleich */
.review { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 8px 8px; }
.viewer-actions .review, .compare-meta .review { padding: 4px 0; }
.stars { display: inline-flex; }
.stars button { background: none; border: 0; padding: 2px 1px; font-size: 1rem; line-height: 1; cursor: pointer; color: var(--border); }
.stars button.on { color: #e3a008; }
.stars button:hover { color: #c98a00; }
.stars-static { color: #e3a008; letter-spacing: 1px; }
.colors { display: inline-flex; gap: 4px; align-items: center; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid transparent; padding: 0; vertical-align: middle; }
button.dot { cursor: pointer; opacity: .45; }
button.dot:hover, button.dot.on { opacity: 1; }
button.dot.on { border-color: var(--text); }
.dot-red { background: #d64545; } .dot-yellow { background: #e3b505; } .dot-green { background: #3c9a5f; }
.dot-blue { background: #3d7fd6; } .dot-purple { background: #8a5bd6; }
.proof-tools { display: inline-flex; gap: 4px; margin-left: auto; }
.proof-tools button { width: 28px; height: 26px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); cursor: pointer; font-size: .95rem; line-height: 1; color: var(--muted); }
.proof-tools button[data-proof="approved"].on { background: #3c9a5f; border-color: #3c9a5f; color: #fff; }
.proof-tools button[data-proof="rejected"].on { background: var(--danger); border-color: var(--danger); color: #fff; }
.proof-tools button:disabled { opacity: .4; cursor: default; }
/* Marken unten im Bild hängen am Bild selbst, nicht an der Karte – darunter stehen Name und Bedienelemente */
.thumb > a { position: relative; display: block; }
.thumb > a .badge-version { bottom: 8px; }
.badge-proof { top: auto; bottom: 8px; right: 8px; left: auto; text-transform: none; color: #fff; }
.badge-proof[hidden] { display: none; }
.proof-approved { background: #3c9a5f; } .proof-rejected { background: var(--danger); } .proof-working { background: #b7791f; }
.proof-pill { color: #fff; border-color: transparent; } .proof-pill.proof-open { background: var(--surface-2); color: var(--text); }
.proof-bar { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.proof-bar .proof-rejected { background: none; color: var(--danger); }
.proof-state, .proof-staff, .all-ratings { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.all-ratings { flex-direction: column; align-items: flex-start; gap: 2px; }
.tabs { flex-wrap: wrap; }
.tab-group { display: inline-flex; align-items: stretch; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--border); }
.tabs .tab-group a { padding-left: 8px; padding-right: 8px; }
.tabs a.tab-dot { display: inline-flex; align-items: center; }
.cmp-btn { background: none; border: 0; font-size: 1rem; line-height: 1; padding: 4px 6px; cursor: pointer; color: var(--muted); border-radius: 3px; }
.cmp-btn:hover { background: var(--surface-2); color: var(--text); }
.cmp-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.thumb.is-compare { outline: 3px solid var(--accent); outline-offset: 2px; }
.compare-bar { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .9rem; }
.compare-view { position: fixed; inset: 0; z-index: 100; background: #111; color: #eee; display: flex; flex-direction: column; }
.compare-view[hidden], .compare-bar[hidden] { display: none; }
.compare-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; }
.compare-grid { flex: 1; min-height: 0; display: grid; gap: 6px; padding: 0 6px 6px; grid-template-columns: repeat(2, 1fr); }
.compare-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.compare-grid[data-count="4"] { grid-template-rows: repeat(2, 1fr); }
.compare-cell { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: #1b1b1b; border-radius: 4px; overflow: hidden; }
.compare-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.compare-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.compare-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; font-size: .8rem; background: #222; }
.compare-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.compare-meta .fav-btn, .compare-meta .stars button { color: #777; }
.compare-meta .fav-btn[aria-pressed="true"] { color: var(--fav); }
.compare-meta .stars button.on { color: #e3a008; }
.compare-meta button.dot.on { border-color: #fff; }
.compare-meta .proof-tools button { background: #333; border-color: #444; color: #ccc; }
body.compare-open { overflow: hidden; }
@media (max-width: 700px) {
  .compare-grid, .compare-grid[data-count="3"] { grid-template-columns: 1fr; grid-auto-rows: minmax(0, 1fr); }
  .compare-grid[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
  .tab-group { margin-left: 0; padding-left: 0; border-left: 0; }
}

/* Aufgabenliste */
.task-kind { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 4px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { padding: 6px 0; border-top: 1px solid var(--border); }
.task-list li:first-child { border-top: 0; }
.tabs a { white-space: nowrap; }
/* Finger statt Maus: grössere Flächen zum Antippen */
@media (pointer: coarse), (max-width: 700px) {
  .stars button { font-size: 1.35rem; padding: 6px 3px; }
  button.dot { width: 20px; height: 20px; }
  .colors { gap: 6px; }
  .proof-tools button { width: 44px; height: 36px; font-size: 1.1rem; }
  .cmp-btn, .fav-btn, .dl-btn { padding: 8px 10px; font-size: 1.15rem; }
  .review { gap: 6px 10px; }
}
.viewer-info .stars button { color: #5a5a5a; }
.viewer-info .stars button.on { color: #e3a008; }
.viewer-info .proof-tools button { background: #2a2a2a; border-color: #444; color: #ccc; }
.viewer-info button.dot.on { border-color: #fff; }
@media (pointer: coarse) { .key-hint { display: none; } }

/* Sprachwahl */
.lang-chip { color: var(--top-text); font-size: .78rem; font-weight: 600; letter-spacing: .04em; border: 1px solid #333; border-radius: 99px; padding: 3px 10px; }
.lang-chip::after { content: " ▾"; color: var(--top-muted); }
.langmenu .usermenu-panel { min-width: 140px; }
.langmenu .usermenu-panel a.active { font-weight: 700; }
.lang-switch { margin-left: 12px; white-space: nowrap; }
.lang-switch a, .lang-switch b { margin-right: 6px; font-size: .8rem; text-decoration: none; }
.lang-switch a { color: var(--muted); }
.lang-switch a:hover { color: var(--text); text-decoration: underline; }
.auth-lang { margin-top: 14px; text-align: center; }

/* ---------- Suche, Stichwörter, Kundenhistorie, Prüfsummen ---------- */
.search-form { display: grid; gap: 14px; }
.search-main { display: flex; gap: 10px; }
.search-main input { flex: 1; min-width: 0; font-size: 1rem; padding: 10px 12px; }
.search-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; }
.search-filters label { margin: 0; font-size: .78rem; color: var(--muted); }
.search-filters input, .search-filters select { width: 100%; margin-top: 3px; }
.search-form p { margin: 0; }
.search-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: .8rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip b { color: var(--muted); font-weight: 600; margin-left: 2px; }
.search-meta { padding: 0 8px 8px; font-size: .75rem; color: var(--muted); display: grid; gap: 2px; }
.search-meta a { color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-meta a:hover { color: var(--accent); }
.search-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 4px; }
.page-viewer .chip { background: transparent; border-color: #444; color: var(--viewer-text); font-size: .74rem; padding: 1px 8px; }
.integrity { margin-bottom: 20px; }
.integrity-bad { border-color: var(--danger, #c0392b); }
@media (max-width: 600px) { .search-main { flex-direction: column; } }

/* Rechte und Fristen */
.pill-bad { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.badge-license { background: rgba(0, 0, 0, .65); color: #fff; top: auto; bottom: 64px; text-transform: none; }
.badge-license.is-expired { background: var(--danger); }
.license-assign { flex-wrap: wrap; align-items: center; }
.license-assign select { max-width: 100%; min-width: 0; flex: 1 1 240px; }
.license-line { margin-bottom: 4px; }
.consent-scope { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 6px 6px 0; white-space: pre-line; }
.consent-card .form-actions { flex-wrap: wrap; }
.item-list details > form + form { margin-top: 12px; }

/* Abrechnung: Verbrauch neben den Grenzwerten, Pläne nebeneinander */
.plan-now { font-size: 1.15rem; margin: 0 0 10px; }
.usage-row { margin: 0 0 14px; }
.usage-head { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; margin-bottom: 5px; }
.usage-bar { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--ok); }
.usage-bar.near span { background: var(--warn); }
.usage-bar.full span { background: var(--danger); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 14px 0; }
.plan-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.plan-card.current { border-color: var(--ok); }
.plan-card h3 { margin: 0; font-size: 1.05rem; }
.plan-card ul { margin: 0; padding-left: 18px; font-size: .9rem; flex: 1; }
.plan-card li { margin: 3px 0; }
.plan-card form { margin: 0; }
.plan-price { font-size: 1.2rem; font-weight: 700; margin: 0; }
.billing-notice a { font-weight: 600; margin-left: 6px; }

/* Inhaltliche Suche: zweites Suchfeld unter dem ersten */
.search-content { margin-top: 8px; }

/* Verkauf: Kaufen am Bild, Warenkorb, Bestellung */
.buy-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.buy-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; margin: 0; padding-top: 8px; border-top: 1px solid var(--border); }
.buy-name { grid-column: 1 / -1; }
.buy-price { white-space: nowrap; font-weight: 600; }
.album-shop { margin: 8px 0 0; }
.cart-chip { text-decoration: none; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; color: inherit; font-size: .85rem; }
.cart-table td, .cart-table th { vertical-align: middle; }
.cart-table .num { text-align: right; white-space: nowrap; }
.cart-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; display: block; }
.cart-table .qty { width: 4.5rem; }
.pre-line { white-space: pre-line; }
.terms { margin: 0 0 10px; }
.terms summary { cursor: pointer; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.subnav a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: inherit; font-size: .9rem; }
.subnav a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.product-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.product-row input[name="name"] { flex: 2; min-width: 12rem; }
.product-row input[name="description"] { flex: 2; min-width: 10rem; }
.product-row .price { width: 6.5rem; flex: none; }
.product-row.inactive { opacity: .6; }
.chip.active { border-color: var(--accent); }
.product-row select { width: auto; flex: none; }
.product-row input, .product-row select { margin: 0; }
.kv dd { overflow-wrap: anywhere; }

/* Sicherung: Ordnerwahl und die Schritte der Borg-Einrichtung */
.backup-kind { margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 1rem; }
.folder-picker { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }
.folder-list { list-style: none; margin: 6px 0; padding: 0; max-height: 16rem; overflow-y: auto; }
.folder-list li { padding: 3px 0; overflow-wrap: anywhere; }
.folder-path { margin: 6px 0; }
#sicherung code, #sicherung dd { overflow-wrap: anywhere; }
#sicherung .pill { white-space: normal; }
#sicherung .form-actions { flex-wrap: wrap; }
.inline-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.inline-row input { margin: 0; flex: 1; min-width: 12rem; }
.inline-row .grow { flex: 3; }
.backup-form { margin: 10px 0 14px; max-width: 34rem; }
.backup-steps { padding-left: 20px; }
.backup-steps > li { margin: 0 0 14px; }
.keep-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.secret-once { border: 2px solid var(--warn); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0 16px; }
.secret-once textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .8rem; }
@media (max-width: 600px) { .keep-row { grid-template-columns: 1fr; } }

/* Nutzungsbedingungen, Meldungen zu Inhalten */
.terms-text { max-height: 28rem; overflow-y: auto; padding: 4px 2px; line-height: 1.55; }
.narrow { max-width: 40rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 14px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.report-grid figure { margin: 0; }
.report-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--border); display: block; }
.nav-count { display: inline-block; min-width: 1.4em; padding: 0 .4em; margin-left: .3em; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72em; line-height: 1.6; text-align: center; letter-spacing: 0; }

/* Webadressen (Studio: eigene Adresse, Betreiber: Übersicht) */
.form-actions.wrap { flex-wrap: wrap; }
.form-actions form { margin: 0; }
code.address { display: inline-block; background: var(--surface-2); padding: 6px 10px; border-radius: var(--radius); font-size: 1rem; overflow-wrap: anywhere; }
.address-steps li { margin-bottom: 10px; }
.address-steps li.done { color: var(--muted); }
.address-steps li.done > b::after { content: " ✓"; color: var(--ok); }
.dns-record { margin: 8px 0 4px; max-width: 640px; }
.dns-record code { overflow-wrap: anywhere; }

/* Abrechnung beim Betreiber: Kunden und Rechnungen */
.table th.num, .table td.num { text-align: right; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 14px; font-size: .88rem; }
.filter-row label { display: flex; align-items: center; gap: 6px; }
.panel h2 .btn-sm { float: right; font-weight: 400; }
.address-row-street { grid-template-columns: 1fr 110px; }
.address-row-city { grid-template-columns: 110px 1fr; }

/* Link: Eingang */
.inbox-table td { vertical-align: middle; }
.inbox-thumb { width: 64px; }
.inbox-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius); display: block; background: var(--border); }
