:root, [data-thema="dunkel"] {
  --bg: #141217; --flaeche: #1d1a22; --flaeche2: #221f27; --linie: #2e2a35; --text: #ece8f1; --muted: #a59fb0;
  --akzent-text: #cdb0f0; --schatten: 0 8px 30px rgba(0,0,0,.45); color-scheme: dark;
}
[data-thema="hell"] {
  --bg: #ffffff; --flaeche: #f6f4f8; --flaeche2: #efecf3; --linie: #e3dfe9; --text: #1d1b22; --muted: #6b6775;
  --akzent-text: var(--akzent); --schatten: 0 8px 30px rgba(20,10,40,.15); color-scheme: light;
}
@media (prefers-color-scheme: light) {
  [data-thema="auto"] { --bg: #ffffff; --flaeche: #f6f4f8; --flaeche2: #efecf3; --linie: #e3dfe9; --text: #1d1b22;
    --muted: #6b6775; --akzent-text: var(--akzent); --schatten: 0 8px 30px rgba(20,10,40,.15); color-scheme: light; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
body { font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--akzent-text); }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.logo-hell, .logo-dunkel { height: 34px; display: block; }
[data-thema="dunkel"] .logo-hell, [data-thema="hell"] .logo-dunkel { display: none; }
@media (prefers-color-scheme: light) { [data-thema="auto"] .logo-dunkel { display: none; } }
@media (prefers-color-scheme: dark) { [data-thema="auto"] .logo-hell { display: none; } }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: 9px; border: 1px solid var(--linie);
  background: var(--flaeche2); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.knopf:hover { border-color: var(--muted); }
.knopf.pri { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf.pri:hover { filter: brightness(1.12); }
.knopf.klein { padding: 5px 10px; font-size: .88rem; }
.knopf:disabled { opacity: .45; cursor: default; }
.knopf.voll { width: 100%; }

/* Kopf */
.gkopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--linie); position: sticky; top: 0; background: var(--bg); z-index: 20; }
.gkopf .firma { font-weight: 800; font-size: 1.1rem; letter-spacing: .2px; color: var(--text); text-decoration: none; }
.gkopf .r { display: flex; gap: 8px; align-items: center; }
.nur-handy { display: none !important; }

