/* Digitana Social - Galerie Grundoptik + Profilreiter V5 (konsolidiert)
   Ableitung aus music.css. Sichtbarkeit nutzt das bestehende
   ds-profile-post-visibility-picker Overlay, keine eigenen runden Controls.
   Kommentare/Reaktionen verwenden die geteilten Klassen aus comments.css /
   reactions.css - hier stehen nur Galerie-spezifische Layout-Ergänzungen. */

/* ── Shell ─────────────────────────────────────────────────────────────── */

.ds-gallery-shell {
  position: relative;
  width: 100%;
  color: #f2f5f7;
  --ds-profile-accent: #20a9ff;
  --ds-profile-edit-accent: var(--ds-profile-accent, #20a9ff);
  align-self: stretch;
  justify-self: stretch;
  margin: 0;
  padding: 18px 28px 30px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(245, 252, 255, 0.14), transparent 34%),
    radial-gradient(ellipse at 76% 9%, rgba(215, 232, 242, 0.10), transparent 39%),
    linear-gradient(135deg, rgba(52, 68, 82, 0.24) 0%, rgba(12, 22, 31, 0.52) 35%, rgba(0, 0, 0, 0.96) 100%);
}

.ds-gallery-hub-layout,
.ds-gallery-hub-main { width: 100%; min-width: 0; }
.ds-gallery-hub-main { padding: 0; background: transparent; }

/* ── Topbar ─────────────────────────────────────────────────────────────── */

.ds-gallery-topbar {
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 9px 14px;
  margin: 0 0 14px;
  border: 0;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 10% 0%, color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 12%, transparent), transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,0.045), rgba(0,0,0,0.22) 58%, rgba(0,0,0,0.38));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 16%, rgba(215,223,229,0.06)),
    inset 0 14px 24px rgba(215,223,229,0.018),
    0 0 18px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 8%, transparent);
}

.ds-gallery-topbar::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 40%, transparent), rgba(235,248,255,0.72), color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 38%, transparent), transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 32%, transparent);
  pointer-events: none;
}

.ds-gallery-topbar-text {
  margin: 0;
  color: #e1e6ea;
  line-height: 1.35;
  text-shadow: 0 1px 0 #000000;
}

.ds-gallery-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

/* ── Buttons (Hauptseite, blau) ─────────────────────────────────────────── */

.ds-gallery-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 7px 18px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(226,242,252,0.30), color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 36%, rgba(20,38,52,0.42)), rgba(3,13,23,0.90) 74%);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  box-shadow:
    0 0 16px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 24%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.24),
    inset 0 -8px 15px rgba(0,0,0,0.34);
}

.ds-gallery-primary-link:hover,
.ds-gallery-primary-link:focus-visible {
  outline: none;
  color: #ffffff;
  text-decoration: none;
  box-shadow:
    0 0 22px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 36%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -8px 15px rgba(205,214,221,0.10);
}

/* ── Suche ──────────────────────────────────────────────────────────────── */

.ds-gallery-search {
  position: relative;
  z-index: 700;
  overflow: visible;
  width: min(100%, calc(100% - 72px));
  max-width: 980px;
  margin: 12px auto 24px;
  padding: 9px 11px;
  border: 1px solid rgba(205,214,221,0.24);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(58,63,70,0.96), rgba(18,22,27,0.98) 48%, rgba(4,6,9,0.99));
  box-shadow:
    0 11px 22px rgba(0,0,0,0.36),
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -11px 18px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.06);
}

.ds-gallery-search::before,
.ds-gallery-search::after {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  height: 1px;
  border-radius: 999px;
  pointer-events: none;
}
.ds-gallery-search::before { top: 0; background: linear-gradient(90deg, transparent, rgba(245,248,250,0.62), rgba(118,126,134,0.70), transparent); }
.ds-gallery-search::after  { bottom: 0; background: linear-gradient(90deg, transparent, rgba(205,214,221,0.52), rgba(12,14,17,0.90), transparent); }

.ds-gallery-search-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.ds-gallery-search-input-wrap { position: relative; min-width: 0; }

.ds-gallery-search-form input {
  width: 100%;
  min-height: 34px;
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(38,43,49,0.94), rgba(3,5,8,0.98));
  color: #f2f5f7;
  outline: none;
  font: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(205,214,221,0.24),
    inset 0 8px 13px rgba(0,0,0,0.48),
    0 0 10px rgba(205,214,221,0.08);
}
.ds-gallery-search-form input::placeholder { color: rgba(225,230,234,0.60); }
.ds-gallery-search-form input:focus {
  box-shadow:
    inset 0 0 0 1px rgba(245,248,250,0.46),
    inset 0 8px 13px rgba(0,0,0,0.48),
    0 0 14px rgba(205,214,221,0.18);
}

.ds-gallery-search-submit {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #f7fbff;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(82,88,96,0.92), rgba(24,28,34,0.98) 48%, rgba(5,7,10,0.99));
  box-shadow:
    inset 0 0 0 1px rgba(225,230,234,0.24),
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -7px 13px rgba(0,0,0,0.36),
    0 0 11px rgba(205,214,221,0.12);
  text-shadow: 0 1px 0 #000000;
}
.ds-gallery-search-submit:hover,
.ds-gallery-search-submit:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(245,248,250,0.38),
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -7px 13px rgba(0,0,0,0.34),
    0 0 16px rgba(205,214,221,0.20);
}

/* ── Feed / Category Grid ───────────────────────────────────────────────── */

.ds-gallery-feed { margin: 0 0 22px; overflow: visible; }
.ds-gallery-search-results[hidden],
.ds-gallery-category-grid[hidden] { display: none !important; }

.ds-gallery-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.ds-gallery-category { min-width: 0; overflow: visible; }
.ds-gallery-feed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); align-items: start; gap: 16px; overflow: visible; }
.ds-gallery-album-grid { gap: 14px; }
.ds-gallery-image-grid { gap: 10px; }

