:root {
  --bg: #0b0d10;
  --bg-2: #14181d;
  --bg-3: #1b2129;
  --linie: #252c36;
  --text: #e8ebf0;
  --text-schwach: #8792a2;
  --akzent: #ff6d5a;
  --akzent-weich: rgba(255, 109, 90, .14);
  --radius: 12px;
  --leiste-breite: 232px;
  --schatten: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { scrollbar-color: #333c48 transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

/* ── Seitenleiste ─────────────────────────────────────────────────── */
.leiste {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--leiste-breite);
  background: var(--bg-2);
  border-right: 1px solid var(--linie);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .18s ease;
}
body.leiste-zu .leiste { transform: translateX(-100%); }

.leiste-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 14px 16px;
  border-bottom: 1px solid var(--linie);
}
.marke { font-weight: 700; letter-spacing: .2px; font-size: 15px; }

.projekte { flex: 1; overflow-y: auto; padding: 10px 8px; }

.projekt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  margin: 1px 0;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-schwach);
  cursor: pointer;
  text-align: left;
}
.projekt:hover { background: var(--bg-3); color: var(--text); }
.projekt.an { background: var(--akzent-weich); color: var(--akzent); font-weight: 600; }
.projekt .p-ikon { flex: none; opacity: .85; }
.projekt .p-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projekt .p-anzahl { flex: none; font-size: 11.5px; opacity: .75; }

.projekt-rubrik {
  padding: 14px 12px 4px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-schwach);
}

.leiste-fuss {
  padding: 10px 16px;
  border-top: 1px solid var(--linie);
  color: var(--text-schwach);
  font-size: 11.5px;
}

.leiste-schleier {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 35;
}

/* ── Inhalt ───────────────────────────────────────────────────────── */
.inhalt { margin-left: var(--leiste-breite); transition: margin-left .18s ease; }
body.leiste-zu .inhalt { margin-left: 0; }

.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
  min-height: 54px;
}
#leiste-auf { display: none; }
body.leiste-zu #leiste-auf { display: inline-flex; }

.titel { font-size: 16px; font-weight: 650; margin: 0; }
.zaehler { color: var(--text-schwach); font-size: 13px; }

.unterordner { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--linie);
  background: var(--bg-2);
  color: var(--text-schwach);
  cursor: pointer;
  font-size: 12px;
}
.chip:hover { color: var(--text); border-color: #3a4450; }
.chip.an { background: var(--akzent); border-color: var(--akzent); color: #16100e; font-weight: 600; }

.suche {
  width: 210px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--linie);
  background: var(--bg-2);
  color: var(--text);
  outline: none;
  transition: border-color .12s, width .15s;
}
.suche:focus { border-color: var(--akzent); width: 260px; }

.knopf {
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--linie);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  font-size: 12.5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.knopf:hover { border-color: var(--akzent); }
.knopf.hell { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); }
.knopf.hell:hover { border-color: var(--akzent); }

.ikon-knopf {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-schwach);
  cursor: pointer;
  font-size: 15px;
}
.ikon-knopf:hover { background: var(--bg-3); color: var(--text); }
.ikon-knopf.hell { color: #cfd6df; }
.ikon-knopf.hell:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ── Hinweis auf neue Dateien ─────────────────────────────────────── */
.neuling {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 66px;
  z-index: 30;
  background: var(--akzent);
  color: #16100e;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--schatten);
  animation: rein .2s ease;
}
@keyframes rein { from { opacity: 0; transform: translate(-50%, -6px); } }

/* ── Gitter ───────────────────────────────────────────────────────── */
.gitter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: 14px;
  padding: 18px;
}

.tag-trenner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-schwach);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 8px 0 -2px;
}
.tag-trenner::after { content: ""; flex: 1; height: 1px; background: var(--linie); }

.kachel {
  background: var(--bg-2);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  content-visibility: auto;
  contain-intrinsic-size: 216px 268px;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.kachel:hover { border-color: #3a4450; transform: translateY(-2px); box-shadow: var(--schatten); }
.kachel:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.kachel .bild {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #07090b;
  overflow: hidden;
}
.kachel .bild img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .25s ease;
}
.kachel .bild img.da { opacity: 1; }
.kachel:hover .bild img { filter: brightness(1.06); }

.kachel .marker {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(4px);
  border-radius: 7px;
  padding: 2px 8px;
  font-size: 11px;
  color: #fff;
  pointer-events: none;
}

.kachel .fuss { padding: 8px 11px 10px; }
.kachel .dateiname {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kachel .meta {
  color: var(--text-schwach);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
}
.kachel .meta .ordnername { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kachel .meta .zeit { flex: none; }

.leer { color: var(--text-schwach); padding: 60px 16px; text-align: center; line-height: 2; }
.leer code { background: var(--bg-2); border: 1px solid var(--linie); padding: 2px 8px; border-radius: 7px; }

/* ── Lupe (Vollbild) ──────────────────────────────────────────────── */
.lupe {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #05060a;
  display: flex;
  flex-direction: column;
  animation: lupe-auf .15s ease;
}
@keyframes lupe-auf { from { opacity: 0; } }
.lupe[hidden] { display: none; }

.lupe-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  flex: none;
}
.lupe-name { font-size: 13px; color: var(--text-schwach); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lupe-knoepfe { display: flex; gap: 8px; flex: none; align-items: center; }

.lupe-buehne {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 64px 10px;
  min-height: 0;
  position: relative;
}
.lupe-buehne img, .lupe-buehne video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.lupe-buehne img.grob { filter: blur(10px) brightness(.9); transform: scale(1.005); }
.lupe-buehne img { transition: filter .2s ease; }

.lupe-fuss {
  flex: none;
  text-align: center;
  color: var(--text-schwach);
  font-size: 12px;
  padding: 0 16px 12px;
  min-height: 18px;
}

.pfeil {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 76px;
  border: 0;
  background: rgba(255, 255, 255, .06);
  color: #cfd6df;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  border-radius: 12px;
  transition: background .12s;
}
.pfeil:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.pfeil.links { left: 10px; }
.pfeil.rechts { right: 10px; }
.pfeil[disabled] { opacity: .25; cursor: default; }

/* ── Schmale Bildschirme ──────────────────────────────────────────── */
@media (max-width: 820px) {
  .inhalt { margin-left: 0; }
  body:not(.leiste-zu) .leiste-schleier { display: block; }
  #leiste-auf { display: inline-flex; }
  .gitter { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; padding: 10px; }
  .kachel { contain-intrinsic-size: 150px 200px; }
  .suche { width: 150px; }
  .suche:focus { width: 170px; }
  .lupe-buehne { padding: 0 8px 8px; }
  .pfeil { width: 36px; height: 60px; font-size: 24px; opacity: .8; }
}