/* Rahmen mit Seitenleiste */
.glayout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.gseite { border-right: 1px solid var(--linie); padding: 16px; position: sticky; top: 59px; height: calc(100vh - 59px); overflow-y: auto; background: var(--bg); }
.gseite h3 { font-size: 1rem; margin: 18px 0 8px; }
.gseite h3:first-child { margin-top: 0; }
.feld { width: 100%; background: var(--flaeche2); border: 1px solid var(--linie); border-radius: 8px; padding: 8px 11px; color: var(--text); font: inherit; }
.feld:focus { outline: 2px solid var(--akzent); border-color: transparent; }
select.feld { appearance: auto; }
.farben { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.fb { width: 24px; height: 24px; border-radius: 5px; border: 1px solid rgba(128,128,128,.35); cursor: pointer; padding: 0; position: relative; }
.fb.an { outline: 2px solid var(--text); outline-offset: 2px; }
.fb.keine { background: transparent; border: 1.5px dashed var(--muted); }
.fb.haken { background: var(--flaeche2); font-size: 13px; line-height: 22px; text-align: center; }
.legende { font-size: .8rem; color: var(--muted); margin-top: 8px; line-height: 1.7; }
.legende span { white-space: nowrap; margin-right: 8px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }
.sets .set { display: flex; justify-content: space-between; align-items: center; padding: 7px 9px; border-radius: 7px; cursor: pointer; gap: 6px; }
.sets .set:hover { background: var(--flaeche2); }
.sets .set.an { background: color-mix(in srgb, var(--akzent) 30%, transparent); color: var(--text); font-weight: 700; }
.sets .set small { color: var(--muted); font-weight: 400; }
.stapel { display: grid; gap: 7px; margin-top: 10px; }
.gseite .knopf { white-space: normal; text-align: center; }
.trenn { border: 0; border-top: 1px solid var(--linie); margin: 16px 0; }

.ginhalt { padding: 18px 22px 120px; min-width: 0; }
.krumen { font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.krumen a { color: var(--muted); text-decoration: none; }
.krumen a:hover { color: var(--text); }
.gtitel { font-size: 1.7rem; font-weight: 800; margin: 2px 0 4px; line-height: 1.2; }
.regeln { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0 16px; }
.regel { font-size: .82rem; padding: 4px 11px; border-radius: 20px; background: var(--flaeche2); border: 1px solid var(--linie); color: var(--muted); }
.regel.on { color: var(--akzent-text); border-color: color-mix(in srgb, var(--akzent) 55%, transparent); background: color-mix(in srgb, var(--akzent) 16%, transparent); }
button.regel { font: inherit; font-size: .82rem; cursor: pointer; }
.sprachwahl { display: inline-flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; font-size: .8rem; font-weight: 700; }
.sprachwahl a { padding: 4px 8px; color: var(--muted); text-decoration: none; }
.sprachwahl a + a { border-left: 1px solid var(--linie); }
.sprachwahl a.an { background: var(--akzent); color: #fff; }
.sprachwahl a:hover:not(.an) { color: var(--text); }
.willkommen { margin: 12px 0 4px; padding: 14px 16px; background: var(--flaeche); border: 1px solid var(--linie); border-left: 3px solid var(--akzent); border-radius: 10px; line-height: 1.6; max-width: 900px; }
.willkommen p { margin: 0 0 8px; } .willkommen p:last-child { margin-bottom: 0; }
.willkommen ul, .willkommen ol { margin: 6px 0; padding-left: 22px; }
.upload-hinweis { margin: -4px 0 14px; }
.presse { background: var(--flaeche2); border-left: 3px solid var(--akzent); padding: 8px 12px; border-radius: 6px; margin-bottom: 14px; font-size: .9rem; }
h2.abschnitt { font-size: 1.05rem; margin: 18px 0 10px; display: flex; align-items: center; gap: 10px; }
h2.abschnitt .muted { font-weight: 400; font-size: .9rem; }

.ordner-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 10px; }
.ok { min-width: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; color: var(--text); text-decoration: none; display: block; transition: transform .12s; }
.ok:hover { transform: translateY(-2px); border-color: var(--muted); }
.ok .bild { aspect-ratio: 3/2; background: var(--flaeche2) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--muted); }
.ok .unt { padding: 9px 12px; display: flex; justify-content: space-between; gap: 8px; }
.ok .unt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok .unt span { color: var(--muted); font-size: .88rem; white-space: nowrap; }

/* Fotoraster */
.gruppe-titel { font-size: .95rem; font-weight: 700; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.raster.gross { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.raster.klein { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 9px; padding: 6px; position: relative; min-width: 0; }
.kachel.gewaehlt { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent); }
.kachel .leiste { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 6px; }
.ib { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--linie); background: var(--flaeche2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; padding: 0; }
.ib:hover { border-color: var(--muted); }
.ib.an { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.ib svg { width: 16px; height: 16px; }
.kachel .bildrahmen { aspect-ratio: 3/2; background: var(--flaeche2); border-radius: 5px; overflow: hidden; cursor: zoom-in; display: flex; align-items: center; justify-content: center; }
.kachel img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kachel .fn { font-size: .78rem; color: var(--muted); margin-top: 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leer { text-align: center; color: var(--muted); padding: 40px 10px; }

/* Farbauswahl */
.farbwahl { position: absolute; z-index: 30; background: var(--flaeche2); border: 1px solid var(--linie); border-radius: 10px; padding: 8px; display: flex; gap: 7px; box-shadow: var(--schatten); }
.farbwahl .fb { width: 28px; height: 28px; }

/* Auswahlleiste unten */
.auswahlleiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--akzent); color: #fff; display: flex; align-items: center; gap: 10px; padding: 11px 22px; flex-wrap: wrap; box-shadow: 0 -6px 20px rgba(0,0,0,.25); }
.auswahlleiste .r { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.auswahlleiste .knopf { background: #fff; color: #1d1b22; border-color: #fff; }
.auswahlleiste .knopf.sek { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.auswahlleiste a { color: #fff; }

/* Vollbild */
.lb { position: fixed; inset: 0; background: #08060a; z-index: 50; display: none; flex-direction: column; color: #eee; touch-action: none; }
.lb.an { display: flex; }
.lb .lkopf { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; gap: 10px; }
.lb .lkopf .name { font-size: .88rem; color: #bbb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .buehne { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.lb .buehne img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: transform .2s; }
.lb .pfeil { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; background: rgba(255,255,255,.08); color: #fff; font-size: 26px; cursor: pointer; border-radius: 8px; }
.lb .pfeil:hover { background: rgba(255,255,255,.18); }
.lb .pfeil.l { left: 10px; } .lb .pfeil.r { right: 10px; }
.lb .lfuss { display: flex; justify-content: center; gap: 12px; padding: 12px; flex-wrap: wrap; }
.lb .lfuss .ib { width: auto; height: 42px; padding: 0 16px; gap: 7px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #fff; font-size: .95rem; }
.lb .lfuss .ib.an { background: var(--akzent); border-color: var(--akzent); }
.lb .x { background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; padding: 0 6px; }

/* Dialoge */
dialog { border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); border-radius: 14px; padding: 22px; width: 420px; max-width: 94vw; box-shadow: var(--schatten); }
dialog::backdrop { background: rgba(10,8,14,.7); }
dialog h3 { margin: 0 0 6px; font-size: 1.2rem; }
dialog label { display: block; font-size: .88rem; color: var(--muted); margin: 10px 0 4px; }
dialog textarea.feld { min-height: 80px; resize: vertical; }
dialog .knoepfe { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.balken { height: 8px; background: var(--flaeche2); border-radius: 4px; overflow: hidden; margin: 14px 0 6px; }
.balken i { display: block; height: 100%; width: 0; background: var(--akzent); transition: width .3s; }
.fehlertext { color: #ff8a80; font-size: .9rem; margin-top: 8px; }
[data-thema="hell"] .fehlertext { color: #b3261e; }

.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: #2a2233; color: #fff; padding: 9px 16px; border-radius: 9px; z-index: 90; font-size: .92rem; display: none; box-shadow: var(--schatten); }
.gfuss { text-align: center; font-size: .8rem; color: var(--muted); padding: 30px 10px 90px; }
.gfuss a { color: var(--muted); }

/* Passwortseite */
.pw { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 100vh; }
/* Titelbild ohne Beschnitt: ganzes Foto vorn, dahinter dieselbe Aufnahme unscharf und abgedunkelt */
.pw .titelbild { background: var(--flaeche2); position: relative; min-height: 260px; overflow: hidden; }
.pw .titelbild .unscharf { position: absolute; inset: -40px; background: center/cover no-repeat; filter: blur(28px) brightness(.55) saturate(1.1); transform: scale(1.08); }
.pw .titelbild .ganz { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pw .titelbild::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.65), transparent 35%); pointer-events: none; }
.pw .titelbild .t { position: absolute; left: 32px; bottom: 30px; color: #fff; z-index: 1; }
.pw .titelbild .t b { display: block; font-size: 1.8rem; line-height: 1.2; }
.pw .form { display: flex; flex-direction: column; justify-content: center; padding: 40px; max-width: 460px; width: 100%; margin: 0 auto; }
.pw .form h1 { font-size: 1.35rem; margin: 26px 0 6px; }
.pw-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pw .pwfeld { position: relative; }
.pw .pwfeld button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--muted); }
.pw .fuss { margin-top: 30px; font-size: .8rem; color: var(--muted); }
.pw .fuss a { color: var(--muted); }
.hinweisseite { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.hinweisseite .box { max-width: 440px; }
.hinweisseite .sym { font-size: 46px; margin: 18px 0 6px; }

@media (max-width: 860px) {
  .glayout { grid-template-columns: minmax(0, 1fr); }
  .gseite { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; max-height: 82vh; z-index: 40; border-right: 0; border-top: 1px solid var(--linie);
    border-radius: 16px 16px 0 0; transform: translateY(105%); transition: transform .22s; box-shadow: var(--schatten); background: var(--flaeche); padding-bottom: 30px; }
  .gseite.offen { transform: none; }
  .nur-handy { display: inline-flex !important; }
  .handy-laden.nur-handy { display: flex !important; flex-direction: column; gap: 8px; margin: -4px 0 16px; }
  .nur-pc { display: none !important; }
  .ginhalt { padding: 12px 10px 120px; }
  .gtitel { font-size: 1.35rem; }
  .raster, .raster.gross { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .kachel .ib { width: 34px; height: 34px; }
  .raster.klein { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .raster.klein .kachel .leiste, .raster.klein .fn { display: none; }
  .kachel { padding: 4px; }
  .ordner-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .auswahlleiste { padding: 9px 12px; }
  .pw { grid-template-columns: 1fr; }
  .pw .titelbild { min-height: 38vh; }
  .pw .form { padding: 24px; }
  .lb .pfeil { display: none; }
  .gkopf { padding: 10px 12px; }
  .gkopf > a { min-width: 0; overflow: hidden; }
  .gkopf .firma { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gkopf .r { gap: 6px; flex: none; }
  .sprachwahl a { padding: 4px 6px; }
}
.handy-dimmer { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; display: none; }
.handy-dimmer.an { display: block; }

/* Dateien ohne Vorschau (PDF, Word, Excel, PowerPoint, Video, ZIP): neutrale Kachel, keine Markenlogos */
.dateikachel { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #fff; background: #6b6775; border-radius: 5px; user-select: none; }
.dateikachel b { font-size: 1.6rem; font-weight: 800; letter-spacing: 1px; }
.dateikachel span { font-size: .78rem; opacity: .85; }
.dateikachel.pdf { background: #c0392b; } .dateikachel.doc { background: #2f5fb3; } .dateikachel.xls { background: #23824a; }
.dateikachel.ppt { background: #c4622d; } .dateikachel.video { background: #6d3fa0; } .dateikachel.zip { background: #5b6470; }
.dateikachel.eps, .dateikachel.ai, .dateikachel.svg { background: #b0721a; } .dateikachel.psd { background: #1f6f8b; } .dateikachel.raw { background: #3d3a44; }
.raster.klein .dateikachel b { font-size: 1rem; }
.lb-datei { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 20px; max-width: 560px; }
.lb-datei .dateikachel.gross { width: min(80vw, 460px); height: auto; aspect-ratio: 3/2; }
.lb-datei .dateikachel.gross b { font-size: 3.6rem; } .lb-datei .dateikachel.gross span { font-size: 1rem; }
.lb-datei p { color: #ccc; margin: 0; }

/* Persönlicher Zugangscode */
.code-feld { font-size: 1.6rem; letter-spacing: .35em; text-transform: uppercase; text-align: center; font-weight: 700; }
.hallo { font-size: .9rem; opacity: .8; margin-top: 2px; }
.freigabe-box { border: 1px solid var(--linie, #444); border-radius: 10px; padding: 10px 12px; font-size: .88rem; }
.freigabe-oben { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: -6px 0 14px; }

.entwurf-banner { background: #f5b301; color: #1d1b22; text-align: center; padding: 8px 12px; font-weight: 700; font-size: .9rem; position: relative; z-index: 50; }