/* ── Section Title ──────────────────────────────────────────────────────── */

.ds-gallery-section-title {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  gap: 14px;
  align-items: center;
  margin: 4px 0 10px;
}

.ds-gallery-section-title h2,
.ds-gallery-section-title-small h2 {
  margin: 0;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  text-shadow:
    0 0 8px rgba(215,223,229,0.52),
    0 0 15px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 34%, transparent),
    0 1px 0 #000;
}
.ds-gallery-section-title h2 { font-size: 1.02rem; }
.ds-gallery-section-title-small h2 { font-size: 0.95rem; }

.ds-gallery-section-title span {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(215,223,229,0.72), color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 46%, transparent), transparent);
  box-shadow: 0 0 11px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 32%, transparent);
}

.ds-gallery-section-note { margin: 0 0 14px; color: #d9e0e5; font-size: 0.82rem; }

.ds-gallery-empty-line,
.ds-gallery-muted {
  margin: 0;
  color: #e1e6ea;
  line-height: 1.55;
  text-shadow: 0 1px 0 #000000;
}

/* ── Karten ─────────────────────────────────────────────────────────────── */

.ds-gallery-card,
.ds-gallery-album-card,
.ds-gallery-image-card,
.ds-profile-gallery-card {
  position: relative;
  overflow: visible;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  width: min(100%, 420px);
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 12% 0%, color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 10%, transparent), transparent 44%),
    linear-gradient(135deg, rgba(232,241,247,0.070), rgba(0,0,0,0.34) 56%, rgba(0,0,0,0.52));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 36%, rgba(215,223,229,0.16)),
    inset 0 10px 22px rgba(215,223,229,0.018),
    0 0 16px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 12%, transparent);
}

.ds-gallery-card[hidden] { display: none !important; }

.ds-gallery-album-card:hover,
.ds-gallery-image-card:hover,
.ds-profile-gallery-card:hover {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 52%, rgba(235,248,255,0.24)),
    inset 0 10px 22px rgba(215,223,229,0.025),
    0 0 22px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 20%, transparent);
}

.ds-gallery-card + .ds-gallery-card::before,
.ds-gallery-album-card + .ds-gallery-album-card::before,
.ds-gallery-image-card + .ds-gallery-image-card::before,
.ds-profile-gallery-card + .ds-profile-gallery-card::before {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: -12px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 34%, transparent), rgba(235,248,255,0.72), color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 32%, transparent), transparent);
  box-shadow: 0 0 13px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 28%, transparent);
  pointer-events: none;
}

.ds-gallery-card-media { display: grid; gap: 8px; align-content: start; justify-items: stretch; min-width: 0; overflow: visible; }

.ds-gallery-cover,
.ds-gallery-album-cover-link,
.ds-gallery-image-card > a,
.ds-profile-gallery-card .ds-profile-module-cover-link {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: radial-gradient(ellipse at 30% 10%, rgba(235,248,255,0.22), transparent 55%), #050b12;
  box-shadow:
    0 0 10px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 28%, transparent),
    inset 0 0 0 1px rgba(215,223,229,0.22);
}

.ds-gallery-album-cover,
.ds-gallery-image-card img,
.ds-profile-gallery-card .ds-profile-module-cover-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ds-gallery-cover-placeholder,
.ds-gallery-album-cover-placeholder,
.ds-gallery-image-placeholder,
.ds-profile-gallery-card .ds-profile-module-cover-placeholder {
  font-size: 2rem;
  text-shadow: 0 0 16px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 46%, transparent);
}

.ds-gallery-card-main,
.ds-gallery-album-body,
.ds-profile-gallery-card .ds-profile-module-card-body { min-width: 0; }

.ds-gallery-card-head { display: block; margin: 0 0 6px; }

.ds-gallery-card-titleblock h3,
.ds-gallery-album-body h3,
.ds-profile-gallery-card h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 7px rgba(215,223,229,0.45),
    0 0 12px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 22%, transparent),
    0 1px 0 #000;
}

.ds-gallery-card-titleblock h3 a,
.ds-gallery-album-body h3 a,
.ds-profile-gallery-card h3 a { color: #fff; text-decoration: none; }

.ds-gallery-card-meta,
.ds-gallery-album-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  padding-bottom: 1px;
}

.ds-gallery-card-meta,
.ds-gallery-album-meta,
.ds-gallery-album-body p,
.ds-gallery-image-card p,
.ds-profile-gallery-card p,
.ds-profile-gallery-tab .ds-profile-muted-small {
  margin: 4px 0;
  color: #e1e6ea;
  font-size: 0.82rem;
  line-height: 1.35;
}

.ds-gallery-owner-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 7px 3px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none;
  background: color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 12%, rgba(0,0,0,0.36));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 54%, rgba(245,248,250,0.22)),
    0 0 10px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 24%, transparent);
  text-shadow: 0 1px 0 #000, 0 0 7px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 30%, transparent);
}
.ds-gallery-owner-chip:hover,
.ds-gallery-owner-chip:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(245,248,250,0.42),
    0 0 14px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 36%, transparent);
}

.ds-gallery-info-divider {
  width: 100%;
  height: 1px;
  grid-column: 1 / -1;
  margin: 7px 0 6px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 28%, rgba(215,223,229,0.22)), rgba(245,248,250,0.34), transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 16%, transparent);
}

.ds-gallery-description {
  margin: 4px 0;
  color: #f2f5f7;
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Karten-Aktionszeile (Kommentare, Reaktionen, Melden) */
.ds-gallery-card-action-block { grid-column: 1 / -1; margin-top: 0; width: 100%; overflow: visible; }
.ds-gallery-card-action-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; width: 100%; overflow: visible; }
.ds-gallery-card-action-left,
.ds-gallery-card-action-right { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 7px 9px; min-width: 0; overflow: visible; }
.ds-gallery-card-action-left { flex: 1 1 auto; position: relative; justify-content: flex-start; }
.ds-gallery-card-action-right { flex: 0 0 auto; justify-content: flex-end; margin-left: auto; }
.ds-gallery-inline-form { display: inline-flex; align-items: center; margin: 0; }

