/* Admin gallery controls v3 fixed */
.gallery-categories {
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px;
  margin:14px 0 18px
}
.gallery-categories button {
  display:block;
  width:100%;
  border:1px solid #31463826;
  border-radius:16px;
  background:#fff;
  color:#314638;
  padding:13px 16px;
  text-align:left;
  font:700 20px Georgia,serif;
  cursor:pointer
}
.gallery-categories button small {
  display:block;
  margin-top:4px;
  color:#a0713c;
  font:500 12px system-ui,sans-serif
}
.gallery-categories button.on {
  background:#314638;
  color:#fff
}
.gallery-categories button.on small {
  color:#e3c89d
}
.pic-head {
  display:grid!important;
  grid-template-columns:auto auto minmax(0,1fr) auto!important;
  align-items:center;
  gap:9px;
  margin:-4px -2px 10px;
  padding:4px 2px 9px;
  border-bottom:1px solid #31463812
}
.head-select {
  display:flex!important;
  align-items:center;
  gap:5px;
  margin:0!important;
  font-size:12px;
  font-weight:600;
  white-space:nowrap
}
.head-select input {
  width:auto!important;
  margin:0
}
.drag-handle {
  position:static!important;
  width:30px;
  height:30px;
  border-radius:7px;
  display:grid!important;
  place-items:center;
  color:#a0713c;
  font-size:21px;
  cursor:grab;
  user-select:none
}
.drag-handle:hover {
  background:#a0713c12
}
.drag-handle:active {
  cursor:grabbing
}
.filename {
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:13px
}
.trash {
  position:static!important;
  border:0!important;
  background:transparent!important;
  color:#8f3535!important;
  width:32px!important;
  height:32px!important;
  border-radius:50%!important;
  display:grid!important;
  place-items:center;
  padding:6px!important
}
.trash svg {
  display:block;
  width:18px;
  height:18px;
  fill:currentColor
}
.trash:hover {
  background:#8f353518!important
}
.select-label {
  display:none!important
}
@media(max-width:650px) {
  .gallery-categories {
    grid-template-columns:1fr!important
  }
  .head-select span {
    display:none
  }
}
/* v4 fixes */
.gallery-toolbar {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap
}
.gallery-stats {
  margin-left:auto;
  padding:8px 11px;
  border-radius:999px;
  background:#fff;
  color:#536057;
  font-size:13px;
  font-weight:650;
  white-space:nowrap
}
.gallery-toolbar.bottom .gallery-stats {
  margin-left:auto
}
.pic-head {
  grid-template-columns:auto auto minmax(0,1fr) auto!important
}
.move-dialog select {
  display:block!important;
  width:100%!important;
  margin:7px 0 15px!important
}
.move-dialog .actions {
  justify-content:flex-end
}
@media(max-width:650px) {
  .gallery-stats {
    width:100%;
    margin-left:0;
    text-align:center
  }
}
/* v5 card header */
.pic-head {
  grid-template-columns:auto minmax(0,1fr) auto auto auto!important;
  gap:10px!important
}
.pic-head,.pic-head * {
  font-family:system-ui,-apple-system,Segoe UI,Arial,sans-serif;
  font-size:13px;
  font-weight:600
}
.pic-head .drag-handle {
  font-size:20px;
  font-weight:500
}
.pic-head .filename {
  font-size:13px!important;
  font-weight:600!important
}
.head-control {
  display:flex!important;
  align-items:center;
  gap:5px;
  margin:0!important;
  padding:0!important;
  white-space:nowrap;
  font-size:13px!important;
  font-weight:600!important
}
.head-control input {
  width:auto!important;
  margin:0!important
}
.pic-head .trash {
  font-size:13px!important
}
.field-label {
  font-size:12px!important;
  font-weight:650!important;
  color:#536057;
  margin:7px 0 3px!important
}
.select-label,.head-select {
  display:none!important
}
@media(max-width:720px) {
  .head-control span {
    display:none
  }
}
/* Aktuelles batch v2 */
.current-toolbar {
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin:12px 0
}
.current-toolbar.bottom {
  justify-content:flex-end;
  margin-top:18px
}
.event-list {
  display:grid;
  gap:12px
}
.event-card {
  margin:0
}
.event-head {
  display:grid;
  grid-template-columns:auto auto minmax(140px,1fr) auto;
  gap:9px;
  align-items:center;
  margin:-4px -2px 12px;
  padding:4px 2px 9px;
  border-bottom:1px solid #31463812
}
.event-drag {
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  color:#a0713c;
  font-size:21px;
  cursor:grab;
  border-radius:7px
}
.event-active {
  display:flex;
  align-items:center;
  gap:5px;
  margin:0;
  font-size:13px
}
.event-active input {
  width:auto;
  margin:0
}
.event-head-title {
  min-width:0;
  width:100%;
  border:0!important;
  background:transparent!important;
  padding:6px 8px!important;
  font-size:15px!important;
  font-weight:700!important;
  color:#314638;
  box-shadow:none!important
}
.event-head-title:focus {
  background:#fff!important;
  outline:1px solid #a0713c!important
}
.event-trash {
  border:0;
  background:transparent;
  color:#8f3535;
  width:32px;
  height:32px;
  border-radius:50%;
  display:grid;
  place-items:center;
  padding:6px
}
.event-trash svg {
  width:18px;
  height:18px;
  fill:currentColor
}
.event-trash:hover {
  background:#8f353518
}
.events-unsaved #saveEventsTop,.events-unsaved #saveEventsBottom {
  box-shadow:0 0 0 3px rgba(160,113,60,.28)
}
.check-dialog {
  position:fixed;
  inset:0;
  z-index:130;
  display:none;
  align-items:center;
  justify-content:center;
  background:#0008;
  padding:20px
}
.check-dialog.open {
  display:flex
}
.check-panel {
  width:min(700px,100%);
  height:min(600px,85vh);
  background:#f7f3ea;
  border-radius:18px;
  padding:18px;
  box-shadow:0 18px 50px #0004;
  display:grid;
  grid-template-rows:auto 1fr
}
.check-head {
  display:flex;
  align-items:center;
  justify-content:space-between
}
.check-head h3 {
  margin:0 0 12px;
  font-family:Georgia;
  color:#314638
}
.icon-close {
  border:0;
  background:transparent;
  font-size:28px;
  cursor:pointer
}
.check-panel iframe {
  width:100%;
  height:100%;
  border:1px solid #31463822;
  border-radius:10px;
  background:#fff
}
/* Authentication / management */
.login-wrap {
  max-width:520px
}
.login-card {
  padding:24px
}
.login-card .btn {
  margin-top:14px
}
.login-error {
  color:#8f3535;
  font-weight:700
}
.admin-top {
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  font-size:13px
}
.admin-modal {
  position:fixed;
  inset:0;
  z-index:140;
  display:none;
  align-items:center;
  justify-content:center;
  background:#0008;
  padding:20px
}
.admin-modal.open {
  display:flex
}
.admin-modal-panel {
  width:min(900px,100%);
  max-height:88vh;
  overflow:auto;
  background:#f7f3ea;
  border-radius:18px;
  padding:20px;
  box-shadow:0 18px 50px #0004
}
.log-content {
  display:grid;
  gap:6px
}
.log-row {
  display:grid;
  grid-template-columns:190px 120px 150px 1fr;
  gap:8px;
  padding:8px;
  border-bottom:1px solid #31463815;
  font-size:12px
}
.log-row code {
  white-space:pre-wrap;
  overflow-wrap:anywhere
}
.user-row {
  display:grid;
  grid-template-columns:1fr 100px 80px auto auto;
  gap:8px;
  align-items:center
}
@media(max-width:700px) {
  .log-row,.user-row {
    grid-template-columns:1fr
  }
  .admin-top {
    align-items:flex-start;
    flex-direction:column
  }
}
.setup-errors {
  background:#fde8e8;
  color:#7f1d1d;
  border:1px solid #f5bcbc;
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:15px
}
.setup-errors ul {
  margin:8px 0 0;
  padding-left:20px
}
.setup-errors li {
  margin:5px 0
}
.setup-status {
  margin-top:16px;
  font-size:13px;
  color:#536057;
  line-height:1.7
}
.setup-success {
  background:#e7f4e9;
  color:#275c30;
  border:1px solid #badbbf;
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:14px
}
.login-card small {
  display:block;
  color:#657067;
  margin:3px 0 8px;
  line-height:1.4
}
.admin-top-actions {
  display:flex;
  gap:8px;
  align-items:center
}
.admin-top .btn {
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center
}
@media(max-width:700px) {
  .admin-top-actions {
    width:100%;
    flex-wrap:wrap
  }
}

