/* WebFileAccess – gemeinsames Stylesheet aller Seiten */
:root {
  --gruen: #006630;
  --gruen-hell: #e8f3ec;
  --text: #1d2420;
  --grau: #5d6862;
  --linie: #d5ddd8;
  --hinter: #f6f8f7;
  --weiss: #ffffff;
  --fehler: #a4161a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--hinter);
}
a { color: var(--gruen); }
a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
.passkey-box { max-width: 640px; }
.passkey-box input[type=text] { max-width: 24rem; }
.kopf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  padding: .6rem 1rem; background: var(--weiss); border-bottom: 3px solid var(--gruen);
}
.marke { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 600; }
.marke img { width: 48px; height: 48px; }
.adminmode {
  display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 700;
  background: var(--gruen); color: var(--weiss); border: 1px solid var(--gruen);
}
.wartung {
  display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 700;
  background: #fff3cd; color: #7a4b00; border: 1px solid #e0b23c; margin-right: auto;
}
.konto { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; font-size: .95rem; }
.wer { color: var(--grau); }
.konto { margin-left: auto; justify-content: flex-end; }
/* Menü im Kopf: Knopf mit Symbol, Aufklappmenü mit <details> (geht ohne JavaScript; passkey.js schließt es bei Klick daneben und mit Esc) */
details.menue { position: relative; }
details.menue > summary {
  list-style: none; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: .2rem;
  padding: .35rem .55rem; border: 1px solid var(--linie); border-radius: 8px; color: var(--text); background: var(--weiss);
}
details.menue > summary::-webkit-details-marker { display: none; }
details.menue > summary::marker { content: ""; }
details.menue > summary::after { content: ""; border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0; margin-left: .25rem; }
details.menue > summary:hover, details.menue[open] > summary { background: var(--hinter); border-color: var(--grau); }
details.menue > summary:focus-visible { outline: 2px solid var(--gruen); outline-offset: 2px; }
.symbol { flex: none; }
.menue-liste {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; width: max-content; min-width: 15rem; max-width: min(22rem, 92vw);
  padding: .35rem 0; background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}