.ds-gallery-card .ds-profile-icon-link,
.ds-gallery-detail .ds-profile-icon-link,
.ds-gallery-album-header .ds-profile-icon-link {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  background:
    radial-gradient(ellipse at 24% 0%, rgba(255,255,255,0.24), transparent 54%),
    linear-gradient(135deg, rgba(230,235,239,0.24), rgba(8,12,16,0.98) 76%);
  box-shadow:
    inset 0 0 0 1px rgba(225,230,234,0.20),
    0 0 10px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 18%, transparent);
  font: inherit;
  line-height: 1;
}
.ds-gallery-card .ds-profile-icon-link:hover,
.ds-gallery-card .ds-profile-icon-link:focus-visible,
.ds-gallery-detail .ds-profile-icon-link:hover,
.ds-gallery-album-header .ds-profile-icon-link:hover {
  outline: none;
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(245,248,250,0.34),
    0 0 14px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 30%, transparent);
}
.ds-gallery-card .ds-profile-reaction-picker { position: relative; z-index: 18; }
.ds-gallery-card .ds-profile-reaction-picker[open] { z-index: 600; }
.ds-gallery-card .ds-profile-reaction-popover { z-index: 620; left: 0; top: calc(100% + 8px); }
.ds-gallery-card:has(.ds-profile-reaction-picker[open]) { z-index: 90; }
.ds-gallery-card .ds-profile-reaction-picker[open] .ds-profile-reaction-popover { display: block; }

/* ── Panels (album_detail, image_detail) ────────────────────────────────── */

.ds-gallery-backnav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 14px;
  margin: 0 0 14px;
  border: 0;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 10% 0%, color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 8%, transparent), transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,0.035), rgba(0,0,0,0.28) 58%, rgba(0,0,0,0.42));
  box-shadow:
    inset 0 0 0 1px rgba(215,223,229,0.12),
    0 0 14px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 6%, transparent);
}

.ds-gallery-album-header,
.ds-gallery-panel,
.ds-gallery-detail {
  position: relative;
  overflow: visible;
  padding: 12px 14px 14px;
  margin: 0 0 14px;
  border: 0;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 10% 0%, color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 10%, transparent), transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,0.045), rgba(0,0,0,0.22) 58%, rgba(0,0,0,0.38));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 14%, rgba(215,223,229,0.06)),
    inset 0 14px 24px rgba(215,223,229,0.018),
    0 0 18px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 8%, transparent);
}

.ds-gallery-album-header::after,
.ds-gallery-panel::after,
.ds-gallery-detail::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 40%, transparent), rgba(235,248,255,0.72), color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 38%, transparent), transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 32%, transparent);
  pointer-events: none;
}

.ds-gallery-album-header h1,
.ds-gallery-detail h1 {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow:
    0 0 8px rgba(215,223,229,0.52),
    0 0 15px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 34%, transparent),
    0 1px 0 #000;
}

.ds-gallery-album-header p,
.ds-gallery-detail p { color: #e1e6ea; font-size: 0.82rem; line-height: 1.45; margin: 4px 0 0; }

/* Bild-Vollansicht */
.ds-gallery-detail-image {
  overflow: hidden;
  border-radius: 10px;
  margin: 0 0 14px;
  background: radial-gradient(ellipse at 30% 10%, rgba(235,248,255,0.14), transparent 55%), #050b12;
  box-shadow:
    0 0 10px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 18%, transparent),
    inset 0 0 0 1px rgba(215,223,229,0.14);
}
.ds-gallery-detail-image img {
  width: 100%;
  max-height: 72vh;
  display: block;
  object-fit: contain;
}

/* Kommentarbereich auf der Bild-Detailseite - schlanker Wrapper,
   die eigentliche Optik kommt aus comments.css (geteiltes System) */
.ds-gallery-comments { margin-top: 18px; }
.ds-gallery-comments h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 9px rgba(215,223,229,0.45), 0 0 14px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 26%, transparent);
}

/* ── Formularfelder (owner panels) ──────────────────────────────────────── */

.ds-gallery-form { display: grid; gap: 12px; }
.ds-gallery-field { display: grid; gap: 6px; }

.ds-gallery-field > span,
.ds-gallery-form label {
  color: #dfe5ea;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-shadow: 0 0 8px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 20%, transparent);
}

.ds-gallery-field input,
.ds-gallery-field textarea,
.ds-gallery-field select,
.ds-gallery-manage-row input[type="text"] {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,0.045), rgba(0,0,0,0.56));
  color: #f2f5f7;
  outline: none;
  font: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(215,223,229,0.22),
    inset 0 9px 14px rgba(0,0,0,0.42),
    0 0 12px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 9%, transparent);
}
.ds-gallery-field input::placeholder,
.ds-gallery-field textarea::placeholder { color: rgba(225,230,234,0.58); }
.ds-gallery-field input:focus,
.ds-gallery-field textarea:focus,
.ds-gallery-field select:focus,
.ds-gallery-manage-row input[type="text"]:focus {
  box-shadow:
    inset 0 0 0 1px rgba(235,248,255,0.48),
    inset 0 9px 14px rgba(0,0,0,0.42),
    0 0 14px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 18%, transparent);
}
.ds-gallery-field textarea { min-height: 78px; resize: vertical; }

