*, *::before, *::after { box-sizing: border-box; }

:root {
  --akzent: #8a7b6b;
  --bg: #faf7f2;
  --text: #2e2a26;
  --muted: #7d756c;
  --linie: rgba(0,0,0,.10);
  --karte: #fff;
  --schatten: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 72px; }
.wrap--breit { max-width: 1180px; }

/* ---------- Kopf ---------- */

header.kopf { text-align: center; padding: 24px 0 32px; }

.kopf .zier {
  display: block; width: 54px; height: 1px;
  background: var(--akzent); opacity: .5;
  margin: 0 auto 24px;
}

h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 2.9rem);
  letter-spacing: .01em;
  margin: 0 0 10px;
}

.kopf .datum {
  font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 18px;
}

.kopf p.lead { color: var(--muted); margin: 0; font-size: 1.02rem; }

/* ---------- Karte ---------- */

.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 14px;
  padding: 26px;
  box-shadow: var(--schatten);
}

.karte + .karte { margin-top: 20px; }

h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 400; font-size: 1.3rem; margin: 0 0 14px;
}

/* ---------- Formular ---------- */

label { display: block; font-size: .82rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }

input[type=text], input[type=password] {
  width: 100%; padding: 13px 14px; font-size: 17px; font-family: inherit;
  color: var(--text); background: #fff;
  border: 1px solid var(--linie); border-radius: 9px;
}

input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; border-color: transparent; }

.feld + .feld { margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; font-size: 16px; font-family: inherit; font-weight: 500;
  color: #fff; background: var(--akzent);
  border: 1px solid var(--akzent); border-radius: 9px;
  cursor: pointer; text-decoration: none; -webkit-appearance: none;
}
.btn:hover { filter: brightness(.93); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn--weiss { background: #fff; color: var(--text); border-color: var(--linie); }
.btn--voll { width: 100%; }
.btn--klein { padding: 9px 16px; font-size: 14px; }

/* ---------- Dropzone ---------- */

.dropzone {
  display: block; text-align: center; cursor: pointer;
  padding: 40px 20px;
  border: 2px dashed rgba(0,0,0,.16); border-radius: 12px;
  background: rgba(0,0,0,.015);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.aktiv { border-color: var(--akzent); background: rgba(138,123,107,.07); }
.dropzone .gross { font-size: 1.05rem; font-weight: 500; display: block; margin-bottom: 6px; }
.dropzone .klein { font-size: .88rem; color: var(--muted); }
.dropzone input[type=file] { display: none; }

/* ---------- Upload-Liste ---------- */

.queue { list-style: none; margin: 20px 0 0; padding: 0; }
.queue li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--linie);
}
.queue .vorschau {
  width: 52px; height: 52px; flex: 0 0 52px;
  object-fit: cover; border-radius: 7px; background: #eee;
}
.queue .name {
  flex: 1; min-width: 0; font-size: .9rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.queue .status { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.queue .status.ok { color: #3f7d4e; }
.queue .status.fehler { color: #b03b34; }

.balken { height: 3px; background: rgba(0,0,0,.08); border-radius: 3px; overflow: hidden; margin-top: 14px; }
.balken > i { display: block; height: 100%; width: 0; background: var(--akzent); transition: width .2s; }

/* ---------- Hinweise ---------- */

.hinweis {
  padding: 13px 16px; border-radius: 9px; font-size: .92rem;
  background: rgba(138,123,107,.10); color: #5c5348; margin-bottom: 18px;
}
.hinweis--fehler { background: rgba(176,59,52,.10); color: #8d2f29; }
.hinweis--ok { background: rgba(63,125,78,.12); color: #2f5f3b; }

.meta { font-size: .84rem; color: var(--muted); text-align: center; margin-top: 18px; }
.meta a { color: var(--akzent); }

/* ---------- Galerie ---------- */

.galerie {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin-top: 22px;
}
.galerie a {
  display: block; position: relative; aspect-ratio: 1;
  border-radius: 9px; overflow: hidden; background: #ece7e0;
}
.galerie img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galerie .von {
  position: absolute; inset: auto 0 0 0; padding: 16px 8px 6px;
  font-size: .74rem; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.leiste {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between; margin-bottom: 4px;
}
.zaehler { font-size: .88rem; color: var(--muted); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 50; display: none;
  background: rgba(20,17,14,.94);
  align-items: center; justify-content: center;
}
.lightbox.offen { display: flex; }
.lightbox img { max-width: 94vw; max-height: 82vh; object-fit: contain; border-radius: 4px; }
.lightbox .lb-leiste {
  position: absolute; inset: auto 0 0 0; padding: 16px;
  display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap;
}
.lightbox .lb-zu {
  position: absolute; top: 12px; right: 14px;
  background: none; border: 0; color: #fff; font-size: 30px; line-height: 1;
  cursor: pointer; padding: 8px;
}
.lightbox .lb-pfeil {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12); border: 0; color: #fff;
  font-size: 26px; width: 46px; height: 46px; border-radius: 50%;
  cursor: pointer;
}
.lightbox .lb-vor { right: 12px; }
.lightbox .lb-zurueck { left: 12px; }

/* ---------- Admin ---------- */

.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--linie); }
.tabelle th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.tabelle img { width: 46px; height: 46px; object-fit: cover; border-radius: 5px; display: block; }

@media (max-width: 480px) {
  .wrap { padding: 20px 14px 60px; }
  .karte { padding: 20px 16px; }
  .galerie { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 7px; }
}
