/* =========================================================
   1. DESIGN-VARIABLEN
   Farben, Linien, Texte und Schatten für die gesamte App.
   ========================================================= */
:root {
  --bg: #0b0f16;
  --bg2: #0f1520;
  --panel: #121a26;
  --panel2: #182233;
  --panel3: #1c2940;
  --toolbar-bg: #182233;
  --header-bg: #0a0e15;
  --header-text: #98a7bf;
  --mobile-nav-bg: #0d141e;
  --mobile-nav-text: #e8eef8;
  --field: #0d141e;
  --button: #73b9ff;
  --button-text: #071220;
  --button-secondary: #182233;
  --button-secondary-text: #e8eef8;
  --line: #2a3447;
  --text: #e8eef8;
  --muted: #98a7bf;
  --accent: #73b9ff;
  --accent2: #9fd0ff;
  --danger: #ff697d;
  --ok: #47d18a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* Mülleimer Icon */
.delete-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    z-index: 10;
    
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 50%;
    padding: 6px;
    cursor: pointer;
    
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: rgba(255,0,0,0.8);
}

/* =========================================================
   2. RESET / BASIS
   Grundverhalten für alle Elemente.
   ========================================================= */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(115, 185, 255, 0.12), transparent 22%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.modal-open {
  overflow: hidden;
}


/* =========================================================
   3. ALLGEMEINES LAYOUT
   Grundstruktur der Seite und Container.
   ========================================================= */
.app-shell {
  min-height: 100vh;
}

.content {
  padding: 24px;
  max-width: 1560px;
  margin: 0 auto;
}

.stack {
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-main {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
}

.single-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}


/* =========================================================
   4. TOPBAR / NAVIGATION / BRANDING
   Kopfbereich, Logo, Navigation und Benutzeranzeige.
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: color-mix(in srgb, var(--header-bg) 86%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--header-text) 14%, transparent);
}

.brand,
.brand-with-logo {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.28));
}

.nav-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--header-text);
  transition: 0.18s ease;
}

.nav-links a:hover {
  background: color-mix(in srgb, var(--button-secondary) 82%, var(--header-bg));
  color: var(--button-secondary-text);
}

.nav-install-btn,
.nav-push-btn {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--button-secondary) 72%, transparent);
  color: var(--header-text);
  transition: 0.18s ease;
}

.nav-install-btn:hover,
.nav-push-btn:hover {
  background: var(--button-secondary);
  color: var(--button-secondary-text);
}

.nav-install-btn[data-install-state="ready"] {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #08111d;
  border-color: transparent;
  font-weight: 700;
}

.nav-install-btn[data-install-state="installed"] {
  opacity: 0.72;
}

.nav-install-btn.is-hidden {
  display: none !important;
}

@media (min-width: 761px) {
  .topbar .nav-install-btn {
    display: none !important;
  }
}

.user-pill,
.pill {
  padding: 8px 12px;
  background: color-mix(in srgb, var(--button-secondary) 72%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--header-text);
}


/* =========================================================
   5. KARTEN / BOXEN / STANDARD-CONTAINER
   Wiederverwendbare Karten und Bereiche.
   ========================================================= */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.compact-card {
  padding: 16px 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-head h2,
.card h2 {
  margin: 0 0 6px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--accent2);
  margin-bottom: 8px;
}


/* =========================================================
   6. HERO / STARTBEREICH
   Oberer Einführungsbereich mit Logo und Kennzahlen.
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 24px;
  align-items: center;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.hero-text {
  max-width: 70ch;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-tile {
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(115, 185, 255, 0.09), rgba(115, 185, 255, 0.02));
  border: 1px solid rgba(115, 185, 255, 0.18);
}

.stat-tile span {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.stat-tile small {
  color: var(--muted);
}

.hero-v3 {
  position: relative;
  overflow: hidden;
}

.hero-v3::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(115, 185, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.hero-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 6px 0;
}

.hero-logo {
  display: block;
  width: 100%;
  max-width: min(100%, 420px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 42px rgba(0, 0, 0, 0.32));
}

.people-strip-card {
  margin-top: 18px;
  overflow: hidden;
}

.people-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 185, 255, 0.55) transparent;
  -webkit-overflow-scrolling: touch;
}

.people-strip::-webkit-scrollbar {
  height: 8px;
}

.people-strip::-webkit-scrollbar-thumb {
  background: rgba(115, 185, 255, 0.45);
  border-radius: 999px;
}

.people-strip::-webkit-scrollbar-track {
  background: transparent;
}

.person-chip {
  flex: 0 0 auto;
  width: 92px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  color: var(--text);
}

.person-chip-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(115, 185, 255, 0.16), rgba(115, 185, 255, 0.04));
  border: 1px solid rgba(115, 185, 255, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.person-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.person-chip-placeholder {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent2);
}

.person-chip-name {
  width: 100%;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* =========================================================
   7. FORMULARE / FELDER / BUTTONS
   Eingaben, Auswahlfelder und Schaltflächen.
   ========================================================= */
.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

label {
  font-size: 0.95rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: none;
  border-radius: 16px;
  background: var(--button);
  color: var(--button-text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--button-secondary);
  color: var(--button-secondary-text);
  border: 1px solid var(--line);
}