.ds-gallery-form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 18px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(226,242,252,0.30), color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 36%, rgba(20,38,52,0.42)), rgba(3,13,23,0.90) 74%);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  box-shadow:
    0 0 16px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 24%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.24),
    inset 0 -8px 15px rgba(0,0,0,0.34);
}
.ds-gallery-form-submit:hover,
.ds-gallery-form-submit:focus-visible {
  outline: none;
  box-shadow:
    0 0 22px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 36%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -8px 15px rgba(205,214,221,0.10);
}

/* ── Löschen-Button / Melden-Button ──────────────────────────────────────── */

.ds-gallery-inline-delete button,
.ds-gallery-delete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 13px;
  border: 0;
  border-radius: 8px;
  color: #ffd9d9;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  background: linear-gradient(135deg, rgba(90,20,26,0.92), rgba(32,8,10,0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255,210,210,0.28),
    0 0 12px rgba(255,80,80,0.16);
  text-shadow: 0 1px 0 #000;
}
.ds-gallery-card .ds-gallery-delete-icon { color: #ffd9d9 !important; box-shadow: inset 0 0 0 1px rgba(255,210,210,0.28), 0 0 12px rgba(255,80,80,0.16) !important; }
.ds-gallery-inline-delete button:hover,
.ds-gallery-delete-icon:hover,
.ds-gallery-delete-icon:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(255,235,235,0.42),
    0 0 16px rgba(255,80,80,0.26);
}


/* ── Mehr laden ─────────────────────────────────────────────────────────── */

.ds-gallery-load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 0;
}

.ds-gallery-load-more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 9px 20px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.76rem;
  cursor: pointer;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.24), transparent 54%),
    linear-gradient(135deg, rgba(226,242,252,0.18), color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 20%, rgba(8,18,28,0.78)), rgba(0,0,0,0.92) 78%);
  box-shadow:
    inset 0 0 0 1px rgba(225,230,234,0.22),
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 0 18px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 22%, transparent);
  text-shadow: 0 1px 0 #000000, 0 0 8px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 28%, transparent);
}
.ds-gallery-load-more-button:hover,
.ds-gallery-load-more-button:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(245,248,250,0.38),
    inset 0 1px 0 rgba(255,255,255,0.26),
    0 0 24px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 34%, transparent);
}

/* ── Profil-Reiter: Werkzeuge (Plus/Minus wie Musik) ─────────────────────── */

.ds-profile-gallery-tab {
  position: relative;
  width: 100%;
  color: #f2f5f7;
  --ds-profile-edit-accent: var(--ds-profile-accent, #cfd6dd);
}

.ds-gallery-profile-tools {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 1.05fr);
  gap: 16px;
  align-items: start;
  margin: 0 0 18px;
}

.ds-gallery-profile-tool-panel,
.ds-gallery-panel {
  position: relative;
  min-width: 0;
  padding: 12px 14px 14px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255,255,255,0.08), transparent 45%),
    linear-gradient(135deg, rgba(255,255,255,0.035), rgba(0,0,0,0.30) 62%, rgba(0,0,0,0.46));
  box-shadow:
    inset 0 0 0 1px rgba(215,223,229,0.16),
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 18px color-mix(in srgb, var(--ds-profile-accent, #cfd6dd) 8%, transparent);
}

.ds-gallery-profile-tool-panel > summary {
  cursor: pointer;
  list-style: none;
}
.ds-gallery-profile-tool-panel > summary::-webkit-details-marker { display: none; }
.ds-gallery-profile-tool-panel > summary::marker { content: ""; }

.ds-gallery-profile-tool-summary {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  text-shadow: 0 0 9px rgba(215,223,229,0.50), 0 0 14px color-mix(in srgb, var(--ds-profile-accent, #cfd6dd) 30%, transparent);
}
.ds-gallery-profile-tool-summary h2 {
  margin: 0;
  font-size: 0.94rem;
}
.ds-gallery-profile-tool-summary > span {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(215,223,229,0.70), color-mix(in srgb, var(--ds-profile-accent, #cfd6dd) 40%, transparent), transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--ds-profile-accent, #cfd6dd) 28%, transparent);
}
.ds-gallery-profile-tool-summary::after {
  content: "+";
  color: #e4e8ec;
  font-size: 0.92rem;
  line-height: 1;
  text-shadow: 0 0 8px rgba(205,214,221,0.42);
}
.ds-gallery-profile-tool-panel[open] .ds-gallery-profile-tool-summary::after { content: "−"; }

.ds-gallery-profile-tool-body,
.ds-gallery-profile-form,
.ds-gallery-manage-list { display: grid; gap: 12px; margin-top: 12px; }

/* Upload-Panel: zwei Spalten wie bei Musik (links Datei, rechts Auswahl) */
.ds-gallery-upload-columns {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.ds-gallery-upload-right { display: grid; gap: 12px; min-width: 0; }

.ds-gallery-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Datei-Auswahl Bild - wie ds-music-cover-picker, kein nativer Browser-Kasten */
.ds-gallery-file-picker {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
}
.ds-gallery-file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.ds-gallery-file-title {
  color: #dfe5ea;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-shadow: 0 0 8px color-mix(in srgb, var(--ds-profile-accent, #cfd6dd) 20%, transparent);
}
.ds-gallery-cover-upload-body { display: grid; gap: 8px; justify-items: center; }
.ds-gallery-cover-preview {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  font-size: 2rem;
  background: radial-gradient(ellipse at 30% 10%, rgba(235,248,255,0.18), transparent 55%), #050b12;
  box-shadow: inset 0 0 0 1px rgba(215,223,229,0.20), 0 0 10px color-mix(in srgb, var(--ds-profile-accent, #cfd6dd) 14%, transparent);
}
.ds-gallery-file-info { display: grid; gap: 6px; justify-items: center; text-align: center; }
.ds-gallery-file-name { color: #e1e6ea; font-size: 0.74rem; }

.ds-gallery-file-button,
.ds-gallery-upload-actions .ds-login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 8px 20px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  background: radial-gradient(ellipse at 18% 0%, rgba(255,255,255,0.24), transparent 54%), linear-gradient(135deg, rgba(82,88,96,0.92), rgba(24,28,34,0.98) 48%, rgba(5,7,10,0.99));
  box-shadow: inset 0 0 0 1px rgba(225,230,234,0.24), inset 0 1px 0 rgba(255,255,255,0.22), inset 0 -7px 13px rgba(0,0,0,0.36), 0 0 14px rgba(205,214,221,0.16);
  text-shadow: 0 1px 0 #000000, 0 0 7px rgba(215,223,229,0.28);
}
.ds-gallery-upload-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-start; }

/* Albumauswahl im Upload-Panel - bestehendes Picker-Overlay, kein Radio-Kästchen-Stapel */
.ds-gallery-album-target-field { display: grid; gap: 6px; }
.ds-gallery-album-picker-control { position: relative; }

/* ── Alben verwalten (wie Playlist-Verwaltung) ───────────────────────────── */

.ds-gallery-manage-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}
.ds-gallery-manage-row + .ds-gallery-manage-row {
  position: relative;
}
.ds-gallery-manage-row + .ds-gallery-manage-row::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215,223,229,0.18), transparent);
}
.ds-gallery-manage-cover {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  overflow: hidden;
  font-size: 1.1rem;
  background: radial-gradient(ellipse at 30% 10%, rgba(235,248,255,0.16), transparent 55%), #050b12;
  box-shadow: inset 0 0 0 1px rgba(215,223,229,0.18);
}
.ds-gallery-manage-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ds-gallery-manage-rename-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 0; }
.ds-gallery-manage-delete-form { margin: 0; }

/* ── Profilreiter-Übersicht: Alben + Freundesliste ───────────────────────── */

.ds-profile-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.ds-profile-gallery-card {
  width: 100%;
  max-width: 100%;
}

.ds-gallery-profile-overview { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 340px); gap: 58px; align-items: start; justify-content: start; width: 100%; }
.ds-gallery-profile-overview-main { width: 100%; max-width: 760px; min-width: 0; }
.ds-gallery-profile-overview-side { min-width: 0; margin-left: 8px; }
.ds-gallery-profile-overview .ds-gallery-search-form { margin-bottom: 12px; }

/* ── Teilen-Menü ────────────────────────────────────────────────────────── */

.ds-gallery-share-menu {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  z-index: 22;
}
.ds-gallery-share-menu[open] { z-index: 650; }
.ds-gallery-share-menu > summary { list-style: none; cursor: pointer; }
.ds-gallery-share-menu > summary::-webkit-details-marker { display: none; }
.ds-gallery-share-menu > summary::marker { content: ""; }

.ds-gallery-share-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 124px;
  padding: 7px;
  gap: 6px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 12% 0%, color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 16%, transparent), transparent 48%),
    linear-gradient(135deg, rgba(18,29,39,0.98), rgba(0,0,0,0.98));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 28%, rgba(215,223,229,0.16)),
    0 0 18px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 24%, transparent),
    0 12px 24px rgba(0,0,0,0.44);
}

