/* ===========================================================================
   Galerie – modernes, augenschonendes Dark-Theme
   =========================================================================== */
:root {
  --bg:        #0f1216;
  --surface:   #161a20;
  --surface-2: #1c222a;
  --surface-3: #232a34;
  --border:    #283039;
  --border-2:  #364150;
  --text:      #e7eaf0;
  --text-dim:  #b3bcc9;
  --muted:     #7e8896;
  --accent:    #5cc2bb;
  --accent-2:  #6fd0c9;
  --accent-d:  #3f9a93;
  --accent-ink:#04201e;
  --link:      #7cc4ef;
  --gold:      #f0b84a;
  --danger:    #e0686d;
  --danger-d:  #c2565b;
  --ok:        #5ec27e;

  --r-sm: 9px;
  --r:    13px;
  --r-lg: 18px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow:    0 8px 24px rgba(0,0,0,.38);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.5);
  --ring:      0 0 0 3px rgba(92,194,187,.30);

  --maxw: 1320px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(92,194,187,.06), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(124,196,239,.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; margin: .2em 0 .7em; }
h2 { font-size: 1.18rem; font-weight: 650; letter-spacing: -.01em; margin: 1.3em 0 .6em; }
h3 { font-size: 1rem; font-weight: 600; }
img { max-width: 100%; display: block; }
code { background: var(--surface-3); padding: .12em .42em; border-radius: 6px; font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.icon { vertical-align: -.18em; flex: none; }
::selection { background: rgba(92,194,187,.35); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #45505f; background-clip: content-box; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(16,19,24,.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; min-height: var(--topbar-h);
  padding: 9px 18px; display: flex; align-items: center; gap: 14px;
}
.brand {
  font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--text), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand:hover { text-decoration: none; opacity: .9; }
.search { position: relative; flex: 1; max-width: 440px; }
.search input {
  width: 100%; padding: 10px 14px 10px 38px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); color: var(--text); font-size: .95rem; transition: .18s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--surface-3); }
.search-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.usernav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.usernav a { color: var(--text-dim); padding: 7px 11px; border-radius: var(--r-sm); font-size: .92rem; font-weight: 500; transition: .15s; }
.usernav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.usernav .who { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; padding: 0 6px; font-size: .9rem; }
.btn-logout { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn { background: none; border: none; color: var(--text); cursor: pointer; padding: 7px; border-radius: var(--r-sm); display: none; }
.icon-btn:hover { background: var(--surface-2); }
.nav-toggle { display: none; }

/* ---------- Container / Footer ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 22px 18px 72px; }
.site-foot { border-top: 1px solid var(--border); color: var(--muted); text-align: center; padding: 26px; font-size: .85rem; }

/* ---------- Flash ---------- */
.flash { padding: 12px 15px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface); font-size: .94rem; display: flex; gap: 9px; align-items: center; }
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.flash-success { background: linear-gradient(0deg, rgba(94,194,126,.10), rgba(94,194,126,.10)), var(--surface); border-color: rgba(94,194,126,.4); }
.flash-success::before { background: var(--ok); }
.flash-error   { background: linear-gradient(0deg, rgba(224,104,109,.10), rgba(224,104,109,.10)), var(--surface); border-color: rgba(224,104,109,.4); }
.flash-error::before { background: var(--danger); }
.flash-info    { background: linear-gradient(0deg, rgba(124,196,239,.10), rgba(124,196,239,.10)), var(--surface); border-color: rgba(124,196,239,.4); }
.flash-info::before { background: var(--link); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text); font-size: .92rem; font-weight: 600;
  cursor: pointer; transition: .16s; text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.btn:hover { background: var(--surface-3); border-color: #404a59; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--accent-2), var(--accent-d)); border-color: transparent; color: var(--accent-ink); box-shadow: 0 4px 14px rgba(92,194,187,.28); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: transparent; border-color: rgba(224,104,109,.45); color: var(--danger); }
.btn-danger:hover { background: rgba(224,104,109,.14); border-color: rgba(224,104,109,.6); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: var(--r-sm); }
.link-btn { background: none; border: none; color: var(--link); cursor: pointer; padding: 0; font-size: .85rem; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* ---------- Forms ---------- */
.form .field, .field { display: block; margin-bottom: 15px; }
.field > span { display: block; margin-bottom: 6px; font-size: .85rem; color: var(--text-dim); font-weight: 500; }
input[type=text], input[type=password], input[type=search], input[type=number], textarea, select {
  width: 100%; padding: 10px 13px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm); font-size: .95rem; font-family: inherit; transition: .16s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 70px; }
select { cursor: pointer; }
.checkbox, .check { display: inline-flex; align-items: center; gap: 9px; color: var(--text-dim); cursor: pointer; font-size: .92rem; }
.check:hover { color: var(--text); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.pw-meter { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin: -7px 0 15px; }
.pw-meter span { display: block; height: 100%; width: 0; transition: .25s; background: var(--danger); border-radius: 4px; }
.form-actions { margin-top: 6px; }

/* ---------- Auth ---------- */
body.minimal { display: flex; flex-direction: column; min-height: 100vh; }
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 16px; }
.auth-card { width: 100%; max-width: 400px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px 30px; box-shadow: var(--shadow-lg); }
.auth-title { text-align: center; margin: 0 0 6px; font-size: 1.7rem; }
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: .92rem; }
.auth-alt { text-align: center; font-size: .9rem; margin-top: 18px; }
.auth-contact { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; text-align: center; line-height: 1.6; }