.menue-wer { padding: .5rem 1rem .6rem; line-height: 1.3; }
.menue-wer strong, .menue-wer span { display: block; }
.menue-wer span { font-size: .85rem; color: var(--grau); overflow-wrap: anywhere; }
.menue-teil { display: flex; flex-direction: column; margin: 0; padding: .3rem 0; border-top: 1px solid var(--linie); }
.menue-liste a, .menue-liste button.link {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .45rem 1rem;
  text-align: left; text-decoration: none; color: var(--text); font: inherit;
}
.menue-liste a .symbol, .menue-liste button .symbol { color: var(--grau); }
.menue-liste a:hover, .menue-liste button.link:hover, .menue-liste a:focus-visible, .menue-liste button.link:focus-visible { background: var(--gruen-hell); color: var(--gruen); }
.menue-liste a:hover .symbol, .menue-liste button.link:hover .symbol { color: var(--gruen); }
.menue-liste small { display: block; font-size: .8rem; color: var(--grau); }
.menue-liste a.ansicht { color: #8a4b00; }
.inline { display: inline; margin: 0; }
button, .knopf {
  display: inline-block; font: inherit; padding: .55rem 1.1rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--gruen); background: var(--gruen); color: var(--weiss); text-decoration: none;
}
button:hover, .knopf:hover { filter: brightness(1.1); }
button.zweit, .knopf.zweit { background: var(--weiss); color: var(--gruen); }
button.link { background: none; border: 0; padding: 0; color: var(--gruen); text-decoration: underline; }
button.gefahr { background: var(--fehler); border-color: var(--fehler); }
.inhalt { max-width: 640px; margin: 2rem auto; padding: 0 1rem; }
.inhalt.breit { max-width: 1100px; margin-top: 1rem; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; padding: 1.2rem; margin: 1rem 0; }
label { display: block; font-weight: 600; margin-bottom: .3rem; }
input[type=email], input[type=text], input[type=password], input[type=search] {
  width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid var(--linie); border-radius: 6px; margin-bottom: .8rem;
  background: var(--weiss); color: var(--text);
}
.oder { color: var(--grau); margin: .6rem 0; }
.klein { font-size: .9rem; color: var(--grau); }
.hinweis { background: var(--gruen-hell); border-left: 4px solid var(--gruen); padding: .6rem .8rem; margin-bottom: 1rem; }
.fehler { color: var(--fehler); }
.fuss { text-align: center; font-size: .9rem; color: var(--grau); padding: 2rem 1rem; }
.version { font-size: .8rem; color: var(--grau); }
/* Ordneransicht */
.pfad { display: flex; flex-wrap: wrap; gap: .2rem; margin: 0 0 .8rem; font-size: .95rem; }
.pfad span.trenn { color: var(--grau); }
.pfad a.uebersicht { margin-left: .9rem; padding: 0 .55rem; border: 1px solid var(--gruen); border-radius: 999px; text-decoration: none; font-size: .9rem; }
.pfad a.uebersicht:hover { background: var(--gruen); color: var(--weiss); }
.galerie-zahl { margin: 0 0 .4rem; }
.galerie-ordner { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.galerie-ordner > a { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: var(--linie); text-decoration: none; }
.galerie-ordner img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.galerie-ordner > a:hover img, .galerie-ordner > a:focus img { transform: scale(1.04); }
.galerie-ordner .ohne-bild { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.galerie-ordner .name { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem .6rem .45rem; color: #fff; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.galerie-ordner .name::before { content: "📁 "; }
.galerie-ordner .name small { display: block; font-weight: 400; font-size: .8rem; opacity: .9; }
.galerie { display: flex; flex-wrap: wrap; gap: 4px; }
.galerie > a { flex: 1 1 auto; height: 200px; overflow: hidden; border-radius: 4px; background: var(--linie); }
.galerie > a img { display: block; height: 100%; width: auto; min-width: 100%; object-fit: cover; transition: transform .2s; }
.galerie > a:hover img, .galerie > a:focus img { transform: scale(1.03); }
.galerie::after { content: ''; flex-grow: 10; }
@media (max-width: 600px) { .galerie > a { height: 120px; } }
.inhalt.voll { max-width: none; }
.bildansicht { position: relative; height: calc(100vh - 11rem); height: calc(100svh - 11rem); min-height: 18rem; display: flex; align-items: center; justify-content: center; background: #000; color: #eee; overflow: hidden; border-radius: 8px; }
.bildansicht img.bild { max-width: 100%; max-height: 100%; object-fit: contain; }
.bild-nav { position: absolute; top: 3.5rem; bottom: 4rem; width: 20%; display: flex; align-items: center; color: #fff; text-decoration: none; font-size: 3.5rem; line-height: 1; }
.bild-nav span { padding: .1rem .7rem .35rem; border-radius: 6px; background: rgba(0,0,0,.35); opacity: .7; }
.bild-nav:hover span, .bild-nav:focus span { opacity: 1; background: rgba(0,0,0,.6); }
.bild-nav.zurueck { left: 0; justify-content: flex-start; padding-left: .6rem; }
.bild-nav.weiter { right: 0; justify-content: flex-end; padding-right: .6rem; }
.bild-oben { position: absolute; top: 0; right: 0; display: flex; gap: 1rem; align-items: center; padding: .6rem .9rem; background: rgba(0,0,0,.45); border-bottom-left-radius: 8px; }
.bild-oben a { color: #fff; text-decoration: none; font-size: .95rem; }
.bild-oben a:hover { text-decoration: underline; }
.bild-oben a.bild-zu { font-size: 1.5rem; line-height: 1; }
.bild-info > summary { list-style: none; cursor: pointer; width: 1.6rem; height: 1.6rem; border: 1.5px solid #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: italic 600 1rem Georgia, serif; color: #fff; }
.bild-info > summary::-webkit-details-marker { display: none; }
.bild-info[open] > summary { background: #fff; color: #000; }
.bild-info > .info-feld { position: absolute; top: calc(100% + .4rem); right: .5rem; z-index: 3; width: min(22rem, calc(100vw - 1rem)); max-height: calc(100vh - 12rem); overflow-y: auto; padding: .7rem .9rem; background: rgba(20,20,20,.92); border-radius: 8px; font-size: .9rem; }
.info-feld dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; }
.info-feld .info-aktion { margin: .7rem 0 0; padding-top: .5rem; border-top: 1px solid #444; }
.info-feld .info-aktion a { color: #9cf; }
.bild-text[title] { cursor: text; }
.beschreibung-dialog { width: min(34rem, calc(100vw - 2rem)); border: 0; border-radius: 10px; padding: 1rem 1.2rem; color: var(--text); background: var(--weiss); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.beschreibung-dialog::backdrop { background: rgba(0,0,0,.6); }
.beschreibung-dialog textarea { width: 100%; }
.beschreibung-dialog p:last-child { margin-bottom: 0; }
.bild-bearbeiten { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: flex-start; }
.bild-bearbeiten > img { max-width: 100%; height: 200px; width: auto; border-radius: 6px; }
.bild-bearbeiten form { flex: 1 1 22rem; max-width: 40rem; }
.bild-bearbeiten textarea { width: 100%; }
.bild-info dt { color: #aaa; }
.bild-info dd { margin: 0; word-break: break-word; }
.bild-info dd a { color: #9cf; }
.bild-oben { z-index: 2; }
.bild-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem 4rem .7rem; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.75)); font-size: 1rem; overflow-wrap: anywhere; }
.ordnerinfo { margin: 0 0 .8rem; padding: .6rem 1rem; border-left: 4px solid var(--gruen); }
.ordnerinfo > :first-child { margin-top: 0; }
.ordnerinfo > :last-child { margin-bottom: 0; }
.werkzeug { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.werkzeug input[type=search] { width: auto; flex: 1 1 14rem; margin: 0; }
.liste { width: 100%; border-collapse: collapse; background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.liste th, .liste td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.liste th a { color: var(--text); text-decoration: none; }
.liste th a.aktiv { color: var(--gruen); }
.liste td.zahl, .liste th.zahl { text-align: right; white-space: nowrap; }
.liste td.datum { white-space: nowrap; color: var(--grau); }
.liste tr:last-child td { border-bottom: 0; }
.liste .ordner a { font-weight: 600; }
.liste .ordner a::before { content: "📁 "; }
.liste .neben { font-size: .85rem; margin-left: .5rem; }
.leer { color: var(--grau); padding: 1rem 0; }
/* Verwaltung */
.vnav { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 1rem; }
.vnav a { padding: .35rem .8rem; border: 1px solid var(--linie); border-radius: 6px; text-decoration: none; background: var(--weiss); }
.vnav a.aktiv { background: var(--gruen); border-color: var(--gruen); color: var(--weiss); }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.kachel { display: block; padding: .8rem; background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; text-decoration: none; color: var(--text); }
.kachel strong { font-size: 1.5rem; color: var(--gruen); display: block; }
.formular { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .2rem 1rem; align-items: end; }
.formular label { font-weight: 600; }
.formular label input, .formular label select { margin-top: .2rem; }
.formular .breit, .formular fieldset, .formular h2 { grid-column: 1 / -1; }
.formular button { justify-self: start; }
select { font: inherit; padding: .45rem .5rem; border: 1px solid var(--linie); border-radius: 6px; background: var(--weiss); color: var(--text); width: 100%; margin-bottom: .8rem; }
.werkzeug select { width: auto; margin: 0; }
/* Textfelder und Zeitfeld wie die übrigen Eingaben (vorher Browser-Vorgabe: kleine Festbreitenschrift) */
textarea, input[type=datetime-local] { font: inherit; font-size: 1rem; line-height: 1.4; padding: .5rem .6rem; border: 1px solid var(--linie); border-radius: 6px; width: 100%; margin-bottom: .8rem; background: var(--weiss); color: var(--text); box-sizing: border-box; }
textarea { resize: vertical; }
/* Import (CSV, Kurzform): Festbreitenschrift bleibt, aber gut lesbar */
textarea[name=daten] { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; }
input[type=date] { font: inherit; padding: .45rem .5rem; border: 1px solid var(--linie); border-radius: 6px; width: 100%; margin-bottom: .8rem; background: var(--weiss); color: var(--text); }
fieldset { border: 1px solid var(--linie); border-radius: 6px; margin: .4rem 0 .8rem; }
.haken { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; margin: 0 .9rem .3rem 0; }
.fehlerbox { background: #fbe9ea; border-left-color: var(--fehler); color: var(--fehler); }
.loeschzeile { display: block; margin: -.6rem 0 1.2rem; }
table.klein { font-size: .85rem; }
.markdown { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; padding: 1rem 1.4rem; overflow-x: auto; }
.markdown img { max-width: 100%; }
.markdown table { border-collapse: collapse; }
.markdown th, .markdown td { border: 1px solid var(--linie); padding: .3rem .6rem; }
.markdown pre { background: var(--hinter); padding: .7rem; overflow-x: auto; }
@media (max-width: 640px) {
  .liste th.typ, .liste td.typ, .liste th.datum, .liste td.datum { display: none; }
  .konto { width: 100%; }
}
@media (prefers-color-scheme: dark) {
  :root { --text: #e5ebe7; --grau: #a7b2ab; --linie: #39443e; --hinter: #161b18; --weiss: #1f2622; --gruen: #4fbf7d; --gruen-hell: #1d3326; }
  button, .knopf { color: #0d130f; }
}

/* Rollen und „Ansicht als“ (Konzept 5.3): im Kopf nur ein Link, Auswahl auf /_zugang/rollen */
a.rollen { color: var(--grau); }
a.rollen.ansicht { color: #8a4b00; background: #fff3e0; border: 1px solid #f0c48a; border-radius: 4px; padding: .05rem .45rem; font-weight: bold; text-decoration: none; }
.ansichtliste label { display: flex; align-items: baseline; gap: .45rem; font-weight: 400; margin: 0 0 .35rem; }
.ansichtliste input[type=radio] { width: auto; margin: 0; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  a.rollen.ansicht { color: #ffd8a8; background: #3a2a14; border-color: #7a5520; }
}

/* Verwaltung „Links“ (Konzept 7.16) */
input.kurz { width: auto; min-width: 14rem; margin: 0 0 .3rem; }
button.klein { padding: .25rem .6rem; font-size: .9rem; }