.ds-gallery-share-choice {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  color: #f2f5f7;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255,255,255,0.055), rgba(0,0,0,0.42));
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-shadow: 0 1px 0 #000, 0 0 7px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 22%, transparent);
  box-shadow: inset 0 0 0 1px rgba(215,223,229,0.12);
}
.ds-gallery-share-choice:hover,
.ds-gallery-share-choice:focus-visible {
  outline: none;
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 44%, rgba(245,248,250,0.20)),
    0 0 12px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 18%, transparent);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .ds-gallery-shell { padding: 22px 18px 24px; }
  .ds-gallery-category-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .ds-gallery-profile-tools,
  .ds-gallery-profile-overview,
  .ds-gallery-form-grid,
  .ds-gallery-upload-columns { grid-template-columns: 1fr; }
  .ds-gallery-profile-overview { gap: 18px; }
  .ds-gallery-profile-overview-side { margin-left: 0; }
}

@media (max-width: 720px) {
  .ds-gallery-search { width: 100%; }
  .ds-gallery-topbar { align-items: flex-start; flex-direction: column; }
  .ds-gallery-topbar-actions { justify-content: flex-start; }
  .ds-gallery-card,
  .ds-gallery-album-card,
  .ds-gallery-image-card,
  .ds-profile-gallery-card { grid-template-columns: 74px minmax(0, 1fr); }
  .ds-gallery-cover,
  .ds-gallery-album-cover-link { width: 74px; height: 74px; }
  .ds-profile-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* DIGITANA PATCH: Galerie Bilddetail und Profil-Alben-Rahmen START */
/* Bilddetail: feste ruhige Bildbox wie Profilbild-Overlay.
   Wichtig: kleine Bilder nicht hochskalieren. */
.ds-gallery-detail-image {
  position: relative;
  width: min(100%, 920px);
  height: clamp(220px, 42vh, 500px);
  min-height: 0;
  margin: 0 auto 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #000000;
  box-shadow:
    inset 0 0 0 1px rgba(215, 237, 255, 0.10),
    inset 0 0 34px rgba(32, 169, 255, 0.05),
    0 16px 42px rgba(0, 0, 0, 0.42);
}

.ds-gallery-detail-image img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  border-radius: 0;
  box-shadow: none;
  image-rendering: auto;
}

/* Profil-Galerie: Meine Alben nicht als grosser Kasten-im-Kasten. */
.ds-profile-gallery-tab #profile-gallery-list.ds-gallery-panel {
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ds-profile-gallery-tab #profile-gallery-list.ds-gallery-panel::after {
  content: none;
  display: none;
}
/* DIGITANA PATCH: Galerie Bilddetail und Profil-Alben-Rahmen ENDE */