/* Aktuell Kopfzeile kompakt */
.event-head {
  grid-template-columns:auto auto auto minmax(120px,1fr) auto!important;
  gap:8px!important;
  align-items:center!important
}
.event-active,.event-until {
  display:flex!important;
  align-items:center!important;
  gap:5px!important;
  margin:0!important;
  white-space:nowrap!important;
  font-size:12px!important;
  font-weight:600!important
}
.event-active span,.event-until span {
  font-size:12px!important;
  font-weight:600!important
}
.event-until input[type=date] {
  box-sizing:border-box!important;
  width:118px!important;
  min-width:118px!important;
  max-width:118px!important;
  height:32px!important;
  padding:3px 5px!important;
  font-size:12px!important
}
.event-head-title {
  box-sizing:border-box!important;
  width:100%!important;
  min-width:80px!important;
  height:34px!important;
  padding:6px 9px!important;
  border:1px solid #31463855!important;
  border-radius:7px!important;
  background:#fff!important
}
.event-head-title:focus {
  border-color:#a36f32!important;
  outline:2px solid #a36f3222!important
}
@media(max-width:760px) {
  .event-head {
    grid-template-columns:auto auto auto 1fr auto!important
  }
  .event-until {
    grid-column:auto!important
  }
  .event-head-title {
    grid-column:auto!important
  }
  .event-until input[type=date] {
    width:108px!important;
    min-width:108px!important;
    max-width:108px!important
  }
}
/* Vorschauen */
.event-image-preview {
  position:relative;
  width:132px;
  aspect-ratio:1/1;
  border-radius:11px;
  overflow:hidden;
  background:#eee
}
.event-image-preview .thumb {
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  background:transparent!important;
  border-radius:0!important
}
.event-image-preview .event-image-delete {
  position:absolute;
  top:7px;
  right:7px;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  padding:5px;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.92);
  color:#8f3535;
  box-shadow:0 1px 5px #0003;
  opacity:0;
  transform:none;
  transition:opacity .15s ease,background .15s ease
}
.event-image-preview:hover .event-image-delete,.event-image-preview:focus-within .event-image-delete {
  opacity:1
}
.event-image-preview .event-image-delete:hover {
  background:#fff
}
@media(max-width:550px) {
  .event-image-preview {
    width:150px
  }
  .event-image-preview .event-image-delete {
    opacity:.88
  }
  .pic .grid {
    grid-template-columns:120px 1fr!important
  }
  .pic .gallery-thumb {
    width:120px!important;
    height:100%!important;
    min-height:88px!important
  }
}
/* Vorschau-Korrektur: Aktuell ohne Überlappung, Galerie ohne Beschnitt */
.event-card>.grid {
  grid-template-columns:150px minmax(0,1fr)!important;
  gap:16px!important;
  align-items:start!important
}
.event-image-area {
  width:150px!important;
  min-width:150px!important
}
.event-image-preview {
  width:132px!important;
  max-width:132px!important;
  aspect-ratio:1/1!important
}
.event-image-area input[type=file] {
  width:150px!important;
  max-width:150px!important;
  font-size:12px!important;
  padding:6px!important
}
.event-image-area label {
  width:150px!important
}
.pic .grid {
  grid-template-columns:120px minmax(0,1fr)!important;
  align-items:stretch!important;
  gap:12px!important
}
.pic .gallery-thumb {
  width:120px!important;
  height:100%!important;
  min-height:88px!important;
  max-height:none!important;
  object-fit:contain!important;
  object-position:center!important;
  background:#eee!important;
  border-radius:10px!important
}
@media(max-width:550px) {
  .event-card>.grid {
    grid-template-columns:150px minmax(0,1fr)!important
  }
  .event-image-area {
    width:150px!important
  }
  .pic .grid {
    grid-template-columns:110px minmax(0,1fr)!important
  }
  .pic .gallery-thumb {
    width:110px!important;
    height:100%!important;
    object-fit:contain!important
  }
}
.user-row {
  display:grid!important;
  grid-template-columns:minmax(110px,1fr) 105px auto minmax(180px,1fr) auto auto auto auto!important;
  gap:8px!important;
  align-items:center!important
}
.user-last-login {
  font-size:12px;
  color:#667
}
.btn.danger {
  color:#8b2f2f;
  border-color:#8b2f2f55
}
@media(max-width:900px) {
  .user-row {
    grid-template-columns:1fr 1fr!important
  }
  .user-last-login {
    grid-column:1/-1
  }
}
/* Benutzerverwaltung kompakt */
.user-row .btn {
  white-space:nowrap!important;
  padding-left:10px!important;
  padding-right:10px!important
}
.icon-user-delete {
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#9a3434;
  cursor:pointer
}
.icon-user-delete svg {
  width:18px;
  height:18px;
  fill:currentColor
}
.icon-user-delete:hover {
  background:#9a343414
}
.event-file-input {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  opacity:0!important;
  pointer-events:none!important
}
.event-file-choose {
  white-space:nowrap!important;
  width:auto!important;
  min-width:0!important;
  padding:6px 10px!important;
  font-size:12px!important
}
/* Eigener Benutzer + dauerhaft sichtbare Top-Buttons */
.user-status,.user-last-login {
  font-size:12px!important;
  font-weight:400!important;
  color:#667!important;
  line-height:1.25!important
}
.user-role-readonly {
  font-size:13px!important;
  padding:7px 9px;
  border:1px solid #31463822;
  border-radius:7px;
  background:#f2f0e8;
  color:#536057
}
.user-row.own-user {
  grid-template-columns:minmax(110px,1fr) 105px auto minmax(180px,1fr) auto!important
}
.topbar .btn,.tabs .btn,.tabs button,.head-actions .btn {
  background:#f7f4ec!important;
  border:1px solid #31463845!important;
  border-radius:8px!important;
  box-shadow:0 1px 2px #0000000b!important
}
.topbar .btn:hover,.tabs .btn:hover,.tabs button:hover,.head-actions .btn:hover {
  background:#fff!important;
  border-color:#31463880!important
}
@media(max-width:900px) {
  .user-row.own-user {
    grid-template-columns:1fr 1fr!important
  }
  .user-row.own-user .user-last-login {
    grid-column:1/-1
  }
}
/* Korrektur: nur oberste Account-Links als sichtbare Buttons; Tabs wieder Originalstil */
.tabs .btn,.tabs button,.head-actions .btn {
  background:initial!important;
  border:initial!important;
  border-radius:initial!important;
  box-shadow:initial!important
}
.tabs .btn:hover,.tabs button:hover,.head-actions .btn:hover {
  background:initial!important;
  border-color:initial!important
}
.topbar .btn {
  background:#f7f4ec!important;
  border:1px solid #31463845!important;
  border-radius:8px!important;
  box-shadow:0 1px 2px #0000000b!important;
  padding:7px 11px!important;
  text-decoration:none!important
}
.topbar .btn:hover {
  background:#fff!important;
  border-color:#31463880!important
}
/* Benutzerzeilen: feste Spalten, eigener Benutzer behaelt leere Aktionsplaetze */
.user-row,.user-row.own-user {
  grid-template-columns:minmax(110px,1fr) 105px 105px minmax(180px,1fr) 80px 88px 78px 34px!important;
  gap:8px!important;
  align-items:center!important
}
.user-row.own-user .change-pass {
  grid-column:5
}
.user-row.own-user .user-role-readonly {
  grid-column:2
}
.user-row .user-status {
  grid-column:3
}
.user-row .user-last-login {
  grid-column:4
}
.user-row .change-pass {
  grid-column:5
}
.user-row .force-pass {
  grid-column:6
}
.user-row .toggle-user {
  grid-column:7
}
.user-row .delete-user {
  grid-column:8
}
@media(max-width:900px) {
  .user-row,.user-row.own-user {
    grid-template-columns:1fr 1fr!important
  }
  .user-row>* {
    grid-column:auto!important
  }
  .user-row .user-last-login,.user-row.own-user .user-last-login {
    grid-column:1/-1!important
  }
}
/* Finale Navigation: Accountleiste wie Aktionsbutton, Hauptmenue wie Galerie-Kategorien */
.admin-top>a,.admin-top-actions>a {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:10px 15px!important;
  border:0!important;
  border-radius:99px!important;
  background:#ececec!important;
  color:#243128!important;
  font-weight:700!important;
  text-decoration:none!important;
  box-shadow:none!important;
  transform:none!important;
  filter:none!important
}
.admin-top>a:hover,.admin-top-actions>a:hover {
  background:#e3e3e3!important;
  box-shadow:0 3px 9px rgba(0,0,0,.10)!important;
  transform:translateY(-1px)!important
}
.admin-top>a:active,.admin-top-actions>a:active {
  transform:translateY(1px) scale(.98)!important
}
.tabs button {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:10px 15px!important;
  border:0!important;
  border-radius:99px!important;
  background:#e7e7e7!important;
  color:#243128!important;
  font-weight:700!important;
  box-shadow:none!important
}
.tabs button:hover {
  background:#dddddd!important
}
.tabs button.on {
  background:#314638!important;
  color:#fff!important
}
.tabs button.on:hover {
  background:#314638!important;
  color:#fff!important;
  filter:brightness(1.06)!important
}
/* Aktuell: Bildauswahl zentriert */
.event-image-area {
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important
}
.event-image-area .event-file-choose {
  display:inline-flex!important;
  align-self:center!important;
  justify-content:center!important;
  margin-top:8px!important
}