/* ---------- Toolbar (Filter/Sort) ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); font-size: .87rem; font-weight: 500; transition: .15s;
}
.chip:hover { border-color: var(--border-2); color: var(--text); text-decoration: none; }
.chip.is-active { background: linear-gradient(135deg, var(--accent-2), var(--accent-d)); border-color: transparent; color: var(--accent-ink); font-weight: 700; box-shadow: 0 3px 10px rgba(92,194,187,.25); }
.chip.sm { padding: 3px 11px; font-size: .8rem; }
.sorts { display: flex; gap: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; }
.sort { padding: 6px 13px; border-radius: var(--r-pill); font-size: .84rem; color: var(--muted); font-weight: 500; transition: .15s; }
.sort:hover { color: var(--text); text-decoration: none; }
.sort.is-active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.active-filter { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 9px 15px; margin-bottom: 16px; font-weight: 500; }
.active-filter .clear { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); margin-left: auto; }
.active-filter .clear:hover { color: var(--danger); text-decoration: none; }
.slideshow-bar { margin: 4px 0 18px; }

/* ---------- Section heads ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.more-link { font-size: .85rem; font-weight: 600; color: var(--accent); }

/* ---------- Grid / Cards (Masonry: Bilder behalten ihr Seitenverhältnis) ---------- */
.grid { columns: 4 250px; column-gap: 18px; }
.grid > * { break-inside: avoid; margin-bottom: 18px; display: block; }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; display: block; }
.card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); text-decoration: none; }
.card-thumb { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-thumb img { transform: scale(1.06); }
.card-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.35)); opacity: 0; transition: .2s; pointer-events: none; }
.card:hover .card-thumb::after { opacity: 1; }
.badge { position: absolute; background: rgba(8,10,13,.72); backdrop-filter: blur(4px); color: #fff; border-radius: 7px; font-size: .74rem; font-weight: 600; padding: 3px 7px; display: inline-flex; align-items: center; gap: 3px; }
.badge-dur { right: 7px; bottom: 7px; }
.badge-count { left: 7px; top: 7px; }
.badge-play { top: 50%; left: 50%; transform: translate(-50%,-50%); width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(8,10,13,.5); border: 1.5px solid rgba(255,255,255,.7); color: #fff; padding: 0 0 0 3px; transition: .2s; }
.card:hover .badge-play { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card-meta { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { color: var(--text); font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb { color: var(--gold); font-size: .82rem; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.rb-none { color: var(--muted); }
.rb small { color: var(--muted); font-weight: 400; }

/* ---------- Album-Karten ---------- */
.album-card .card-thumb { aspect-ratio: 4 / 3; }
.album-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--border-2); background: var(--surface-2); }
.album-owner { padding: 0 12px 11px; color: var(--muted); font-size: .78rem; display: flex; align-items: center; gap: 4px; margin-top: -4px; }
.album-meta { padding-bottom: 4px; }

/* ---------- Rail (horizontal) ---------- */
.rail-section { margin-bottom: 30px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 178px; gap: 16px; overflow-x: auto; padding: 4px 2px 12px; -webkit-overflow-scrolling: touch; }
.rail .card { margin-bottom: 0; }
.rail .card-thumb { aspect-ratio: 1 !important; }   /* in der Reihe einheitlich quadratisch */

/* ---------- Tag-Wolke ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tagc { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); line-height: 1.2; transition: .15s; }
.tagc:hover { border-color: var(--accent); color: var(--text); text-decoration: none; transform: translateY(-1px); }
.tagc small { color: var(--muted); font-size: .68em; }
.tagc-0 { font-size: .82rem; opacity: .9; }
.tagc-1 { font-size: .92rem; }
.tagc-2 { font-size: 1.02rem; }
.tagc-3 { font-size: 1.14rem; font-weight: 500; }
.tagc-4 { font-size: 1.28rem; font-weight: 600; color: var(--accent); }

/* ---------- Load more / Empty ---------- */
.load-more-wrap { text-align: center; margin: 28px 0; }
.empty { text-align: center; color: var(--muted); padding: 56px 20px; background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--r-lg); }
.empty p { margin: 8px 0; }

/* ---------- Item / Viewer ---------- */
.item-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.item-nav .spacer { flex: 1; }
.viewer { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 24px; align-items: start; }
.stage { background: #0a0c0f; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px; display: flex; align-items: center; justify-content: center; min-height: 340px; overflow: hidden; }
.stage img, .stage video { max-width: 100%; max-height: 78vh; width: auto; height: auto; border-radius: 8px; }
.side { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; position: sticky; top: calc(var(--topbar-h) + 14px); }
.item-title { font-size: 1.3rem; margin: 0 0 14px; }
.rating-box { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.stars { display: flex; gap: 1px; flex-wrap: wrap; }
.star { background: none; border: none; cursor: pointer; color: #3a424f; font-size: 1.55rem; line-height: 1; padding: 1px; transition: color .1s, transform .1s; }
.star:hover { transform: scale(1.18); }
.star.on { color: var(--gold); }
.star.hover { color: #ffcf72; }
.rating-info { font-size: .88rem; color: var(--muted); margin-top: 8px; }
.rating-info .ravg { color: var(--gold); font-weight: 800; font-size: 1.1rem; }
.item-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 11px 0; color: var(--muted); }
.item-desc { white-space: pre-wrap; color: var(--text-dim); }
.techmeta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: .86rem; }
.techmeta div { display: flex; flex-direction: column; gap: 1px; }
.techmeta dt { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
.techmeta dd { margin: 0; font-weight: 500; }

/* Favoriten-Button */
.fav-btn .icon-heart { transition: .15s; }
.fav-btn.is-active { color: var(--danger); border-color: rgba(224,104,109,.5); background: rgba(224,104,109,.1); }
.fav-btn.is-active .icon-heart { fill: var(--danger); }

/* Album-Menü ("＋ Album") */
.album-menu { position: relative; display: inline-block; }
.album-menu > summary { list-style: none; }
.album-menu > summary::-webkit-details-marker { display: none; }
.album-menu-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 250px; max-width: 78vw; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 9px; }
.album-menu-pop .check { font-size: .9rem; }
.album-new { display: flex; gap: 6px; margin-top: 4px; padding-top: 9px; border-top: 1px solid var(--border); }
.album-new input { padding: 7px 10px; font-size: .88rem; }

/* ---------- Comments ---------- */
.comments { margin-top: 34px; max-width: 780px; }
.comment-form textarea { margin-bottom: 9px; }
.comment-list { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 13px 15px; transition: .15s; }
.comment:hover { border-color: var(--border-2); }
.comment.is-hidden { opacity: .55; }
.comment-head { display: flex; gap: 10px; align-items: center; font-size: .85rem; margin-bottom: 6px; }
.comment-head .cu { font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.comment-head .ct { color: var(--muted); }
.comment-body { white-space: pre-wrap; word-break: break-word; color: var(--text-dim); }
.comment-actions { display: flex; gap: 15px; margin-top: 9px; }
.edit-area { margin-top: 8px; }
.edit-area textarea { margin-bottom: 8px; }

/* ---------- Album-Seite ---------- */
.album-header { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 18px; }
.album-header h1 { margin: 0 0 6px; }
.album-header .rating-box { border-bottom: none; padding-bottom: 0; margin: 14px 0 0; }
.album-edit { margin-bottom: 18px; }
.album-edit > summary { list-style: none; display: inline-flex; }
.album-edit > summary::-webkit-details-marker { display: none; }
.album-edit-pop { margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; max-width: 540px; }
.album-grid .album-item { position: relative; }
.album-ctrls { position: absolute; top: 7px; right: 7px; display: flex; gap: 4px; z-index: 3; opacity: 0; transition: .15s; }
.album-item:hover .album-ctrls, .album-ctrls:focus-within { opacity: 1; }
.album-ctrls button { width: 30px; height: 30px; border-radius: 8px; border: none; background: rgba(8,10,13,.78); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.album-ctrls button:hover { background: var(--accent); color: var(--accent-ink); }
.album-ctrls button.done { background: var(--gold); color: #2a1e00; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(6,8,11,.94); backdrop-filter: blur(2px); }
.lightbox[hidden] { display: none; }
.lb-scroll { position: absolute; inset: 0; overflow: auto; padding: 56px 18px 28px; -webkit-overflow-scrolling: touch; }
.lb-content { max-width: 1180px; margin: 0 auto; }
.lb-content .viewer { margin-top: 0; }
.lb-content .stage { background: transparent; border: none; }
.lb-content .side { position: static; }
.lb-content .stage img.zoomable { cursor: zoom-in; will-change: transform; }
.lb-content .stage.zoomed img.zoomable { cursor: grab; }
.lb-loading { color: var(--muted); text-align: center; padding: 70px 0; }
.lb-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 131; background: rgba(255,255,255,.1); opacity: 0; transition: opacity .2s; }
.lb-progress.on { opacity: 1; }
.lb-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.lb-close { position: fixed; top: 12px; right: 16px; z-index: 130; width: 40px; height: 40px; background: rgba(28,34,42,.7); border: 1px solid var(--border-2); border-radius: 50%; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lb-close:hover { background: var(--surface-3); }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); z-index: 125; width: 48px; height: 48px; border-radius: 50%; background: rgba(28,34,42,.6); border: 1px solid var(--border-2); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .15s; }
.lb-nav:hover { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.lb-nav[disabled] { opacity: .25; cursor: default; pointer-events: none; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-tools { position: fixed; top: 12px; left: 16px; z-index: 130; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.lb-tool { background: rgba(28,34,42,.7); border: 1px solid var(--border-2); color: #fff; border-radius: var(--r-sm); padding: 8px 11px; cursor: pointer; font-size: .85rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.lb-tool:hover { background: var(--surface-3); }
.lb-tool.is-active { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.lb-sel { width: auto; background: rgba(28,34,42,.7); border: 1px solid var(--border-2); color: #fff; border-radius: var(--r-sm); padding: 8px 9px; font-size: .85rem; cursor: pointer; }
.lb-tool .ic-pause, .lb-tool .ic-min { display: none; }
.lb-tool.is-active .ic-play { display: none; }
.lb-tool.is-active .ic-pause { display: inline-flex; }
.lb-tool.is-fs .ic-exp { display: none; }
.lb-tool.is-fs .ic-min { display: inline-flex; }
.lightbox:-webkit-full-screen { width: 100%; height: 100%; background: #000; }
.lightbox:fullscreen { width: 100%; height: 100%; background: #000; }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 22px; padding-bottom: 1px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.atab { white-space: nowrap; padding: 11px 15px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; font-size: .92rem; transition: .15s; }
.atab:hover { color: var(--text); text-decoration: none; }
.atab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px,1fr)); gap: 13px; margin-bottom: 24px; }
.stat { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; text-align: center; }
.stat.highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.stat-num { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat-lbl { color: var(--muted); font-size: .8rem; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; }

.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 15px; margin-bottom: 20px; }
.row-form input[type=text], .row-form select { width: auto; flex: 1; min-width: 170px; }
.mini-field { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: .88rem; }
.mini-field input, .mini-field select { width: auto; }
.inline-search { display: flex; gap: 8px; margin-bottom: 18px; max-width: 460px; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
.row-hidden { opacity: .5; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-edit { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-right: 8px; }
.inline-edit input[type=text] { width: auto; min-width: 150px; }
.mini { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.mini input[type=text] { width: auto; min-width: 135px; }
.pill { font-size: .73rem; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); display: inline-block; }
.pill.ok { background: rgba(94,194,126,.16); color: var(--ok); }
.pill.off { background: rgba(126,134,150,.18); color: var(--muted); }
.copy { cursor: pointer; }
.copy:hover { color: var(--accent); }
.comment-cell { max-width: 420px; }

/* admin import */
.import-shared { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.import-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 14px 0; }
.import-progress { margin: 12px 0; }
.import-progress .bar { height: 9px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.import-progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-d), var(--accent-2)); transition: width .2s; }
.import-progress .txt { margin-top: 7px; font-size: .88rem; }
.file-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r); max-height: 470px; overflow: auto; background: var(--surface); }
.file-list li { border-bottom: 1px solid var(--border); padding: 9px 13px; }
.file-list li:last-child { border-bottom: none; }
.file-list li:hover { background: var(--surface-2); }
.file-list .check { width: 100%; }
.ftype { font-size: .7rem; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: var(--surface-3); color: var(--muted); }
.ftype-video { color: var(--accent); }
.fname { flex: 1; word-break: break-all; }

/* admin media grid */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px,1fr)); gap: 16px; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; transition: .15s; }
.admin-card:hover { border-color: var(--border-2); }
.admin-thumb { position: relative; display: block; aspect-ratio: 1; background: var(--surface-2); }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-thumb .thumb-link { display: block; width: 100%; height: 100%; }
.admin-card-body { padding: 10px 12px; }
.ac-title { font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-meta { font-size: .8rem; margin: 3px 0 9px; }
.ac-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Stapel-Aktionen */
.bulk-bar { position: sticky; top: calc(var(--topbar-h) + 4px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r); padding: 11px 15px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.bulk-assign { position: relative; }
.bulk-assign > summary { cursor: pointer; list-style: none; padding: 6px 11px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface-3); font-size: .85rem; font-weight: 500; }
.bulk-assign > summary::-webkit-details-marker { display: none; }
.bulk-pop { position: absolute; top: 116%; left: 0; z-index: 30; width: 290px; max-width: 80vw; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 11px; }
.bulk-pop .checks { flex-direction: column; gap: 9px; max-height: 220px; overflow: auto; }
.sel-wrap { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(8,10,13,.6); border-radius: 7px; padding: 4px; line-height: 0; backdrop-filter: blur(3px); }
.sel-wrap input { width: 19px; height: 19px; }

/* admin edit */
.edit-head { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.edit-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.edit-preview { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; position: sticky; top: calc(var(--topbar-h) + 14px); }
.edit-preview img { border-radius: var(--r-sm); margin-bottom: 12px; width: 100%; object-fit: contain; background: var(--surface-2); }
.danger-zone { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0; }
.page { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-dim); font-size: .88rem; font-weight: 500; }
.page:hover { border-color: var(--border-2); color: var(--text); text-decoration: none; }
.page.is-active { background: linear-gradient(135deg, var(--accent-2), var(--accent-d)); border-color: transparent; color: var(--accent-ink); }

/* ---------- Organisieren-Modus ---------- */
.org-card { cursor: pointer; }
.org-card.needs-cat { outline: 2px solid rgba(92,194,187,.55); outline-offset: -2px; }
.needs-badge { position: absolute; top: 7px; left: 7px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.org-modal { position: fixed; inset: 0; z-index: 100; background: rgba(6,8,11,.95); }
.org-modal[hidden] { display: none; }
.org-modal-inner { display: flex; width: 100%; height: 100%; }
.org-close { position: absolute; top: 10px; right: 16px; z-index: 3; background: rgba(28,34,42,.7); border: 1px solid var(--border-2); border-radius: 50%; width: 38px; height: 38px; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.org-stage { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 18px; }
.org-stage img, .org-stage video { max-width: 100%; max-height: 100%; border-radius: 10px; background: #000; }
.org-panel { width: 350px; flex: none; background: var(--surface); border-left: 1px solid var(--border); padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.org-panel .field { margin: 0; }
.org-cats h3 { margin: 2px 0 9px; }
.org-cats .checks { flex-direction: column; gap: 10px; max-height: 38vh; overflow: auto; padding: 2px; }
.org-nav { display: flex; gap: 8px; }
.org-nav .btn { flex: 1; }
.org-pos { text-align: center; color: var(--muted); font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .viewer { grid-template-columns: 1fr; }
  .side { position: static; }
  .edit-wrap { grid-template-columns: 1fr; }
  .edit-preview { position: static; }
  .import-shared { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .org-modal-inner { flex-direction: column; }
  .org-stage { max-height: 48vh; padding: 10px; }
  .org-panel { width: auto; border-left: none; border-top: 1px solid var(--border); }
  .org-cats .checks { max-height: none; }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  .nav-toggle { display: inline-flex; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .usernav {
    display: none; order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch;
    gap: 2px; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--border);
  }
  .usernav a { padding: 11px 12px; }
  body.nav-open .usernav { display: flex; }
  .grid { columns: 2; column-gap: 11px; }
  .grid > * { margin-bottom: 11px; }
  .admin-grid { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 11px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .sorts { overflow-x: auto; scrollbar-width: none; }
  .sorts::-webkit-scrollbar { display: none; }
  .stage img, .stage video { max-height: 62vh; }
  .star { font-size: 1.75rem; padding: 2px; }
  .lb-nav { top: auto; bottom: 14px; transform: none; width: 44px; height: 44px; }
  .lb-tool .lbl { display: none; }
  .lb-tools { top: 8px; left: 10px; }
  .lb-scroll { padding: 52px 10px 18px; }
  .container { padding: 16px 13px 64px; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(112px,1fr)); }
  .table { font-size: .9rem; display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .table th, .table td { padding: 9px 10px; }
  .comment-cell { white-space: normal; min-width: 200px; }
  .btn { padding: 10px 16px; }                 /* größere Touch-Ziele */
  .item-actions .btn { flex: 1 1 auto; }
  .auth-card { padding: 26px 20px; }
  .album-ctrls { opacity: 1; }                 /* auf Touch immer sichtbar */
  .lb-close { top: 8px; right: 10px; }
}

/* ---------- Suchvorschläge ---------- */
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; max-height: 60vh; overflow-y: auto; }
.sg-label { padding: 8px 14px 4px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; color: var(--text); font-size: .92rem; }
.sg-row:hover { background: var(--surface-3); text-decoration: none; }
.sg-primary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-secondary { color: var(--muted); font-size: .8rem; flex: none; }

/* ---------- Navigation: Feed-Badge ---------- */
.nav-feed { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.nav-badge { background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 800; border-radius: var(--r-pill); padding: 1px 7px; line-height: 1.5; }

/* ---------- Feed / Profil ---------- */
.feed-section { margin-bottom: 34px; }
.feed-comments { display: flex; flex-direction: column; gap: 10px; max-width: 780px; }
.feed-comment { display: flex; gap: 13px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 11px 13px; color: var(--text); transition: .15s; }
.feed-comment:hover { border-color: var(--border-2); text-decoration: none; transform: translateY(-1px); }
.feed-comment img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-sm); flex: none; background: var(--surface-2); }
.fc-body { min-width: 0; }
.fc-head { display: flex; flex-wrap: wrap; gap: 7px; align-items: baseline; font-size: .87rem; margin-bottom: 3px; }
.fc-text { color: var(--text-dim); font-size: .92rem; overflow-wrap: break-word; }
.profile-header { display: flex; align-items: center; gap: 18px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 18px; }
.profile-header h1 { margin: 0 0 4px; }
.profile-avatar { width: 72px; height: 72px; flex: none; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-2); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.comment-head .cu { color: var(--text); }
.comment-head a.cu:hover { color: var(--accent); text-decoration: none; }

/* ---------- Aufräumen-Vorschau ---------- */
.cleanup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cleanup-item { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.cleanup-item img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); display: block; }
.cleanup-item figcaption { padding: 7px 9px; font-size: .76rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cleanup-item figcaption .muted { display: block; font-size: .72rem; }

/* ---------- Barrierefreiheit / Feinheiten ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
summary { cursor: pointer; }

.lightbox:not([hidden]) { animation: lbIn .18s ease; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb-content .viewer { animation: lbContentIn .22s ease; }
@keyframes lbContentIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