/* DIGITANA PATCH: Galerie Teilen 2A START */
.ds-gallery-live-note { position: fixed; left: 50%; top: 18px; z-index: 3000; transform: translateX(-50%); max-width: min(520px, calc(100vw - 30px)); padding: 9px 12px; border: 0; border-radius: 10px; color: #f2f5f7; background: linear-gradient(135deg, rgba(32,58,78,0.96), rgba(0,0,0,0.98)); box-shadow: 0 0 24px rgba(205,214,221,0.24), inset 0 0 0 1px rgba(215,223,229,0.18); }

.ds-gallery-share-menu {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  z-index: 22;
}

.ds-gallery-share-menu[open] {
  z-index: 650;
}

.ds-gallery-share-menu > summary {
  list-style: none;
  cursor: pointer;
}

.ds-gallery-share-menu > summary::-webkit-details-marker {
  display: none;
}

.ds-gallery-share-menu > summary::marker {
  content: "";
}

.ds-gallery-share-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 124px;
  padding: 7px;
  gap: 6px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 12% 0%, color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 16%, transparent), transparent 48%),
    linear-gradient(135deg, rgba(18,29,39,0.98), rgba(0,0,0,0.98));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 28%, rgba(215,223,229,0.16)),
    0 0 18px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 24%, transparent),
    0 12px 24px rgba(0,0,0,0.44);
}

.ds-gallery-share-choice {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  color: #f2f5f7;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255,255,255,0.055), rgba(0,0,0,0.42));
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-shadow: 0 1px 0 #000000;
  box-shadow: inset 0 0 0 1px rgba(215,223,229,0.12);
}

.ds-gallery-share-choice:hover,
.ds-gallery-share-choice:focus-visible {
  outline: none;
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 44%, rgba(245,248,250,0.20)),
    0 0 12px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 18%, transparent);
}
/* DIGITANA PATCH: Galerie Teilen 2A ENDE */


/* ── Galerie Album-Sichtbarkeit V1 ────────────────────────────────────────
   Auge-Button fuer Albumkarten und Albumverwaltung.
   Nutzt den vorhandenen Sichtbarkeits-Picker; keine neue Designwelt. */

.ds-gallery-visibility-inline-form {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  overflow: visible;
}

.ds-gallery-visibility-eye-menu,
.ds-gallery-manage-visibility-picker {
  position: relative;
  display: inline-flex;
  z-index: 34;
}

.ds-gallery-visibility-eye-menu[open],
.ds-gallery-manage-visibility-picker[open] {
  z-index: 720;
}

.ds-gallery-visibility-eye-menu > summary,
.ds-gallery-manage-visibility-picker > summary {
  list-style: none;
}

.ds-gallery-visibility-eye-menu > summary::-webkit-details-marker,
.ds-gallery-manage-visibility-picker > summary::-webkit-details-marker {
  display: none;
}

.ds-gallery-visibility-icon {
  font-size: 0.95rem;
}

.ds-gallery-visibility-eye-menu .ds-profile-post-visibility-popover,
.ds-gallery-manage-visibility-picker .ds-profile-post-visibility-popover {
  z-index: 740;
}

.ds-gallery-selected-users-inline,
.ds-gallery-selected-users-manage {
  display: grid;
  gap: 8px;
  min-width: min(320px, calc(100vw - 44px));
  padding: 9px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 16% 0%, rgba(215,237,255,0.13), transparent 48%),
    linear-gradient(135deg, rgba(27, 53, 73, 0.98), rgba(2, 11, 20, 0.99) 52%, rgba(0,0,0,0.99));
  box-shadow:
    0 20px 38px rgba(0,0,0,0.70),
    0 0 24px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 24%, transparent),
    inset 0 0 0 1px rgba(142,223,255,0.18),
    inset 0 1px 0 rgba(255,255,255,0.16);
}

.ds-gallery-selected-users-inline {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 730;
}

.ds-gallery-selected-users-inline[hidden],
.ds-gallery-selected-users-manage[hidden] {
  display: none !important;
}

.ds-gallery-selected-users-inline > strong,
.ds-gallery-selected-users-manage > strong {
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ds-gallery-selected-grid {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}

.ds-gallery-selected-grid label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #dff5ff;
  font-size: 0.82rem;
}

.ds-gallery-visibility-selected-save {
  justify-self: end;
}

.ds-gallery-manage-rename-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
  position: relative;
  overflow: visible;
}

.ds-gallery-selected-users-manage {
  grid-column: 1 / -1;
}

/* ── Galerie Sichtbarkeits-Overlay-Stapelung A6 ────────────────────────────
   Der globale Sichtbarkeits-Picker bleibt gleich.
   Dieser Block verhindert nur, dass Bildkarten im geöffneten Album optisch
   über die Sichtbarkeitsauswahl laufen. */

.ds-gallery-profile-overview,
.ds-gallery-profile-overview-main,
.ds-gallery-album-header,
.ds-gallery-panel,
.ds-gallery-detail,
.ds-gallery-card-action-block,
.ds-gallery-card-action-row,
.ds-gallery-card-action-left,
.ds-gallery-card-action-right {
  overflow: visible;
}

.ds-gallery-profile-overview-main:has(.ds-profile-post-visibility-picker[open]),
.ds-gallery-album-header:has(.ds-profile-post-visibility-picker[open]),
.ds-gallery-panel:has(.ds-profile-post-visibility-picker[open]),
.ds-gallery-detail:has(.ds-profile-post-visibility-picker[open]),
.ds-profile-gallery-card:has(.ds-profile-post-visibility-picker[open]),
.ds-gallery-manage-row:has(.ds-profile-post-visibility-picker[open]) {
  position: relative;
  z-index: 5300;
}