/* Music admin */
.music-admin-list{display:grid;gap:12px;margin-top:16px}.music-admin-card{display:grid;grid-template-columns:auto minmax(140px,1fr) minmax(180px,1.5fr) minmax(220px,1fr) auto;gap:10px;align-items:center}.music-admin-card audio{width:100%;height:36px}.music-admin-card input[type=file]{font-size:12px}@media(max-width:800px){.music-admin-card{grid-template-columns:1fr}.music-admin-card audio{width:100%}}

/* Music admin: same contained card layout as other editors */
#music{max-width:none}.music-admin-list{display:grid;gap:14px;margin-top:16px}.music-admin-card{display:grid;grid-template-columns:auto minmax(150px,1fr) minmax(190px,1.4fr);grid-template-areas:"active title subtitle" "player player player" "file file delete";gap:10px 14px;align-items:center;padding:16px 18px;border:1px solid rgba(49,70,56,.13);border-radius:14px;background:#fff;box-shadow:0 3px 12px rgba(36,49,40,.05)}.music-admin-card .event-active{grid-area:active}.music-admin-card input[name=title]{grid-area:title}.music-admin-card input[name=subtitle]{grid-area:subtitle}.music-admin-card audio{grid-area:player;width:100%;height:36px}.music-admin-card input[type=file]{grid-area:file;width:100%;font-size:12px}.music-admin-card .music-delete{grid-area:delete;justify-self:end}.music-admin-card input[name=title],.music-admin-card input[name=subtitle]{width:100%;min-width:0}@media(max-width:760px){.music-admin-card{grid-template-columns:auto 1fr;grid-template-areas:"active title" "subtitle subtitle" "player player" "file file" "delete delete"}.music-admin-card .music-delete{justify-self:start}}