.btn-danger {
  background: linear-gradient(180deg, var(--danger), #ea5066);
  color: #fff;
}

.btn-small {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.92rem;
}


/* =========================================================
   8. ALERTS / HINWEISE
   Fehler- und Erfolgsmeldungen.
   ========================================================= */
.alert {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(255, 93, 115, 0.12);
  border: 1px solid rgba(255, 93, 115, 0.35);
  color: #ffc4cb;
}

.alert-success {
  background: rgba(55, 201, 120, 0.12);
  border: 1px solid rgba(55, 201, 120, 0.35);
  color: #b5f1cd;
}


/* =========================================================
   9. TOOLBAR / FILTER / SUCHE
   Bereich für Suche, Filter und Ansichtsschalter.
   ========================================================= */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-column {
  flex-direction: column;
  align-items: stretch;
}

.toolbar .search {
  flex: 1 1 260px;
}

.gallery-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.gallery-toolbar-v3 {
  position: sticky;
  top: 88px;
  z-index: 8;
  background: color-mix(in srgb, var(--toolbar-bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.spotlight-gallery {
  align-items: stretch;
}

.gallery-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wrap-actions {
  flex-wrap: wrap;
}

.small-gap {
  gap: 12px;
}

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


/* =========================================================
   10. UPLOAD-BEREICH
   Uploadkarte, Dropzone, Fortschritt und Ergebnisliste.
   ========================================================= */
.upload-panel {
  position: static;
  top: auto;
  z-index: 6;
}

.upload-box {
  display: grid;
  gap: 16px;
}

.dropzone {
  border: 2px dashed rgba(115, 185, 255, 0.24);
  border-radius: 26px;
  padding: 28px 18px;
  text-align: center;
  background: linear-gradient(180deg, rgba(115, 185, 255, 0.08), rgba(115, 185, 255, 0));
  cursor: pointer;
  transition: 0.18s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: rgba(115, 185, 255, 0.58);
  background: linear-gradient(180deg, rgba(115, 185, 255, 0.14), rgba(115, 185, 255, 0.03));
}

.dropzone.is-disabled,
.upload-box.is-uploading .dropzone {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.upload-box.is-uploading .upload-actions button {
  opacity: 0.7;
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.6rem;
}

.upload-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.queue {
  padding: 12px 14px;
  border-radius: 16px;
  background: #0d141e;
  border: 1px solid var(--line);
  line-height: 1.5;
}

.progress-wrap {
  display: grid;
  gap: 10px;
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: #0d141e;
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #9dd6ff);
  border-radius: 999px;
  transition: width 0.18s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.upload-results {
  max-height: min(38vh, 320px);
  overflow: auto;
}

.upload-results {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.results-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.result-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.result-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0d141e;
  display: grid;
  gap: 4px;
}

.result-uploaded {
  border-color: rgba(71, 209, 138, 0.34);
}

.result-duplicate {
  border-color: rgba(115, 185, 255, 0.34);
}

.result-error {
  border-color: rgba(255, 105, 125, 0.34);
}


/* =========================================================
   11. GALERIE-LAYOUT
   Linke Spalte und Hauptbereich der Galerie.
   ========================================================= */
.gallery-shell {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.sidebar-v3 {
  position: static;
  top: auto;
}

.gallery-panel-v3 {
  min-width: 0;
}

.album-page-layout {
  align-items: start;
  gap: 18px;
}

.album-intro-stack {
  display: none !important;
}

.album-sidebar-card {
  display: grid;
  gap: 12px;
}

.album-intro-stack {
  display: none;
  gap: 16px;
  width: min(100%, 560px);
}

.mobile-only-block {
  display: none;
}

.mobile-album-summary {
  display: none;
}

.mobile-album-summary h2 {
  margin: 4px 0 0;
}

.mobile-album-summary-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--accent2);
  font-size: 0.9rem;
}

.mobile-album-panel summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
}

.mobile-album-panel summary::-webkit-details-marker {
  display: none;
}

.mobile-album-panel summary::after {
  content: '+';
  float: right;
  color: var(--accent2);
}

.mobile-album-panel[open] summary::after {
  content: '-';
}

.mobile-album-panel-body {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

@media (min-width: 761px) {
  .mobile-only-block,
  .mobile-album-summary {
    display: none !important;
  }

  .album-sidebar-desktop {
    display: grid !important;
  }

  .album-shell {
    display: grid !important;
    grid-template-columns: minmax(300px, 390px) minmax(0, 1fr) !important;
    gap: 20px;
    align-items: start;
  }

  .album-shell > .album-sidebar-desktop {
    display: grid !important;
    align-content: start;
    gap: 20px;
    grid-column: 1;
    width: 100%;
    max-width: none !important;
    position: static !important;
    inset: auto !important;
    height: auto !important;
    transform: none !important;
    padding: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
    background: transparent !important;
    z-index: auto !important;
  }

  .album-shell > .gallery-panel-v3.album-page-layout {
    grid-column: 2;
    width: 100%;
  }

  .album-shell > .gallery-panel-v3.album-page-layout > .month-block {
    width: min(100%, 1160px);
    margin: 0 auto;
  }

  .album-shell > .gallery-panel-v3.album-page-layout > .month-block .month-head {
    margin-left: 0;
    margin-right: 0;
  }

  .album-shell > .gallery-panel-v3.album-page-layout .enhanced-gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 16px;
  }

  html.density-compact .album-shell > .gallery-panel-v3.album-page-layout .enhanced-gallery {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 10px;
  }

  .album-shell > .gallery-panel-v3.album-page-layout > .mobile-only-block,
  .album-shell > .gallery-panel-v3.album-page-layout > .mobile-album-summary {
    display: none !important;
  }
}


/* =========================================================
   12. MONATSNAVIGATION / SIDEBAR-INHALT
   Monatliche Chips und Listen in der linken Spalte.
   ========================================================= */
.month-nav-card {
  max-height: none;
  overflow: visible;
}

.month-chip-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.month-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--button-secondary);
  border: 1px solid var(--line);
  color: var(--button-secondary-text);
  width: 100%;
  min-width: 0;
  text-decoration: none;
  transition: 0.18s ease;
}

.month-chip:hover {
  border-color: color-mix(in srgb, var(--button) 34%, var(--line));
  transform: translateY(-1px);
}

.month-chip small {
  color: color-mix(in srgb, var(--button-secondary-text) 72%, transparent);
}

.vertical-list {
  flex-direction: column;
}

.vertical-list .month-chip.active {
  border-color: color-mix(in srgb, var(--button) 60%, var(--line));
  background: color-mix(in srgb, var(--button) 16%, var(--button-secondary));
}


/* =========================================================
   13. GALERIE / BILDKARTEN
   Grid, Karten, Titel und Monatsblöcke.
   ========================================================= */
.gallery-feed {
  display: grid;
  gap: 18px;
}

.month-block {
  display: grid;
  gap: 12px;
  scroll-margin-top: 130px;
}

.latest-uploaded-block {
  padding: 0;
}

.latest-uploaded-preview {
  align-items: stretch;
}

.month-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 12px 4px;
}

.month-head-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.month-select-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.month-select-btn.is-active {
  border-color: color-mix(in srgb, var(--button) 60%, var(--line));
  background: color-mix(in srgb, var(--button) 16%, var(--button-secondary));
}

.gallery-month {
  margin: 0;
  font-size: 1.15rem;
}

.month-count {
  color: var(--muted);
  font-size: 0.92rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.enhanced-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

html.density-compact .enhanced-gallery {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.photo-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #0d1017;
}

.photo-card-enhanced {
  position: relative;
  outline: 1px solid transparent;
}

.photo-card-enhanced.is-new {
  animation: fadeInUp 0.35s ease;
}

.photo-card-enhanced.is-rotating .lightbox-trigger img {
  animation: highlightSwap 0.45s ease;
}

.photo-card-enhanced.is-selected {
  outline-color: rgba(115, 185, 255, 0.8);
  box-shadow:
    0 0 0 3px rgba(115, 185, 255, 0.15),
    0 8px 25px rgba(0, 0, 0, 0.22);
}

.lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.lightbox-trigger img {
  transition: transform 0.22s ease, filter 0.22s ease;
}

.lightbox-trigger:hover img {
  transform: scale(1.03);
  filter: brightness(0.9);
}

.photo-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 14px 14px;
  background: linear-gradient(180deg, transparent, rgba(5, 8, 13, 0.88));
  display: grid;
  gap: 4px;
}

.photo-overlay strong,
.photo-title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-overlay small {
  color: #c7d3e6;
}

@keyframes highlightSwap {
  0% {
    opacity: 0.55;
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.photo-meta {
  padding: 12px;
}

.photo-detail-layout {
  align-items: start;
}

.photo-detail-media,
.photo-detail-meta {
  min-width: 0;
}

.photo-detail-title {
  margin: 0 0 14px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.photo-detail-image {
  display: block;
}

.photo-detail-actions {
  margin-top: 16px;
}

.photo-detail-note {
  margin-top: 12px;
}

.photo-detail-location-card {
  margin-top: 16px;
}

.photo-detail-location-head {
  margin-bottom: 10px;
}

.photo-detail-map-block {
  display: grid;
  gap: 10px;
}

.photo-detail-map {
  width: 100%;
}


/* =========================================================
   14. AUSWAHL / FAVORITEN / SAMMELAKTIONEN
   Checkboxen, Favoritenbuttons und Auswahlleiste.
   ========================================================= */
.selection-bar {
  position: sticky;
  top: 76px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.check-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  flex: 0 0 16px;
  accent-color: var(--accent);
}

.select-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
}

.select-badge input {
  display: none;
}

.select-badge span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(7, 18, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.86rem;
}

.select-badge input:checked + span {
  background: var(--accent);
  color: #071220;
}

.favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: rgba(7, 18, 32, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.favorite-btn.active,
.photo-card.is-favorite .favorite-btn {
  background: #ffd76a;
  color: #3a2800;
}


/* =========================================================
   15. LIGHTBOX / MODAL / SLIDESHOW
   Großansicht von Bildern und Slideshow-Navigation.
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 8, 0.72);
  background: color-mix(in srgb, var(--lightbox-backdrop) 72%, transparent);
  backdrop-filter: blur(8px);
}

.lightbox-dialog {
  position: relative;
  max-width: min(1280px, calc(100% - 32px));
  margin: 22px auto;
  z-index: 1;
  max-height: calc(100vh - 44px);
  overflow: auto;
  background: var(--lightbox-surface);
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: var(--lightbox-close-bg);
  color: var(--text);
}

.lightbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.75fr);
  gap: 22px;
}

.lightbox-media-wrap {
  display: grid;
  place-items: center;
  background: var(--lightbox-media-bg);
  border-radius: 24px;
  min-height: 420px;
}

.lightbox-media-wrap img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 18px;
}

.meta-list {
  display: grid;
  gap: 12px;
}

.meta-list div {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--lightbox-panel);
  border: 1px solid var(--line);
}

.meta-list dt {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.meta-list dd {
  margin: 0;
  font-weight: 600;
}

.lightbox-date-editor {
  display: grid;
  gap: 10px;
  margin: 18px 0 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--lightbox-panel);
  border: 1px solid var(--line);
}

.lightbox-date-editor label {
  font-size: 0.88rem;
  font-weight: 600;
}

.lightbox-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.lightbox-date-status.is-error {
  color: #ff9aaa;
}

.lightbox-date-status.is-success {
  color: #7fe0a7;
}

.lightbox-dialog-full {
  max-width: min(1420px, calc(100% - 32px));
}

.lightbox-grid-full {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  align-items: start;
}

.lightbox-media-column,
.lightbox-meta-full {
  display: grid;
  gap: 16px;
}

.lightbox-nav-row {
  align-items: center;
}

.lightbox-media-note {
  margin: 0;
}

.lightbox-detail-card {
  padding: 16px;
  border-radius: 18px;
  background: var(--lightbox-panel);
  border: 1px solid var(--line);
}

.compact-head {
  margin-bottom: 12px;
}

.compact-head h3 {
  margin: 0;
}

.lightbox-meta-list-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lightbox-meta-list-location {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lightbox-location-fields {
  display: grid;
  gap: 12px;
}

.lightbox-detail-card iframe {
  width: 100%;
  height: 320px;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--lightbox-media-bg);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 55;
}

.modal-card {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 6vh auto;
  padding-top: 46px;
}

.slideshow-modal .lightbox-backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.slideshow-dialog {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.slideshow-dialog img {
  max-width: min(92vw, 1600px);
  max-height: 84vh;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.slideshow-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 20px;
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(5, 8, 13, 0.58);
  backdrop-filter: blur(8px);
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
}

.slide-nav.prev {
  left: 24px;
}

.slide-nav.next {
  right: 24px;
}


/* =========================================================
   16. ANSICHTSDICHTE / KOMPAKTMODUS
   Kleinere Karten und engeres Raster.
   ========================================================= */
html.density-compact .enhanced-gallery {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

html.density-compact .photo-card img {
  aspect-ratio: 0.95 / 1;
}

html.density-compact .photo-overlay {
  padding: 18px 12px 12px;
}

html.density-compact .photo-overlay strong {
  font-size: 0.9rem;
}


/* =========================================================
   17. TABELLEN / LOGIN / SONSTIGE HILFSKLASSEN
   Sonstige Standardbereiche außerhalb der Galerie.
   ========================================================= */
.muted {
  color: var(--muted);
  font-size: 0.93rem;
}

.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: top;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  padding: 18px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.stat .value {
  font-size: 1.6rem;
  font-weight: 700;
}

.inline-form {
  display: inline;
}

.light-link {
  color: var(--accent);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(460px, 100%);
}

.empty-state {
  text-align: center;
  padding: 38px 24px;
}


/* =========================================================
   18. KARTE / GPS-ANSICHT
   Styles für Leaflet-Karte und Marker-Popups.
   ========================================================= */
.photo-map {
  width: 100%;
  height: min(72vh, 760px);
  border-radius: 24px;
  overflow: hidden;
  background: #0d141e;
  border: 1px solid var(--line);
}

.map-popup {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.map-popup img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
}

.map-popup strong,
.map-popup small {
  display: block;
}

.map-popup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--accent);
  color: #071220;
  font-weight: 700;
}


/* =========================================================
   19. LADEZUSTÄNDE / ANIMATIONEN
   Spinner und Animationen für neue Inhalte.
   ========================================================= */
.load-more-state {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
}

.load-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  opacity: 0.2;
}

.load-spinner.is-loading {
  opacity: 1;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================================================
   20. TABLET / MITTLERE BREITEN
   Anpassungen für Tablet und kleinere Laptops.
   ========================================================= */
@media (max-width: 1180px) {
  .gallery-shell {
    grid-template-columns: 1fr;
  }

  .gallery-toolbar-v3 {
    position: static;
  }

  .upload-panel {
    position: static;
    top: auto;
  }
}

@media (max-width: 1100px) {
  .grid-main,
  .hero,
  .lightbox-grid,
  .lightbox-grid-full {
    grid-template-columns: 1fr;
  }

  .lightbox-dialog-full {
    max-width: min(960px, calc(100% - 24px));
  }

  .lightbox-date-row {
    grid-template-columns: 1fr;
  }

  .lightbox-meta-list-primary,
  .lightbox-meta-list-location {
    grid-template-columns: 1fr;
  }
}



/* =========================================================
   21. MOBILE MENÜ-ELEMENTE
   Standardmäßig ausgeblendet, nur mobil sichtbar.
   ========================================================= */
.mobile-menu-toggle,
.mobile-sidebar-head,
.mobile-nav-slot,
.mobile-upload-fab,
.mobile-upload-close,
.mobile-backdrop {
  display: none !important;
  pointer-events: none !important;
}

.mobile-backdrop.hidden {
  display: none !important;
  pointer-events: none !important;
}

.mobile-backdrop {
  opacity: 0;
}

body.mobile-menu-open .mobile-backdrop,
body.mobile-upload-open .mobile-backdrop,
body.mobile-album-open .mobile-backdrop {
  display: block !important;
  pointer-events: auto !important;
  opacity: 1;
}

@media (min-width: 761px) {
  .mobile-backdrop {
    display: none !important;
    pointer-events: none !important;
  }
}


/* =========================================================
   22. MOBILANSICHT
   Handy-Layout, mobile Sidebar, Upload-FAB und Umbrüche.
   ========================================================= */
@media (max-width: 760px) {
  .album-sidebar-desktop {
    display: none !important;
  }

  .mobile-only-block,
  .mobile-album-summary {
    display: grid;
  }

  .album-page-layout {
    gap: 14px;
  }

  .album-page-layout > .month-block {
    width: 100%;
    margin: 0;
  }

  .album-page-layout > .month-block .month-head {
    margin-bottom: 8px;
  }

  .topbar {
    padding: 12px 14px;
    min-height: 68px;
    flex-wrap: nowrap;
  }

  .content {
    padding: 14px 14px 90px;
  }

  .brand-link span,
  .nav-links,
  .user-pill,
  .gallery-toolbar-v3 .muted,
  .desktop-only-stats {
    display: none !important;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .hero-v3,
  .single-layout {
    grid-template-columns: 1fr;
  }

  .hero-v3 {
    padding: 18px;
  }

  .hero-logo-wrap {
    min-height: auto;
    padding: 0;
  }

  .hero-logo {
    max-width: 240px;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .gallery,
  .enhanced-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-shell {
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .gallery-toolbar,
  .month-head,
  .progress-meta,
  .gallery-toolbar-actions,
  .selection-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .selection-bar {
    top: 68px;
  }

  .month-select-btn {
    width: 100%;
  }

  .upload-actions {
    width: 100%;
  }

  .upload-actions .btn,
  .upload-actions button {
    flex: 1 1 180px;
  }

  .filter-grid-2 {
    grid-template-columns: 1fr;
  }

  .mobile-menu-toggle {
    display: inline-flex !important;
    pointer-events: auto !important;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
    background: var(--mobile-nav-bg);
    color: var(--mobile-nav-text);
    border: 1px solid var(--line);
    flex: 0 0 44px;
  }

  .sidebar-v3 {
    display: grid;
    position: fixed;
    top: 0;
    left: 0;
    width: min(88vw, 360px);
    height: 100vh;
    padding: 84px 14px 24px;
    background: linear-gradient(
      180deg,
      var(--mobile-nav-bg),
      color-mix(in srgb, var(--mobile-nav-bg) 78%, var(--bg2))
    );
    overflow: auto;
    z-index: 45;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    margin: 0;
  }

  body.mobile-menu-open .sidebar-v3[data-mobile-drawer-role="menu"] {
    transform: translateX(0);
  }

  body.mobile-album-open .sidebar-v3[data-mobile-drawer-role="albums"] {
    transform: translateX(0);
  }

  .mobile-sidebar-head {
    display: flex !important;
    pointer-events: auto !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .mobile-nav-slot {
    display: block !important;
    pointer-events: auto !important;
    margin-bottom: 14px;
  }

  .mobile-nav-clone {
    display: grid;
    gap: 10px;
  }

  .mobile-nav-clone .nav-links {
    display: grid !important;
    gap: 8px;
  }

  .mobile-nav-clone .nav-links a {
    display: block;
    background: color-mix(in srgb, var(--button-secondary) 55%, var(--mobile-nav-bg));
    border: 1px solid var(--line);
    color: var(--mobile-nav-text);
  }

  .mobile-nav-clone .user-pill {
    display: block !important;
    width: 100%;
    border-radius: 18px;
    color: var(--mobile-nav-text);
  }

  .sidebar-v3 .upload-panel {
    display: none;
  }

  .mobile-backdrop {
    display: block !important;
    pointer-events: auto !important;
    position: fixed;
    inset: 0;
    background: rgba(2, 5, 10, 0.58);
    backdrop-filter: blur(4px);
    z-index: 40;
  }

  .mobile-upload-fab {
    display: inline-flex !important;
    pointer-events: auto !important;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    justify-content: center;
    align-items: center;
    min-height: 56px;
    padding: 14px 20px;
    border-radius: 20px;
    border: 1px solid rgba(115, 185, 255, 0.42);
    background: linear-gradient(180deg, #7dc1ff 0%, #56a7ff 100%);
    color: #08131f;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.01em;
    box-shadow:
      0 18px 40px rgba(0, 0, 0, 0.34),
      0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  }

body.mobile-upload-open .mobile-upload-fab {
  display: none;
}

body.modal-open .mobile-upload-fab {
  display: none !important;
}

  .gallery-panel-v3 {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-upload-open .sidebar-v3[data-mobile-drawer-role="menu"] {
    transform: none;
    left: 12px;
    right: 12px;
    width: auto;
    height: auto;
    top: auto;
    bottom: 12px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    z-index: 46;
  }

  body.mobile-upload-open .sidebar-v3[data-mobile-drawer-role="menu"] > :not(.upload-panel) {
    display: none !important;
  }

  .upload-panel {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    max-height: 78vh;
    overflow: auto;
    z-index: 46;
    border-radius: 24px;
  }

  body.mobile-upload-open .sidebar-v3[data-mobile-drawer-role="menu"] .upload-panel,
  body.mobile-upload-open .upload-panel {
    display: block !important;
  }

  .mobile-upload-close {
    display: inline-flex !important;
    pointer-events: auto !important;
    margin-left: auto;
    margin-bottom: 12px;
  }

  .month-chip {
    min-width: 100%;
  }

  .slide-nav {
    width: 46px;
    height: 46px;
  }

  .slide-nav.prev {
    left: 10px;
  }

  .slide-nav.next {
    right: 10px;
  }

  .slideshow-caption {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}

/* =========================================================
   MOBILE: COZY vs KOMPAKT FIX
   Cozy nutzt 1 Spalte, Kompakt 2 Spalten.
   Die Umschaltung läuft über die Klasse .density-compact auf <html>.
   ========================================================= */
@media (max-width: 760px) {
  .upload-panel {
    border-radius: 22px;
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding-bottom: 20px;
  }

  .upload-panel .section-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(13, 20, 30, 0.98), rgba(13, 20, 30, 0.88));
    padding-bottom: 10px;
    backdrop-filter: blur(8px);
  }

  .dropzone {
    padding: 20px 14px;
    border-radius: 20px;
  }

  .dropzone p {
    margin: 8px 0 0;
  }

  .dropzone-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
  }

  .upload-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .upload-actions .btn,
  .upload-actions button {
    width: 100%;
  }

  .progress-wrap {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 12px;
    border-radius: 16px;
    background: rgba(10, 16, 24, 0.94);
    border: 1px solid rgba(115, 185, 255, 0.14);
    backdrop-filter: blur(8px);
  }

  .progress-meta {
    align-items: flex-start;
  }

  .progress-meta strong {
    min-width: 54px;
  }

  .queue {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .upload-results {
    max-height: min(32vh, 260px);
  }

  .mobile-highlight-card {
    padding-bottom: 14px;
  }

  .spotlight-gallery {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(78vw, 1fr);
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .spotlight-gallery::-webkit-scrollbar {
    display: none;
  }

  .spotlight-gallery .photo-card {
    scroll-snap-align: start;
  }

  .latest-uploaded-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .enhanced-gallery {
    grid-template-columns: 1fr !important;
  }

  .density-compact .enhanced-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell,
.content,
.gallery-shell,
.gallery-panel-v3,
.gallery-feed,
.month-block,
.card,
.selection-bar,
.gallery-toolbar-v3,
.gallery-toolbar-actions,
.wrap-actions,
.month-head,
.lightbox-dialog,
.slideshow-dialog {
  min-width: 0;
  max-width: 100%;
}

/* Cozy und Kompakt sauber trennen */
.enhanced-gallery {
  grid-template-columns: 1fr;
  gap: 14px;
}

html.density-compact .enhanced-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

html:not(.density-compact) .photo-card img {
  aspect-ratio: 4 / 3;
}

html.density-compact .photo-card img {
  aspect-ratio: 1 / 1;
}

/* Auswahlleiste ohne horizontales Scrollen */
.selection-bar {
  width: 100%;
  gap: 12px;
}

.selection-bar > * {
  width: 100%;
  min-width: 0;
}

.selection-bar .gallery-toolbar-actions.wrap-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  overflow: visible;
}

.selection-bar .gallery-toolbar-actions.wrap-actions .btn,
.selection-bar .gallery-toolbar-actions.wrap-actions a {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

/* Toolbar-Buttons in der Übersicht responsive ohne Seitenscrollen */
.gallery-toolbar-v3 .gallery-toolbar-actions.wrap-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  width: 100%;
  overflow: visible;
}

.gallery-toolbar-v3 .gallery-toolbar-actions.wrap-actions .btn {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

/* Mobile Drawer stabil und bedienbar */
.sidebar-v3 {
  width: min(92vw, 380px);
  max-width: calc(100vw - 16px);
  padding: 78px 12px 20px;
}

.mobile-sidebar-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    var(--mobile-nav-bg),
    color-mix(in srgb, var(--mobile-nav-bg) 78%, var(--bg2))
  );
  padding-bottom: 10px;
}

.mobile-nav-slot,
.mobile-nav-clone,
.mobile-nav-clone .nav-links {
  width: 100%;
}

.mobile-nav-clone .nav-links a {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
}

/* Lightbox mobil klar schließbar */
.lightbox-dialog {
  margin: 8px;
  width: calc(100% - 16px);
  max-width: none;
  max-height: calc(100vh - 16px);
  padding-top: 54px;
  overflow: auto;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(7, 18, 32, 0.92);
}

.lightbox-grid {
  gap: 14px;
}

.lightbox-media-wrap {
  min-height: 280px;
}

.lightbox-media-wrap img {
  max-height: 52vh;
}

.slideshow-dialog {
  padding: 16px;
}

.slideshow-dialog img {
  max-width: 100%;
  max-height: 76vh;
}

}


/* =========================================================
   23. KLEINE HANDYDISPLAYS
   Weitere Anpassungen für sehr schmale Geräte.
   ========================================================= */
@media (max-width: 520px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  .enhanced-gallery {
    grid-template-columns: 1fr !important;
  }

  .density-compact .enhanced-gallery {
    grid-template-columns: 1fr 1fr !important;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .photo-detail-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .photo-detail-image {
    max-height: 58vh !important;
  }

  .photo-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .photo-detail-actions .btn {
    width: 100%;
  }

  .photo-detail-title {
    font-size: clamp(1.2rem, 6.5vw, 1.65rem);
  }

  .photo-detail-table-wrap {
    overflow-x: visible;
  }

  .photo-detail-meta .table,
  .photo-detail-meta .table tbody,
  .photo-detail-meta .table tr,
  .photo-detail-meta .table th,
  .photo-detail-meta .table td {
    display: block;
    width: 100%;
  }

  .photo-detail-meta .table tr {
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 10px;
    background: #0d141e;
    border: 1px solid var(--line);
  }

  .photo-detail-meta .table th,
  .photo-detail-meta .table td {
    padding: 0;
    border: 0;
    text-align: left;
  }

  .photo-detail-meta .table th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 6px;
  }

  .photo-detail-meta .table td {
    font-weight: 600;
    word-break: break-word;
  }

  .photo-detail-map {
    height: 240px !important;
  }

  .lightbox-dialog {
    margin: 10px;
    max-width: none;
    max-height: calc(100vh - 20px);
  }
}




/* =========================================================
   24. MOBILE ÜBERSICHT-BUTTONS NEBENEINANDER
   Nur im Übersichtsblock, nicht in der Auswahlleiste.
   ========================================================= */
@media (max-width: 768px) {
  .gallery-toolbar-v3 .gallery-toolbar-actions.wrap-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .gallery-toolbar-v3 .gallery-toolbar-actions.wrap-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .gallery-toolbar-v3 .gallery-toolbar-actions.wrap-actions .muted {
    display: none;
  }
}

.mobile-album-back-card {
  display: none;
}

@media (max-width: 760px) {
  .mobile-album-back-card {
    display: block;
    margin-top: 14px;
  }

  .mobile-album-back-card .btn {
    width: 100%;
  }
}


.month-chip.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.month-block.jump-highlight {
  outline: 2px solid rgba(115, 185, 255, 0.55);
  border-radius: 20px;
  box-shadow: 0 0 0 10px rgba(115, 185, 255, 0.08);
  transition: box-shadow 0.25s ease, outline-color 0.25s ease;
}


/* =========================================================
   99. DESIGN / BRANDING ADMIN
   ========================================================= */
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-page .topbar {
  background: color-mix(in srgb, var(--header-bg) 90%, transparent);
}

.admin-design-grid {
  align-items: start;
}

.branding-preview {
  display: grid;
  gap: 12px;
}

.branding-preview-compact {
  gap: 12px;
}

.branding-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
}

.branding-preview-title-wrap {
  min-width: 0;
}

.branding-preview-title-wrap strong {
  display: block;
  margin-bottom: 3px;
}

.branding-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 12px;
}

.branding-preview-logo,
.branding-preview-home-logo,
.upload-card-preview img {
  max-width: 100%;
  max-height: 88px;
  object-fit: contain;
}

.branding-preview-home,
.branding-preview-card {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 12px;
  text-align: center;
  background: rgba(255,255,255,0.02);
}

.mini-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
}

.preview-mini-card {
  padding: 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
}

.preview-mini-card-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.preview-mini-button {
  margin-top: 10px;
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--accent);
  color: #08111d;
  font-weight: 700;
}

.branding-color-swatches,
.design-color-grid,
.design-upload-grid {
  display: grid;
  gap: 12px;
}

.design-color-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.design-upload-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.swatch-item,
.upload-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.compact-swatches {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.compact-swatch {
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.compact-swatch .muted {
  font-size: 0.8rem;
  line-height: 1.25;
  word-break: break-all;
}

.swatch-box {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  display: inline-block;
}

.branding-preview-icons {
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
}

.branding-icon-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.branding-icon-box {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--line);
}

.branding-icon-box img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.branding-icon-box span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 860px) {
  .branding-preview-grid {
    grid-template-columns: 1fr;
  }

  .landing-item-editor-grid {
    grid-template-columns: 1fr;
  }
}

.color-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.color-field-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-field input[type="color"] {
  width: 54px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
}

.color-field input[type="text"] {
  flex: 1;
}

.upload-card-preview {
  min-height: 110px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--line);
  padding: 12px;
}


.upload-preview-note {
  min-height: 20px;
  font-size: 0.92rem;
}

.upload-preview-note.is-live {
  color: var(--accent);
  font-weight: 700;
}

.upload-card input[type="file"] {
  width: 100%;
}


.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.preset-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.preset-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preset-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-swatch {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
}

.upload-card-master {
  margin-bottom: 12px;
}

.upload-card-preview-master img {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.preset-save-form {
  display: grid;
  gap: 12px;
}

.form-row-actions {
  align-self: end;
}

.preset-grid-managed {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.managed-preset-card.is-default {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 18px 40px rgba(0,0,0,0.18);
}

.preset-card-actions.compact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-card-actions.compact-actions form {
  margin: 0;
}

.map-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(140px, 1fr)) repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  align-items: center;
}

.map-filter-bar .check-line {
  min-height: 44px;
  margin: 0;
}

.map-filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.map-hint-row {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.leaflet-container {
  cursor: grab;
}

.leaflet-container:active {
  cursor: grabbing;
}

.map-popup {
  min-width: 190px;
}

.cluster-action-popup {
  display: grid;
  gap: 10px;
  min-width: 210px;
}

.cluster-action-buttons {
  display: grid;
  gap: 8px;
}

.cluster-action-buttons .btn {
  width: 100%;
  justify-content: center;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: var(--accent);
  color: #071220;
  font-weight: 800;
  border: 2px solid rgba(255,255,255,0.35);
}

@media (max-width: 1100px) {
  .map-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .map-filter-bar {
    grid-template-columns: 1fr;
  }

  .map-hint-row {
    align-items: stretch;
  }

  .map-hint-row .btn {
    width: 100%;
    justify-content: center;
  }
}


.photo-location-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.photo-location-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 18px;
  align-items: start;
}

.photo-location-thumb-wrap {
  width: 100%;
}

.photo-location-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.06);
}