.ds-gallery-profile-overview-main:has(.ds-gallery-album-header .ds-profile-post-visibility-picker[open]) .ds-gallery-image-grid,
.ds-gallery-profile-overview-main:has(.ds-gallery-album-header .ds-profile-post-visibility-picker[open]) .ds-gallery-image-card {
  position: relative;
  z-index: 1;
}

.ds-gallery-visibility-inline-form:has(.ds-profile-post-visibility-picker[open]),
.ds-gallery-visibility-picker[open],
.ds-gallery-visibility-eye-menu[open],
.ds-gallery-manage-visibility-picker[open] {
  position: relative;
  z-index: 5350 !important;
}

.ds-gallery-visibility-picker[open] > .ds-profile-post-visibility-popover,
.ds-gallery-visibility-eye-menu[open] > .ds-profile-post-visibility-popover,
.ds-gallery-manage-visibility-picker[open] > .ds-profile-post-visibility-popover {
  z-index: 5360 !important;
}

/* ── Galerie Sichtbarkeits-Ausrichtung-Konsolidierung A8c ─────────────────
   Galerie nutzt die globale Links-/Rechts-Ausrichtung.
   Hier bleibt nur der Vordergrundschutz, keine feste Links-/Rechtslage. */

.ds-gallery-visibility-picker > .ds-profile-post-visibility-popover,
.ds-gallery-visibility-eye-menu > .ds-profile-post-visibility-popover,
.ds-gallery-manage-visibility-picker > .ds-profile-post-visibility-popover {
  z-index: 5360 !important;
}

/* ── Galerie Sichtbarkeit CP2d: Formular-Wertbutton + Karten-Auge + Popover ─
   Dieser Block ersetzt den alten CP2c-Endblock vollständig.
   Ziel:
   - Upload und Album-Erstellen oben: Wertbutton mit sichtbarem Text.
   - Bestehende Alben/Bilder/Karten/Detailansichten: Auge.
   - Galerie-Hauptseite nach F5: Digitana-Popover statt Browser-Grau. */

.ds-gallery-visibility-field {
  align-content: start;
}

/* Wertbutton nur in Formularen: Bild hochladen + neues Album erstellen. */
.ds-gallery-upload-visibility-field .ds-gallery-visibility-value-picker,
.ds-gallery-album-create-form .ds-gallery-visibility-value-picker {
  position: relative;
  display: inline-flex;
  width: fit-content;
  margin-top: 3px;
  z-index: 34;
}

.ds-gallery-upload-visibility-field .ds-gallery-visibility-value-picker[open],
.ds-gallery-album-create-form .ds-gallery-visibility-value-picker[open] {
  z-index: 720;
}

.ds-gallery-upload-visibility-field .ds-gallery-visibility-value-picker > summary,
.ds-gallery-album-create-form .ds-gallery-visibility-value-picker > summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 172px;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255,255,255,0.22), transparent 54%),
    linear-gradient(135deg, rgba(226,242,252,0.18), rgba(4,12,20,0.92) 72%);
  box-shadow:
    inset 0 0 0 1px rgba(225,230,234,0.24),
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 0 14px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 18%, transparent);
  list-style: none;
  text-decoration: none;
  text-shadow:
    0 1px 0 #000000,
    0 0 8px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 28%, transparent);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.1;
  text-transform: none;
  letter-spacing: 0.02em;
}

.ds-gallery-upload-visibility-field .ds-gallery-visibility-value-picker > summary::-webkit-details-marker,
.ds-gallery-album-create-form .ds-gallery-visibility-value-picker > summary::-webkit-details-marker {
  display: none;
}

.ds-gallery-upload-visibility-field .ds-gallery-visibility-value-picker > summary::marker,
.ds-gallery-album-create-form .ds-gallery-visibility-value-picker > summary::marker {
  content: "";
}

.ds-gallery-upload-visibility-field .ds-gallery-visibility-value-picker > summary::after,
.ds-gallery-album-create-form .ds-gallery-visibility-value-picker > summary::after {
  content: "⌄";
  color: #e4e8ec;
  font-size: 0.82rem;
  text-shadow: 0 0 8px rgba(205,214,221,0.42);
}

.ds-gallery-upload-visibility-field .ds-gallery-visibility-value-picker[open] > summary::after,
.ds-gallery-album-create-form .ds-gallery-visibility-value-picker[open] > summary::after {
  content: "⌃";
}

.ds-gallery-upload-visibility-field .ds-gallery-visibility-value-picker > summary:hover,
.ds-gallery-upload-visibility-field .ds-gallery-visibility-value-picker > summary:focus-visible,
.ds-gallery-album-create-form .ds-gallery-visibility-value-picker > summary:hover,
.ds-gallery-album-create-form .ds-gallery-visibility-value-picker > summary:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(245,248,250,0.36),
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 0 18px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 28%, transparent);
}

/* Auge-Menüs für bestehende Objekte bleiben klein. */
.ds-gallery-visibility-eye-menu > summary.ds-profile-icon-link,
.ds-gallery-manage-visibility-picker > summary.ds-profile-icon-link {
  display: inline-flex;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  background:
    radial-gradient(ellipse at 24% 0%, rgba(255,255,255,0.24), transparent 54%),
    linear-gradient(135deg, rgba(230,235,239,0.24), rgba(8,12,16,0.98) 76%);
  box-shadow:
    inset 0 0 0 1px rgba(225,230,234,0.20),
    0 0 10px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 18%, transparent);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
}

.ds-gallery-visibility-eye-menu > summary.ds-profile-icon-link::-webkit-details-marker,
.ds-gallery-manage-visibility-picker > summary.ds-profile-icon-link::-webkit-details-marker {
  display: none;
}

.ds-gallery-visibility-eye-menu > summary.ds-profile-icon-link::marker,
.ds-gallery-manage-visibility-picker > summary.ds-profile-icon-link::marker {
  content: "";
}