/* Music admin width + controls v3 */
#music>.wrap{max-width:1120px;margin:0 auto;padding:0 28px}.music-admin-card{grid-template-columns:auto minmax(170px,.8fr) minmax(220px,1.2fr);max-width:100%;box-sizing:border-box}.music-file-input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}.music-file-choose{grid-area:file;justify-self:start;white-space:nowrap}.music-admin-card .music-delete{grid-area:delete;justify-self:end}.music-admin-card .music-delete svg{width:18px;height:18px;fill:currentColor}@media(max-width:760px){#music>.wrap{padding:0 16px}.music-admin-card{grid-template-columns:auto 1fr}.music-file-choose{justify-self:start}}

/* Music admin aligns with global admin content frame */
#music>.wrap{max-width:none!important;width:auto!important;margin:0!important;padding:0!important}.music-admin-list{width:100%;max-width:none}.music-admin-card{width:100%;max-width:none;margin:0}.music-admin-card .music-delete{width:32px;height:32px;border-radius:7px}

/* Stable admin viewport + final music width */
html{scrollbar-gutter:stable}#music>.wrap{max-width:1120px!important;width:100%!important;margin:0 auto!important;padding:0!important;box-sizing:border-box!important}.music-admin-list{width:100%!important}.music-admin-card{width:100%!important;box-sizing:border-box!important}@media(max-width:1180px){#music>.wrap{padding:0 18px!important}}

