/* Fotogalerie – Farben hier anpassen (Vereinsfarben ESC Erfurt) */
:root {
  --esc: #0068B4;        /* ESC-Blau aus dem Logo */
  --esc-light: #DFE6F4;  /* helles Eisblau aus dem Logo */
  --navy: #003f6e;
  --navy-2: #00528f;
  --ice: #edf2fa;
  --ice-2: #DFE6F4;
  --accent: #0068B4;
  --accent-dark: #00528f;
  --bg: #f5f8fc;
  --card: #ffffff;
  --text: #13263a;
  --muted: #5f748a;
  --line: #dce6ef;
  --danger: #c2372d;
  --ok: #1d7a46;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 37, 64, .06), 0 4px 16px rgba(13, 37, 64, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html.lb-open { overflow: hidden; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }
h1, h2 { overflow-wrap: break-word; hyphens: auto; line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.is-admin .wrap { max-width: 900px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  background: var(--navy);
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 10px 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background:
    radial-gradient(circle at 50% 50%, var(--navy) 0 6px, transparent 7px),
    radial-gradient(circle at 50% 50%, #fff 0 11px, transparent 12px),
    linear-gradient(135deg, #7cc4f5, #2f86e0);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.05rem; }
.brand-text small { color: #a9c4dd; font-size: .8rem; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { color: #dbe9f6; text-decoration: none; font-size: .92rem; padding: 6px 10px; border-radius: 8px; }
.topnav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Startseite ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy-2), #2a6aa8 60%, #6fb3e6);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 48px);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto -10% -60% 40%; height: 140%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent);
  pointer-events: none;
}
.hero p { margin: 0; color: #dcecf9; max-width: 34em; }

.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.album-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.album-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(13, 37, 64, .12); }
.album-cover { position: relative; aspect-ratio: 3 / 2; background: var(--ice); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-count {
  position: absolute; right: 10px; bottom: 10px; background: rgba(13, 37, 64, .78); color: #fff;
  font-size: .78rem; padding: 3px 9px; border-radius: 99px; backdrop-filter: blur(4px);
}
.album-meta { padding: 14px 16px 16px; }
.album-meta h2 { margin: 0 0 2px; font-size: 1.05rem; overflow-wrap: anywhere; hyphens: auto; }
.album-meta p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- Albumseite ---------- */
.album-head { margin-bottom: 20px; }
.album-sub { color: var(--muted); margin: 0 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.album-desc { max-width: 46em; margin: 0 0 12px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: .92rem; }

/* Bündiges Fotoraster: alle Fotos einer Zeile gleich hoch */
.jg { display: flex; flex-wrap: wrap; gap: 6px; }
.jg::after { content: ""; flex-grow: 999999; }
.jg .ph {
  margin: 0;
  flex-grow: calc(var(--r) * 100);
  flex-basis: calc(var(--r) * 230px);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.jg a {
  display: block;
  aspect-ratio: var(--r);
  background: var(--ice-2);
  border-radius: 6px;
  overflow: hidden;
  max-height: 460px;
}
.jg img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s, transform .3s; }
.jg a:hover img { transform: scale(1.02); }
@media (max-width: 600px) {
  .jg { gap: 4px; }
  .jg .ph { flex-basis: calc(var(--r) * 130px); }
  .jg a { border-radius: 4px; }
  .jg figcaption { font-size: .7rem; }
}

/* ---------- Großansicht ---------- */
.lb {
  position: fixed; inset: 0; z-index: 100; background: #060e18;
  display: grid; grid-template-columns: 60px 1fr 60px; grid-template-rows: auto 1fr;
  touch-action: pan-y;
}
.lb-top {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px 18px; color: #c9d7e4; font-size: .9rem;
}
.lb-tools { display: flex; gap: 6px; }
.lb-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1);
  color: #fff; font-size: 1.1rem; display: grid; place-items: center; text-decoration: none; cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, .2); }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: 0 0 calc(16px + env(safe-area-inset-bottom)); }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity .2s; user-select: none; }
.lb-stage img.loading { opacity: .35; }
.lb-nav { background: none; border: 0; color: #fff; font-size: 3rem; cursor: pointer; opacity: .7; }
.lb-nav:hover { opacity: 1; }
@media (max-width: 700px) {
  .lb { grid-template-columns: 1fr; }
  .lb-stage { grid-column: 1; grid-row: 2; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .lb-nav { display: none; }
}

/* ---------- Formulare & Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; min-height: 44px;
}
.btn:hover { border-color: #b9cadb; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: var(--ice); border-color: var(--ice-2); color: var(--navy-2); }
.btn-danger { background: #fff; border-color: #efc2be; color: var(--danger); }
.btn-danger:hover { background: #fdf1f0; border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 8px 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.danger-link { color: var(--danger); }

input[type=text], input[type=password], input[type=date], input:not([type]), textarea {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 4px;
}
input:focus, textarea:focus { outline: 2px solid rgba(0, 104, 180, .3); border-color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.stack > .btn { align-self: flex-start; }
.stack > .btn-block { align-self: stretch; }
label { font-weight: 600; font-size: .92rem; }
label .muted { font-weight: 400; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; }
.choice { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.radio {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; font-weight: 400;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff;
}
.radio:has(input:checked) { border-color: var(--accent); background: #f2f8fe; }
.radio input { margin-top: 4px; width: 18px; height: 18px; }
.radio span { display: flex; flex-direction: column; }
.radio small { color: var(--muted); }
.form-error { color: var(--danger); font-weight: 600; }

/* ---------- Passwortabfrage / Login ---------- */
.gate {
  max-width: 420px; margin: 6vh auto 0; text-align: center; background: var(--card);
  padding: 32px 24px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.gate .stack { text-align: left; margin-top: 18px; }
.gate-icon { font-size: 2.2rem; margin-bottom: 8px; }
.gate-form { display: flex; gap: 8px; margin-top: 16px; }
.gate-form input { margin: 0; }

/* ---------- Verwaltung ---------- */
.page-head { margin-bottom: 18px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}
.card > h2 { margin-bottom: 12px; }
.new-album > summary { list-style: none; display: inline-flex; }
.new-album > summary::-webkit-details-marker { display: none; }
.new-album[open] > summary { margin-bottom: 18px; }
details.card:not([open]) { background: none; box-shadow: none; padding: 0; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; }
.flash-ok { background: #e6f5ec; color: var(--ok); }
.flash-error { background: #fdecea; color: var(--danger); }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.badge-public { background: #e3f4ea; color: var(--ok); }
.badge-internal { background: #fff1d9; color: #8a5a00; }

.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row {
  display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px;
  background: var(--card); color: inherit; text-decoration: none; box-shadow: var(--shadow);
}
.card .admin-row { box-shadow: none; border: 1px solid var(--line); }
a.admin-row:hover { outline: 2px solid var(--ice-2); }
.admin-thumb { width: 72px; height: 54px; border-radius: 8px; overflow: hidden; background: var(--ice); flex: none; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-row-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-row-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row-text small { color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ice); color: var(--navy-2); display: grid; place-items: center; font-weight: 700; }

.link-card { border-left: 4px solid #f0b43c; }
.copy-row { display: flex; gap: 8px; margin: 10px 0 4px; }
.copy-row input { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }

.dropzone {
  border: 2px dashed #a9c6e2; border-radius: var(--radius); background: #f7fbff;
  padding: 28px 16px; text-align: center; transition: background .15s, border-color .15s;
}
.dropzone.is-over { background: var(--ice); border-color: var(--accent); }
.dz-icon {
  width: 52px; height: 52px; margin: 0 auto 8px; border-radius: 50%; background: var(--ice-2);
  color: var(--accent); display: grid; place-items: center; font-size: 1.5rem;
}
.dropzone p { margin: 6px 0 12px; }
.progress { height: 10px; background: var(--ice-2); border-radius: 99px; overflow: hidden; max-width: 420px; margin: 8px auto 14px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.dz-errors { text-align: left; color: var(--danger); font-size: .88rem; max-width: 520px; margin: 10px auto 0; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--ice); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile.is-new { animation: pop .35s ease; }
.tile.is-cover { outline: 3px solid #f0b43c; outline-offset: -3px; }
.tile.is-cover::before {
  content: "Titelbild"; position: absolute; left: 6px; top: 6px; z-index: 1;
  background: #f0b43c; color: #3d2800; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 99px;
}
.tile-actions { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 6px; }
.tile-actions form { margin: 0; }
.tile-actions button {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(13, 37, 64, .72); color: #fff; font-size: .95rem; backdrop-filter: blur(4px);
}
.tile-actions button:hover { background: var(--navy); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

.danger { border: 1px solid #f3d3d0; box-shadow: none; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h1 { color: var(--text); }

/* ---------- Fußzeile ---------- */
.footer { color: var(--muted); font-size: .82rem; padding: 20px 0 calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

@media (max-width: 600px) {
  .main { padding-top: 16px; }
  .topbar-in { min-height: 56px; gap: 0; }
  .topnav { margin: 0 -10px 6px; }
  .topnav a { font-size: .85rem; }
  .is-public .topnav { display: none; }
  .card { padding: 16px; }
  .albums { grid-template-columns: 1fr 1fr; gap: 12px; }
  .album-meta { padding: 10px 12px 12px; }
  .album-meta h2 { font-size: .95rem; }
  .album-meta p { font-size: .8rem; }
  .copy-row { flex-direction: column; }
  .admin-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* =========================================================
   Version 1.1 – System, Protokoll, Zugänge, Speicher
   ========================================================= */
.topnav a[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 99px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1;
}
.footer-in { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }

select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); margin-top: 4px; min-height: 44px;
}
.warn-text { color: #9a5b00; }
.badge-admin { background: #e4ecfb; color: #1d4ea3; }
.badge-neutral { background: #eef2f6; color: #44586c; }
.badge-danger { background: #fdecea; color: var(--danger); }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats > div { display: flex; flex-direction: column; }
.stats strong { font-size: 1.35rem; line-height: 1.2; color: var(--navy); }
.stats span { font-size: .8rem; color: var(--muted); }
.stat-ok strong { color: var(--ok); }
.stat-warn strong { color: #9a5b00; }
.stat-fail strong { color: var(--danger); }
.meter { height: 10px; border-radius: 99px; background: var(--ice); overflow: hidden; margin: 16px 0 6px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #4fa3ea, var(--accent)); border-radius: 99px; }
.storage.is-warn .meter span { background: linear-gradient(90deg, #f0b43c, #e07a1a); }
.storage.is-warn { border: 1px solid #f3d9a8; }
.storage .muted.small { margin: 0; }

/* Reiter */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 6px; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 7px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line);
  text-decoration: none; color: var(--text); font-size: .9rem; font-weight: 600;
}
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Systemcheck */
.checks, .sizes { width: 100%; border-collapse: collapse; font-size: .93rem; }
.checks td, .sizes td, .sizes th { padding: 10px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.checks tr:first-child td { border-top: 0; }
.checks .val, .sizes .val { text-align: right; color: var(--muted); white-space: nowrap; }
.checks .st-cell { width: 34px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.row-fail .hint { color: var(--danger); }
.row-fail .val { color: var(--danger); font-weight: 700; white-space: normal; }
.st {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: .8rem; font-weight: 800; color: #fff;
}
.st-ok { background: var(--ok); }
.st-warn { background: #e39b17; }
.st-fail { background: var(--danger); }
.st-info { background: #9fb3c6; }
.sizes { margin-top: 14px; }
.sizes th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 600; border-top: 0; }
.sizes th:nth-child(n+2), .sizes td:nth-child(2) { text-align: right; }
.sizes a { text-decoration: none; color: var(--text); font-weight: 600; }
.bar { height: 5px; background: var(--ice); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; background: #7db8ec; }

/* Protokoll */
.log { list-style: none; margin: 0; padding: 0; }
.log li { border-top: 1px solid var(--line); padding: 12px 0 12px 12px; border-left: 3px solid transparent; }
.log li:first-child { border-top: 0; }
.log-warning { border-left-color: #e39b17 !important; }
.log-error, .log-critical { border-left-color: var(--danger) !important; background: #fff8f7; }
.log-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.lvl { font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: .7rem; }
.log-warning .lvl { color: #9a5b00; }
.log-error .lvl, .log-critical .lvl { color: var(--danger); }
.log-msg { margin: 3px 0; word-break: break-word; }
.log-meta { font-size: .78rem; color: var(--muted); word-break: break-all; }
.log-meta pre { background: var(--bg); padding: 10px; border-radius: 8px; overflow: auto; font-size: .78rem; white-space: pre-wrap; }
.log-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: .9rem; }

/* Zugänge */
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user { border: 1px solid var(--line); border-radius: 12px; }
.user > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px; cursor: pointer; }
.user > summary::-webkit-details-marker { display: none; }
.user[open] > summary { border-bottom: 1px solid var(--line); }
.user.is-locked > summary { opacity: .65; }
.user-badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.user-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.user-body p { margin: 0; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.user-actions form { margin: 0; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1; min-width: 200px; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pw-row .btn { margin-top: 4px; }

/* Zwei-Faktor */
.code-input {
  font-family: ui-monospace, Menlo, Consolas, monospace !important; font-size: 1.4rem !important;
  letter-spacing: .25em; text-align: center; max-width: 220px;
}
.gate .code-input { max-width: none; }
.steps { padding-left: 20px; margin: 0 0 14px; }
.steps li { margin-bottom: 10px; }
.qr { width: 200px; max-width: 100%; margin: 10px 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-size: .95rem; letter-spacing: .05em; background: var(--ice); padding: 4px 8px; border-radius: 6px; display: inline-block; margin-top: 4px; word-break: break-all; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

@media (max-width: 600px) {
  .stats strong { font-size: 1.1rem; }
  .user > summary { flex-wrap: wrap; }
  .user-badges { width: 100%; justify-content: flex-start; padding-left: 52px; }
  .checks .val { white-space: normal; max-width: 40%; }
}

/* =========================================================
   Version 1.2 – Persönliche Freigaben
   ========================================================= */
.badge-personal { background: #efe7fd; color: #5b2bb5; }
.avatar-person { background: #efe7fd; color: #5b2bb5; }
.person-group { margin-bottom: 28px; }
.person-group h2 { font-size: 1.05rem; margin-bottom: 10px; }
.person-group h2 .muted { font-weight: 400; font-size: .88rem; margin-left: 4px; }
.person-albums { display: flex; flex-wrap: wrap; gap: 6px; }
.person-albums .chip { font-size: .82rem; padding: 5px 11px; }
.copy-row [data-share][hidden] { display: none; }

.dz-person { display: block; max-width: 320px; margin: 14px auto 0; text-align: left; font-size: .88rem; }
.dz-person select { width: 100%; }

.assign-bar { margin: 0 0 12px; }
.assign-bar label { display: block; font-size: .9rem; }
.assign-bar select { width: 100%; max-width: 360px; display: block; }
.assign-help {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #f3eefd; color: #3f1f80; font-size: .88rem;
  position: sticky; top: 8px; z-index: 5; box-shadow: 0 2px 10px rgba(91, 43, 181, .12);
}
.assign-tools { display: flex; align-items: center; gap: 12px; }
.assign-tools .btn { min-height: 36px; padding: 6px 14px; }

.tile-people {
  position: absolute; left: 6px; bottom: 6px; z-index: 1; background: rgba(91, 43, 181, .85); color: #fff;
  font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 99px;
}
.tile-check {
  position: absolute; right: 6px; top: 6px; z-index: 2; width: 28px; height: 28px; border-radius: 50%;
  display: none; place-items: center; font-weight: 800; color: #fff; background: rgba(13, 37, 64, .45);
  border: 2px solid #fff;
}
.is-assigning .tile { cursor: pointer; }
.is-assigning .tile-actions { display: none; }
.is-assigning .tile-check { display: grid; color: transparent; }
.is-assigning .tile img { opacity: .55; transition: opacity .15s; }
.is-assigning .tile.is-assigned img { opacity: 1; }
.is-assigning .tile.is-assigned { outline: 3px solid #7a45d6; outline-offset: -3px; }
.is-assigning .tile.is-assigned .tile-check { background: #7a45d6; color: #fff; }
.is-assigning .tile.is-cover::before { display: none; }


/* =========================================================
   Version 1.3 – Vereinsdesign mit ESC-Logo
   ========================================================= */
.topbar {
  background: #fff;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 104, 180, .04), 0 6px 20px rgba(0, 63, 110, .05);
  position: relative;
}
.topbar::after { /* feine Linie in Vereinsfarben */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--esc) 0 60%, var(--esc-light) 60% 100%);
}
.topbar-in { min-height: 92px; }
.brand { color: var(--esc); gap: 16px; padding: 10px 0; }
.brand-logo { height: 70px; width: auto; display: block; }
.brand-text { padding-left: 16px; border-left: 2px solid var(--esc-light); }
.brand-text strong { font-size: 1.25rem; color: var(--esc); letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: .82rem; }
.topnav a { color: var(--navy-2); font-weight: 600; }
.topnav a:hover { background: var(--ice); color: var(--esc); }
.topnav a[aria-current="page"] { background: var(--esc-light); color: var(--esc); }

/* Kopfbereich der Startseite: ESC-Blau mit den Bögen aus dem Logo */
.hero {
  background-color: var(--esc);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 300' preserveAspectRatio='none'%3E%3Cpath d='M120 300 C 230 120 360 40 470 40 C 560 40 600 120 620 300 C 590 190 540 100 460 92 C 360 82 230 170 120 300 Z' fill='%23ffffff' fill-opacity='.16'/%3E%3Cpath d='M40 300 C 170 150 300 85 420 80 C 330 70 200 120 40 300 Z' fill='%23DFE6F4' fill-opacity='.22'/%3E%3Cellipse cx='380' cy='300' rx='330' ry='46' fill='none' stroke='%23ffffff' stroke-opacity='.28' stroke-width='3'/%3E%3C/svg%3E"),
    linear-gradient(120deg, #00528f 0%, var(--esc) 45%, #3a8fd0 100%);
  background-size: 100% 100%, cover;
  background-repeat: no-repeat;
}
.hero::after { display: none; }
.hero p { color: var(--esc-light); }

.album-count { background: rgba(0, 63, 110, .82); }
.tile-actions button { background: rgba(0, 63, 110, .75); }
.lb { background: #04192b; }

@media (max-width: 600px) {
  .topbar-in { min-height: 64px; }
  .brand { gap: 10px; padding: 8px 0; }
  .brand-logo { height: 46px; }
  .brand-text { padding-left: 10px; }
  .brand-text strong { font-size: 1.02rem; }
  .brand-text small { font-size: .74rem; }
}

/* =========================================================
   Version 1.4 – Impressum & Datenschutz
   ========================================================= */
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--esc); text-decoration: underline; }
.legal { max-width: 760px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 40px); }
.legal h2 { font-size: 1.08rem; margin: 1.6em 0 .4em; color: var(--navy); scroll-margin-top: 16px; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 20px; }
.legal .lead { font-size: 1.02rem; }
.legal-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 6px; }
.legal-toc a { font-size: .82rem; padding: 4px 10px; border-radius: 99px; background: var(--ice); text-decoration: none; color: var(--navy-2); }
.legal-missing { background: #fff1b8; color: #7a5300; padding: 0 4px; border-radius: 4px; font-weight: 600; }
.req { color: var(--danger); }
.ok-text { color: var(--ok); font-weight: 600; margin: 0; }
.form-section { font-size: 1rem; margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }

/* Seitenschutz */
.gate-site { margin-top: 4vh; }
.gate-logo { width: 190px; max-width: 70%; height: auto; margin: 0 auto 10px; }
.gate-site h1 { color: var(--esc); }
.gate-hint { margin: 18px 0 0; }
.gate-status.is-on { border-left: 4px solid var(--ok); }
.gate-status.is-off { border-left: 4px solid #e39b17; }
.gate-rules { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.check span strong { font-weight: 700; }
.tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; flex: none; }
input, textarea, select { font-weight: 400; }
@media (max-width: 600px) { .tabs a { padding: 10px 9px; font-size: .92rem; } }

/* Teilen */
.share { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.share .copy-row { margin: 0; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-buttons .btn { flex: 1 1 120px; }
.btn-wa { background: #25D366; border-color: #25D366; color: #fff; }
.btn-wa:hover { background: #1ebe5a; border-color: #1ebe5a; }
.btn-mail { background: var(--esc-light); border-color: var(--esc-light); color: var(--esc); }
.btn-mail:hover { border-color: var(--esc); }
.share-msg summary { cursor: pointer; color: var(--accent); font-size: .88rem; padding: 2px 0; }
.share-msg textarea { margin-top: 6px; font-size: .92rem; }
.link-card-public { border-left: 4px solid var(--esc); }

/* ZIP-Download unter den Fotos */
.zip-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 28px 0 8px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; }
.zip-bar .btn { min-width: 280px; }
@media (max-width: 600px) { .zip-bar .btn { width: 100%; min-width: 0; } }

/* Übersicht interne Alben */
.internal-album > summary .admin-thumb { width: 64px; height: 48px; }
.internal-album .admin-row-text small + small { font-size: .78rem; }
.chips#liste { margin-top: 6px; }
.legal-box { margin: 1.6em 0 1em; padding: 4px 18px 10px; border: 2px solid var(--esc); border-radius: 12px; background: #f6f9fd; }
.legal-box h2 { margin-top: .8em; }

/* Statistik */
.stats-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .stats-4 { grid-template-columns: 1fr 1fr; row-gap: 16px; } }
.chart-card h2 .muted, .card h2 .muted { font-weight: 400; font-size: .85rem; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: #b9c7d6; stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .mark { fill: var(--esc); }
.chart .hit { fill: transparent; }
.chart .bar:hover .mark, .chart .bar.is-active .mark { fill: var(--navy-2); }
.chart .bar:hover .hit, .chart .bar.is-active .hit { fill: rgba(0, 104, 180, .06); }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap;
  background: var(--navy); color: #fff; font-size: .8rem; padding: 5px 9px; border-radius: 8px; box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; }
.stats-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-table th:not(:first-child) { text-align: right; }
.stats-table .badge { margin-left: 6px; font-size: .68rem; }
.top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.top-tile { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--ice); display: block; }
.top-tile img { width: 100%; height: 100%; object-fit: cover; }
.top-rank, .top-n { position: absolute; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.top-rank { left: 6px; top: 6px; background: #fff; color: var(--navy); }
.top-n { right: 6px; bottom: 6px; background: rgba(0, 63, 110, .82); color: #fff; }
@media (max-width: 600px) { .chart .axis { font-size: 19px; } }

/* Personen: Galerie ansehen */
.view-btn {
  flex: none; margin-left: auto; padding: 7px 11px; border-radius: 9px; font-size: .85rem; font-weight: 600;
  background: var(--esc-light); color: var(--esc); text-decoration: none; white-space: nowrap;
}
.view-btn:hover { background: var(--esc); color: #fff; }
.person > summary .user-badges { margin-left: auto; }
.person > summary .user-badges:empty { display: none; }
.view-gallery { align-self: flex-start; }
@media (max-width: 600px) {
  .person > summary { position: relative; }
  .person > summary .view-btn { position: absolute; right: 10px; top: 12px; }
  .person > summary .admin-row-text { padding-right: 96px; }
}

/* Alben: Ansehen-Knopf */
.album-row { padding: 0; gap: 0; align-items: stretch; }
.album-row-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 10px; color: inherit; text-decoration: none; border-radius: 12px; }
.album-row-link:hover { background: var(--ice); }
.album-row > .view-btn { align-self: center; margin: 0 10px 0 4px; }
.internal-album > summary { position: relative; }
.internal-album > summary .view-btn { margin-left: 8px; }
@media (max-width: 600px) {
  .album-row { position: relative; }
  .album-row-link { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; align-items: start; }
  .album-row-link .admin-thumb { grid-row: span 2; }
  .album-row-link .admin-row-text { padding-right: 92px; }
  .album-row-link .admin-row-text strong { white-space: normal; }
  .album-row-link .badge { grid-column: 2; justify-self: start; }
  .album-row > .view-btn { position: absolute; right: 10px; top: 10px; margin: 0; }
  .internal-album > summary .view-btn { position: absolute; right: 10px; top: 12px; }
  .internal-album > summary .admin-row-text { padding-right: 96px; }
}
.page-head .view-gallery { margin-top: 4px; }
@media (max-width: 600px) {
  .album-row-link .admin-row-text strong,
  .internal-album .admin-row-text strong,
  .person .admin-row-text strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; hyphens: auto; }
}

/* Fotonamen unter den Bildern */
.jg figcaption {
  font-size: .78rem; color: var(--muted); padding: 4px 2px 6px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.jg.has-names { row-gap: 2px; }
.lb-count { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.lb-name { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   Version 1.10 – Web-App
   ========================================================= */
.gate-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.gate-stack .gate-form { margin-top: 0; }
.gate-remember { justify-content: center; font-size: .9rem; color: var(--muted); }
.gate .check { text-align: left; }
.app-page { max-width: 640px; }
.app-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.app-hero img { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); flex: none; }
.app-hero h1 { margin-bottom: 4px; }
.app-steps { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px 8px; margin: 12px 0; opacity: .75; }
.app-steps.is-current { opacity: 1; border-color: var(--esc); background: #f6f9fd; box-shadow: 0 0 0 3px var(--esc-light); }
.app-steps h2 { margin-top: .8em; }
.ios-share { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--esc-light); color: var(--esc); font-size: .8rem; }
.footer-links .app-link { font-weight: 600; color: var(--esc); }
@media (max-width: 600px) { .footer-links { flex-wrap: wrap; gap: 6px 16px; } }

/* Als installierte App geöffnet */
.is-app .footer-links .app-link { display: none; }
.is-app body { -webkit-user-select: none; user-select: none; }
.is-app input, .is-app textarea { -webkit-user-select: text; user-select: text; }
@media (display-mode: standalone) {
  .topbar { position: sticky; top: 0; z-index: 50; }
}