.ds-gallery-visibility-eye-menu > summary.ds-profile-icon-link:hover,
.ds-gallery-visibility-eye-menu > summary.ds-profile-icon-link:focus-visible,
.ds-gallery-manage-visibility-picker > summary.ds-profile-icon-link:hover,
.ds-gallery-manage-visibility-picker > summary.ds-profile-icon-link:focus-visible {
  outline: none;
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(245,248,250,0.34),
    0 0 14px color-mix(in srgb, var(--ds-gallery-card-accent, #cfd6dd) 30%, transparent);
}

/* Popover-Optik für /galerie nach F5.
   Diese Regeln sind galerie-spezifisch, damit die Hauptseite nicht vom Profil-CSS abhängig ist. */
.ds-gallery-shell .ds-profile-post-visibility-picker {
  position: relative;
  z-index: 80;
  display: inline-flex;
  align-items: center;
}

.ds-gallery-shell .ds-profile-post-visibility-picker > summary::-webkit-details-marker {
  display: none;
}

.ds-gallery-shell .ds-profile-post-visibility-picker > summary::marker {
  content: "";
}

.ds-gallery-shell .ds-profile-post-visibility-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 5360;
  width: max-content;
  min-width: 220px;
  padding: 9px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(215,237,255,0.18), transparent 48%),
    linear-gradient(135deg, rgba(34,61,82,0.98), rgba(4,13,23,0.99) 52%, rgba(0,0,0,0.99));
  box-shadow:
    0 18px 38px rgba(0,0,0,0.64),
    0 0 22px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 22%, transparent),
    inset 0 0 0 1px rgba(215,237,255,0.16),
    inset 0 1px 0 rgba(255,255,255,0.16);
}

.ds-gallery-shell .ds-profile-post-visibility-form {
  display: grid;
  gap: 5px;
  margin: 0;
}

.ds-gallery-shell .ds-profile-visibility-choice {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #dff5ff;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.ds-gallery-shell .ds-profile-visibility-choice:hover,
.ds-gallery-shell .ds-profile-visibility-choice:focus-visible,
.ds-gallery-shell .ds-profile-visibility-choice-active {
  color: #ffffff;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 20%, transparent), rgba(0,0,0,0.28));
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(215,237,255,0.12),
    0 0 10px color-mix(in srgb, var(--ds-profile-accent, #20a9ff) 18%, transparent);
}

.ds-gallery-shell .ds-profile-visibility-check {
  color: #ffffff;
  text-align: center;
  text-shadow:
    0 0 7px rgba(215,237,255,0.50),
    0 1px 0 #000000;
}

.ds-gallery-shell .ds-profile-visibility-choice span:last-child {
  min-width: 0;
}

/* A8c bleibt gültig: Popover-Seite wird vom globalen JS gesetzt. */
.ds-gallery-shell .ds-profile-post-visibility-popover.ds-visibility-popover-open-right {
  left: 0;
  right: auto;
}

.ds-gallery-shell .ds-profile-post-visibility-popover.ds-visibility-popover-open-left {
  left: auto;
  right: 0;
}

/* ── Galerie Kommentar-Sichtbarkeit CP3 ────────────────────────────────── */
.ds-gallery-comments .ds-gallery-comment-compose-form {
  margin-top: 10px;
}

.ds-gallery-comments .ds-gallery-comment-compose-box {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 14% 0%, rgba(215,237,255,0.08), transparent 48%),
    linear-gradient(135deg, rgba(6,10,14,0.98), rgba(0,0,0,0.99));
  box-shadow:
    inset 0 0 0 1px rgba(215,237,255,0.10),
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 10px 20px rgba(0,0,0,0.24);
}

.ds-gallery-comments .ds-gallery-comment-compose-box .ds-comment-input-shell {
  position: relative;
  width: 100%;
  min-width: 0;
}

.ds-gallery-comments .ds-gallery-comment-compose-box .ds-profile-comment-field {
  display: block;
  width: 100%;
  padding-right: 46px;
}

.ds-gallery-comments .ds-gallery-comment-compose-box .ds-profile-comment-send {
  position: absolute;
  right: 10px;
  bottom: 10px;
}

.ds-gallery-comments .ds-gallery-comment-compose-box .ds-comment-compose-meta {
  width: 100%;
  min-height: 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
  padding-right: 2px;
}

.ds-gallery-comments .ds-gallery-comment-compose-box .ds-comment-compose-meta .ds-profile-post-visibility-picker {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.ds-gallery-comments .ds-gallery-comment-compose-box .ds-comment-compose-meta .ds-profile-post-visibility-popover {
  left: auto;
  right: 0;
}


.ds-gallery-image-count {
  display: inline;
  margin-left: 6px;
  color: #c8d0d6;
  font-size: 0.78rem;
}
.ds-gallery-card-description {
  margin: 4px 0 0;
  color: #f2f5f7;
  font-size: 0.82rem;
  line-height: 1.45;
  min-height: calc(0.82rem * 1.45 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ds-projects-image-clear-button[hidden] { display: none !important; }

.ds-gallery-upload-form .ds-projects-card-preview-zone {
  grid-template-columns: 106px 1fr;
}

.ds-gallery-upload-form .ds-projects-file-picker-field,
.ds-gallery-upload-form .ds-projects-file-action-row {
  width: 100%;
  box-sizing: border-box;
}

.ds-gallery-upload-form .ds-gallery-album-target-field {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}
.ds-gallery-upload-form .ds-projects-file-picker-field {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  align-self: start;
}

.ds-gallery-manage-list {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}
.ds-gallery-manage-delete-form .ds-gallery-delete-icon {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 1rem;
}
a.ds-gallery-manage-cover {
  text-decoration: none;
}
a.ds-gallery-manage-cover:hover {
  box-shadow: inset 0 0 0 1px rgba(215,223,229,0.38), 0 0 12px rgba(205,214,221,0.22);
}

.ds-gallery-field input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}