/* Dynamic gallery category editor */
.gallery-categories{align-items:stretch}.gallery-category-card{position:relative;display:grid;gap:2px;min-width:180px;flex:1;padding:11px 34px 10px 14px;border-radius:17px;background:#e7e7e7;border:1px solid transparent;cursor:pointer}.gallery-category-card.on{background:var(--green);color:#fff}.gallery-category-card input{width:100%;min-width:0;padding:0!important;border:0!important;background:transparent!important;color:inherit!important;box-shadow:none!important}.gallery-category-card .gallery-label{font-family:Georgia,serif;font-size:20px;font-weight:700}.gallery-category-card .gallery-sublabel{font-size:12px;color:#a56e2c!important}.gallery-category-card.on .gallery-sublabel{color:#efd296!important}.gallery-category-delete{position:absolute;right:7px;top:7px;width:27px;height:27px;border:0;border-radius:50%;background:rgba(255,255,255,.86);color:#8f3535;opacity:0;cursor:pointer}.gallery-category-card:hover .gallery-category-delete,.gallery-category-card:focus-within .gallery-category-delete{opacity:1}.gallery-category-delete svg{width:16px;height:16px;fill:currentColor}.gallery-add{margin-top:9px}@media(max-width:700px){.gallery-category-card{min-width:145px}.gallery-category-delete{opacity:.85}}

/* Gallery category cards final */
.gallery-categories{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px!important}.gallery-category-card{position:relative;display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;column-gap:8px;row-gap:1px;min-width:0!important;width:auto!important;padding:12px 14px!important;border-radius:17px!important;background:#e7e7e7!important;border:1px solid rgba(49,70,56,.06)!important;color:#243128!important;cursor:pointer;box-sizing:border-box}.gallery-category-card.on{background:var(--green)!important;color:#fff!important}.gallery-category-card input{grid-column:1;width:100%!important;min-width:0!important;padding:0!important;border:0!important;background:transparent!important;color:inherit!important;box-shadow:none!important;outline:none!important}.gallery-category-card .gallery-label{grid-row:1;font-family:Georgia,serif;font-size:20px!important;font-weight:700}.gallery-category-card .gallery-sublabel{grid-row:2;font-size:12px!important;color:#a56e2c!important}.gallery-category-card.on .gallery-sublabel{color:#efd296!important}.gallery-category-card input[readonly]{pointer-events:none}.gallery-category-hide{grid-column:2;grid-row:1/3;align-self:center;position:static!important;width:30px;height:30px;border:0;border-radius:50%;background:rgba(255,255,255,.72);color:#7c6042;cursor:pointer;font-size:16px}.gallery-category-card.is-hidden{opacity:.52}.gallery-category-card.is-hidden .gallery-category-hide{color:#8f3535}.gallery-add{margin-top:10px}@media(max-width:760px){.gallery-categories{grid-template-columns:1fr!important}}

/* Gallery cards v2: clean button layout */
.gallery-categories{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important}.gallery-category-card{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;min-width:0!important;padding:12px 12px 12px 15px!important;border:0!important;border-radius:17px!important;background:#e7e7e7!important;color:#243128!important;box-shadow:none!important;cursor:pointer!important}.gallery-category-card.on{background:var(--green)!important;color:#fff!important}.gallery-category-card.is-hidden{opacity:.52}.gallery-category-text{min-width:0;display:flex;flex-direction:column;gap:2px}.gallery-category-text strong{font-family:Georgia,serif;font-size:20px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gallery-category-text small{font-size:12px;line-height:1.2;color:#a56e2c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gallery-category-card.on small{color:#efd296}.gallery-category-actions{display:flex;align-items:center;gap:4px;margin-left:8px}.gallery-category-edit,.gallery-category-hide{position:static!important;display:inline-flex!important;align-items:center;justify-content:center;width:29px!important;height:29px!important;padding:5px!important;border:0!important;border-radius:50%!important;background:rgba(255,255,255,.72)!important;color:#526057!important;opacity:0;cursor:pointer}.gallery-category-card:hover .gallery-category-edit,.gallery-category-card:hover .gallery-category-hide,.gallery-category-card:focus-within .gallery-category-edit,.gallery-category-card:focus-within .gallery-category-hide{opacity:1}.gallery-category-edit svg,.gallery-category-hide svg{width:17px;height:17px;fill:currentColor}.gallery-category-hide:hover,.gallery-category-edit:hover{background:#fff!important}.gallery-add{display:inline-flex!important;margin-top:10px!important}@media(max-width:760px){.gallery-categories{grid-template-columns:1fr!important}.gallery-category-edit,.gallery-category-hide{opacity:.85}}

/* Gallery cards v3: authoritative final visuals */
.gallery-category-card.on{background:#314638!important;color:#fff!important}.gallery-category-card.on .gallery-category-text strong{color:#fff!important}.gallery-category-card.on .gallery-category-text small{color:#efd296!important}.gallery-category-hide{opacity:1!important}.gallery-category-edit{opacity:0}.gallery-category-card:hover .gallery-category-edit,.gallery-category-card:focus-within .gallery-category-edit{opacity:1}.gallery-category-card.is-hidden{opacity:.62}.gallery-category-card.is-hidden .gallery-category-hide{background:#fff!important;color:#9a3434!important}

.gallery-definition-panel{width:min(92vw,480px)!important}.gallery-definition-panel>label{display:block;margin:11px 0 5px;font-weight:700}.gallery-definition-panel>input{width:100%;box-sizing:border-box}.gallery-definition-panel .actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}

/* Gallery multi-select drag/drop and delayed image preview */
.pic-head {
  grid-template-columns: auto auto minmax(0,1fr) auto auto !important;
}
.gallery-select-control {
  order: 2;
}
.pic-head .filename {
  order: 3;
}
.pic-head .drag-handle {
  order: 1;
}
.pic-head label[title="Foto auf Website ausblenden"] {
  order: 4;
}
.pic-head .trash {
  order: 5;
}
.pic.drag-group-item {
  opacity: .52;
  outline: 2px dashed #a0713c;
  background: #fff8e9;
}
.gallery-group-dragging .pic.drag-group-item:first-of-type::after {
  content: "Ausgewählte Bilder werden gemeinsam verschoben";
  position: absolute;
  z-index: 4;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #314638;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.gallery-hover-preview {
  position: fixed;
  z-index: 500;
  inset: 50% auto auto 50%;
  transform: translate(-50%,-50%);
  width: min(78vw, 920px);
  max-height: 82vh;
  padding: 12px;
  border-radius: 18px;
  background: rgba(247,243,234,.98);
  box-shadow: 0 22px 70px rgba(0,0,0,.42);
  pointer-events: none;
  display: grid;
  gap: 8px;
}
.gallery-hover-preview img {
  display: block;
  width: 100%;
  max-height: calc(82vh - 48px);
  object-fit: contain;
  border-radius: 12px;
  background: #222;
}
.gallery-hover-preview div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #536057;
  font-size: 12px;
  text-align: center;
}
@media(max-width:720px) {
  .gallery-hover-preview { display:none }
  .pic-head { grid-template-columns:auto auto minmax(0,1fr) auto auto!important }
}

/* Visual state for selected and hidden gallery items */
.pic,.pic .pic-head{transition:opacity .18s ease,filter .18s ease,background-color .18s ease,border-color .18s ease,box-shadow .18s ease}
.pic.is-selected .pic-head{background:#edf3e8!important;box-shadow:inset 4px 0 0 #6f8a59}
.pic.is-selected:not(.is-hidden){border-color:#a9b99b}
.pic.is-hidden{opacity:.52;filter:saturate(.55)}
.pic.is-hidden .gallery-thumb{filter:grayscale(.28) saturate(.55)}
.pic.is-hidden .pic-head{background:#f0eee9!important}
.pic.is-hidden.is-selected{opacity:.68}
.pic.is-hidden.is-selected .pic-head{background:#e5ebdf!important;box-shadow:inset 4px 0 0 #6f8a59}
.pic.is-hidden:hover{opacity:.72}

/* Hidden gallery cards: extra pale distinction */
.pic.is-hidden{opacity:.30!important;filter:saturate(.30) grayscale(.22)!important}
.pic.is-hidden .gallery-thumb{filter:grayscale(.50) saturate(.28) brightness(1.10)!important}
.pic.is-hidden:hover{opacity:.44!important}
.pic.is-hidden.is-selected{opacity:.46!important}