.photo-location-inline-form .form-row {
  max-width: 440px;
}

.photo-location-missing-cell {
  display: grid;
  gap: 10px;
  max-width: 440px;
}

.photo-location-inline-input {
  width: 100%;
}

@media (max-width: 860px) {
  .photo-location-list {
    grid-template-columns: 1fr;
  }

  .photo-location-grid {
    grid-template-columns: 1fr;
  }

  .photo-location-thumb {
    aspect-ratio: 16 / 10;
  }
}

.location-missing-stats { display:flex; flex-direction:column; gap:6px; text-align:right; }
.location-missing-load-more { margin-top: 18px; display:flex; justify-content:center; }
@media (max-width: 760px) {
  .location-missing-stats { text-align:left; margin-top:10px; }
}


@media (max-width: 760px) {
  .lightbox-dialog-full {
    width: calc(100% - 12px);
    margin: 6px;
    max-width: none;
    max-height: calc(100vh - 12px);
    padding: 52px 10px 10px;
    border-radius: 18px;
  }

  .lightbox-grid-full,
  .lightbox-meta-full,
  .lightbox-media-column {
    gap: 10px;
  }

  .lightbox-media-wrap {
    min-height: 240px;
    border-radius: 18px;
    padding: 8px;
  }

  .lightbox-media-wrap img {
    max-height: 60vh;
    width: auto;
    border-radius: 14px;
  }

  .lightbox-nav-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .lightbox-nav-row > * {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.9rem;
    line-height: 1.2;
    justify-content: center;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    border-radius: 12px;
  }

  .lightbox-media-note {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .lightbox-meta-full > .eyebrow {
    font-size: 0.72rem;
  }

  .lightbox-meta-full > h2 {
    margin: 0;
    font-size: clamp(1.5rem, 7vw, 2rem);
    line-height: 1.08;
    word-break: break-word;
  }

  .lightbox-detail-card,
  .lightbox-date-editor,
  .meta-list div {
    padding: 12px;
    border-radius: 14px;
  }

  .meta-list dt {
    font-size: 0.74rem;
    margin-bottom: 4px;
  }

  .meta-list dd {
    font-size: 1rem;
    line-height: 1.3;
    word-break: break-word;
  }

  .lightbox-detail-card iframe {
    height: 220px;
    border-radius: 14px;
  }
}

@media (max-width: 520px) {
  .upload-panel {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-height: calc(100dvh - 16px);
  }

  .dropzone {
    padding: 16px 12px;
  }

  .progress-wrap {
    padding: 10px;
    border-radius: 14px;
  }

  .queue {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .photo-detail-image {
    max-height: 48vh !important;
  }

  .photo-detail-location-card {
    padding: 14px !important;
  }

  .photo-detail-map {
    height: 210px !important;
    border-radius: 14px !important;
  }

  .lightbox-dialog-full {
    width: calc(100% - 8px);
    margin: 4px;
    max-height: calc(100vh - 8px);
    padding: 48px 8px 8px;
    border-radius: 16px;
  }

  .lightbox-close {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
  }

  .lightbox-grid-full,
  .lightbox-meta-full,
  .lightbox-media-column {
    gap: 8px;
  }

  .lightbox-nav-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .lightbox-nav-row > * {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 0.84rem;
    border-radius: 11px;
  }

  .lightbox-media-wrap {
    min-height: 200px;
    border-radius: 14px;
    padding: 6px;
  }

  .lightbox-media-wrap img {
    max-height: 55vh;
    border-radius: 10px;
  }

  .lightbox-meta-full > h2 {
    font-size: clamp(1.35rem, 8vw, 1.75rem);
  }

  .meta-list,
  .lightbox-location-fields,
  .stack {
    gap: 10px;
  }

  .lightbox-detail-card,
  .lightbox-date-editor,
  .meta-list div {
    padding: 10px;
    border-radius: 12px;
  }

  .lightbox-detail-card iframe {
    height: 190px;
  }
}

@media (max-width: 380px) {
  .lightbox-nav-row {
    grid-template-columns: 1fr;
  }

  .lightbox-nav-row > * {
    min-height: 40px;
  }

  .lightbox-media-wrap img {
    max-height: 36vh;
  }
}
.nav-links a.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.admin-link-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.admin-link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.admin-link-card span {
  color: var(--muted);
  line-height: 1.5;
}

.landing-item-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-item-editor-card {
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.landing-section-editor-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.group-hero-card {
  display: grid;
  gap: 14px;
}

.group-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.group-hero-stat {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.group-hero-stat strong {
  font-size: 1.15rem;
}

.group-hero-stat span {
  color: var(--muted);
  font-size: 0.92rem;
}

.group-section-card {
  min-width: 0;
}

.group-list-stack {
  gap: 12px;
}

.group-item-card {
  display: grid;
  gap: 10px;
}

.group-item-toolbar {
  width: 100%;
}

.group-inline-form {
  margin: 0;
}

.invite-item-card .muted {
  line-height: 1.5;
}

@media (max-width: 760px) {
  .group-hero-card {
    padding: 18px;
  }

  .group-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .group-hero-stat {
    padding: 12px 14px;
  }

  .group-item-toolbar,
  .group-purchase-form,
  .group-item-card .toolbar {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .group-item-card .btn,
  .group-inline-form .btn,
  .group-purchase-form .btn,
  .group-section-card .gallery-toolbar-actions.wrap-actions .btn {
    width: 100%;
  }

  .group-billing-grid {
    gap: 14px;
  }

  .invite-item-card,
  .group-item-card {
    padding: 12px !important;
  }
}
