/*
 * Design-System "Claudia & Chrisi" — ersetzt Bootstrap komplett.
 * Ein Stylesheet für die ganze App, kein Build-Schritt nötig.
 *
 * Optik: "Liquid Glass" in Anlehnung an iOS 26 — durchscheinende Materialien,
 * schwebende Bedienleisten, Specular-Kante (heller Lichtsaum oben), weiche
 * Tiefenschatten, große konzentrische Radien.
 *
 * Bewusste Performance-Entscheidung: echtes backdrop-filter kostet auf
 * Mobilgeräten Rechenzeit, deshalb bekommt es NUR die schwebende Bedien-Ebene
 * (App-Bar, Bottom-Nav, Betrachter-Leisten, Sheet, Toast) — also wenige,
 * flächenmäßig kleine Elemente. Inhaltskarten (Upload-Zeilen, Statistik,
 * Listen) nutzen dieselbe Formensprache mit halbtransparentem Hintergrund,
 * aber ohne Blur; bei 20 Upload-Zeilen gleichzeitig macht das den Unterschied
 * zwischen flüssig und ruckelig. Genau dieselbe Logik wie bei Apple: Material
 * liegt auf der Steuerungs-Ebene, nicht auf jeder Inhaltskachel.
 */

/* ---------- Schriften ----------
 * Selbst gehostet statt über die Google-Fonts-CDN geladen: schneller auf
 * mobilen Verbindungen (keine zusätzliche DNS-/TLS-Verbindung) und
 * datenschutzrechtlich unkritisch, weil keine Gast-IP an Google geht.
 * Fraunces und Inter sind Variable Fonts -- eine Datei deckt alle Schnitte
 * ab, deshalb nur drei Dateien für drei Schriftfamilien (zusammen ~134 KB).
 * Latin-Subset, das genügt für Deutsch inkl. Umlauten.
 * Neu erzeugen/aktualisieren: siehe docs/DEPLOY.md
 */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-latin-var.woff2') format('woff2-variations'),
       url('../fonts/fraunces-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'InterVar';
  src: url('../fonts/inter-latin-var.woff2') format('woff2-variations'),
       url('../fonts/inter-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mrs Saint Delafield';
  src: url('../fonts/mrs-saint-delafield-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Farbwelt "Leinen & Terrakotta" */
  --paper: #FAF6F1; --surface: #FFFFFF; --surface-2: #F4EDE5;
  --ink: #241E1A; --ink-soft: #6E625A; --line: #E7DED3;
  --clay: #B96A4F; --clay-deep: #94523B; --clay-soft: #F3E2DA;
  --sage: #7B8A70; --danger: #B4443C;

  /* Glas-Material: Füllung, Lichtsaum, Kante */
  --glass: rgba(255, 255, 255, .55);
  --glass-strong: rgba(255, 255, 255, .74);
  --glass-edge: rgba(255, 255, 255, .75);
  --glass-hi: rgba(255, 255, 255, .92);
  --glass-lo: rgba(36, 30, 26, .06);
  --blur: 24px;
  --sat: 180%;

  /* Karten (ohne Blur, siehe Kopfkommentar) */
  --card: rgba(255, 255, 255, .72);
  --card-edge: rgba(255, 255, 255, .8);

  --shadow-1: 0 1px 2px rgba(36,30,26,.05), 0 6px 20px rgba(36,30,26,.07);
  --shadow-2: 0 12px 44px rgba(36,30,26,.18), 0 2px 10px rgba(36,30,26,.10);
  --shadow-float: 0 10px 34px rgba(36,30,26,.14), 0 2px 8px rgba(36,30,26,.08);

  /* Konzentrische Radien: außen groß, innen kleiner */
  --r-s: 14px; --r-m: 20px; --r-l: 28px; --r-pill: 999px;

  --ui: 'InterVar', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --script: 'Mrs Saint Delafield', 'Segoe Script', cursive;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  /* Gesamter Platz, den die schwebende Bottom-Nav unten freihalten muss */
  --bottomnav-h: 92px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141110; --surface: #1E1A17; --surface-2: #262019;
    --ink: #F3EBE3; --ink-soft: #A79A8F; --line: #332B24;
    --clay: #D8896C; --clay-deep: #B96A4F; --clay-soft: #3A2A23;
    --glass: rgba(40, 34, 29, .58);
    --glass-strong: rgba(40, 34, 29, .78);
    --glass-edge: rgba(255, 255, 255, .12);
    --glass-hi: rgba(255, 255, 255, .22);
    --glass-lo: rgba(0, 0, 0, .30);
    --card: rgba(38, 32, 25, .72);
    --card-edge: rgba(255, 255, 255, .08);
    --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.32);
    --shadow-2: 0 12px 44px rgba(0,0,0,.6), 0 2px 10px rgba(0,0,0,.4);
    --shadow-float: 0 10px 34px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --paper: #141110; --surface: #1E1A17; --surface-2: #262019;
  --ink: #F3EBE3; --ink-soft: #A79A8F; --line: #332B24;
  --clay: #D8896C; --clay-deep: #B96A4F; --clay-soft: #3A2A23;
  --glass: rgba(40, 34, 29, .58);
  --glass-strong: rgba(40, 34, 29, .78);
  --glass-edge: rgba(255, 255, 255, .12);
  --glass-hi: rgba(255, 255, 255, .22);
  --glass-lo: rgba(0, 0, 0, .30);
  --card: rgba(38, 32, 25, .72);
  --card-edge: rgba(255, 255, 255, .08);
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.32);
  --shadow-2: 0 12px 44px rgba(0,0,0,.6), 0 2px 10px rgba(0,0,0,.4);
  --shadow-float: 0 10px 34px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.35);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  color: var(--ink);
  font-family: var(--ui); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  /* Sehr dezenter Farbverlauf im Hintergrund. Er gibt dem Glas überhaupt erst
     etwas zum Brechen -- auf einer komplett flachen Fläche sieht Glas aus wie
     ein grauer Kasten.
     Die erste Zeile ist der Fallback: color-mix() gibt es erst ab iOS 16.2 /
     Chrome 111. Ohne sie hätte body auf älteren Geräten GAR keinen
     Hintergrund, weil eine ungültige Funktion die ganze Kurzschreibweise
     verwirft. Dasselbe Muster wiederholt sich unten überall, wo color-mix()
     einen Hintergrund oder eine Füllfarbe liefert. */
  background: var(--paper);
  background:
    radial-gradient(115% 85% at 12% -8%, color-mix(in srgb, var(--clay) 14%, transparent), transparent 60%),
    radial-gradient(95% 70% at 92% 4%, color-mix(in srgb, var(--sage) 12%, transparent), transparent 55%),
    var(--paper);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
a { color: var(--clay); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -.015em; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/*
 * Zwei Rückfallebenen für das Glas:
 * 1. Browser ohne backdrop-filter (ältere Android-WebViews) bekommen ein
 *    deckendes Material -- sonst wäre Text auf durchscheinendem Grund unlesbar.
 * 2. Wer im System "Transparenz reduzieren" aktiviert hat (Barrierefreiheit),
 *    bekommt es ebenfalls deckend. Das ist kein Sonderfall, sondern eine
 *    verbreitete Einstellung bei Sehschwäche.
 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass: var(--surface); --glass-strong: var(--surface);
    --card: var(--surface); --glass-edge: var(--line); --card-edge: var(--line);
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass: var(--surface); --glass-strong: var(--surface);
    --card: var(--surface); --glass-edge: var(--line); --card-edge: var(--line);
  }
  body { background: var(--paper); }
}

/* ---------- App-Grundgerüst ---------- */
.appshell { display: flex; flex-direction: column; min-height: 100dvh; }
.appbody {
  flex: 1; width: 100%; max-width: 640px; margin: 0 auto;
  padding: 14px 16px calc(var(--bottomnav-h) + var(--safe-b) + 20px);
  padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r));
}
.appbody.no-bottomnav { padding-bottom: 32px; }

/* App-Bar: Glas-Material, hauchfeiner Lichtsaum an der Unterkante statt
   einer harten 1px-Linie. */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) 12px calc(16px + var(--safe-l));
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  box-shadow: inset 0 -1px 0 var(--glass-lo), 0 1px 0 var(--glass-hi);
  max-width: 640px; margin: 0 auto; width: 100%;
}
.appbar .title { font-family: var(--display); font-size: 20px; font-weight: 600; flex: 1; }
.appbar .sub { font-size: 11.5px; color: var(--ink-soft); font-weight: 500; letter-spacing: .02em; display: block; }

/* Bottom-Nav: schwebende Glas-Kapsel, vom Bildschirmrand abgesetzt --
   das ist die auffälligste Änderung gegenüber der alten, flächigen Leiste. */
.bottomnav {
  position: fixed; z-index: 45;
  left: calc(14px + var(--safe-l)); right: calc(14px + var(--safe-r));
  bottom: calc(12px + var(--safe-b));
  max-width: 420px; margin: 0 auto;
  display: flex; gap: 4px; padding: 6px;
  border-radius: var(--r-pill);
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-float), inset 0 1px 0 var(--glass-hi);
}
.navitem {
  flex: 1; border: 0; background: none; cursor: pointer; text-decoration: none;
  font-size: 10.5px; font-weight: 600; color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 5px; border-radius: var(--r-pill); min-height: 52px; justify-content: center;
  transition: color .2s ease, background-color .2s ease;
}
.navitem svg { width: 22px; height: 22px; }
.navitem .pill {
  padding: 3px 16px; border-radius: var(--r-pill); display: grid; place-items: center;
  transition: background-color .22s ease, box-shadow .22s ease;
}
.navitem[aria-current="page"] { color: var(--clay); }
.navitem[aria-current="page"] .pill {
  background: var(--clay-soft);
  background: color-mix(in srgb, var(--clay) 16%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.navitem:active { transform: scale(.96); }

/* Runde Glas-Schaltfläche (Abmelden, Suche ...) */
.iconbtn {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%;
  border: 1px solid var(--glass-edge); color: var(--ink);
  background: var(--glass-strong);
  backdrop-filter: blur(12px) saturate(var(--sat));
  -webkit-backdrop-filter: blur(12px) saturate(var(--sat));
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-hi);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .08s ease;
}
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 19px; height: 19px; }
.monogram {
  width: 38px; height: 38px; border-radius: 50%; color: #fff;
  background: var(--clay);
  background: linear-gradient(160deg, color-mix(in srgb, var(--clay) 85%, #fff), var(--clay-deep));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), var(--shadow-1);
  display: grid; place-items: center; font-family: var(--display); font-size: 13px; font-weight: 600;
  flex: 0 0 auto;
}

/* ---------- Buttons & Felder ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; font-size: 16px; font-weight: 600; padding: 15px; min-height: 54px;
  border-radius: var(--r-pill); border: 0; color: #fff; cursor: pointer;
  background: var(--clay);
  background: linear-gradient(170deg, color-mix(in srgb, var(--clay) 88%, #fff), var(--clay) 55%, var(--clay-deep));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 18px rgba(36,30,26,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 18px color-mix(in srgb, var(--clay) 32%, transparent);
  transition: filter .18s ease, transform .08s ease, box-shadow .18s ease;
}
/* Der Lichtreflex, der Glas erst wie Glas aussehen lässt: schmales, sehr
   helles Band über der oberen Hälfte. */
.btn::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 52%;
  background: linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,0));
  pointer-events: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.975); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 2px 8px color-mix(in srgb, var(--clay) 26%, transparent); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn.ghost {
  color: var(--clay); background: var(--glass-strong);
  border: 1px solid var(--clay);
  border-color: color-mix(in srgb, var(--clay) 42%, transparent);
  backdrop-filter: blur(12px) saturate(var(--sat));
  -webkit-backdrop-filter: blur(12px) saturate(var(--sat));
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-hi);
}
.btn.ghost::after { background: linear-gradient(180deg, var(--glass-hi), rgba(255,255,255,0)); opacity: .5; }
.btn.ghost:hover { background: var(--clay-soft); background: color-mix(in srgb, var(--clay) 12%, var(--glass-strong)); }
.btn.danger {
  background: var(--danger);
  background: linear-gradient(170deg, color-mix(in srgb, var(--danger) 88%, #fff), var(--danger));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 18px rgba(180,68,60,.3);
}
.btn.auto { width: auto; }
.btn.sm { font-size: 13px; padding: 9px 18px; min-height: 42px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.field { position: relative; margin-bottom: 14px; }
.field input, .field textarea {
  width: 100%; font-size: 16px; padding: 16px 46px 16px 18px;
  border-radius: var(--r-m); color: var(--ink);
  background: var(--card);
  border: 1px solid var(--card-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 var(--glass-lo);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input::placeholder { color: var(--ink-soft); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--clay) 55%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 4px color-mix(in srgb, var(--clay) 18%, transparent);
}
button:focus-visible, .navitem:focus-visible, a:focus-visible {
  outline: 2px solid var(--clay); outline-offset: 2px;
}
.field .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer; color: var(--ink-soft); padding: 12px;
}
.error-message { color: var(--danger); font-weight: 600; margin: 0 0 14px; font-size: 14.5px; }
.success-message { color: var(--sage); font-weight: 600; margin: 0 0 14px; font-size: 14.5px; }

/* ---------- Login ----------
 * Anspruch: passt auf ein iPhone ohne Scrollen. Deshalb ist die Höhe hier
 * überall an die Viewport-Höhe gekoppelt (dvh) statt an feste Pixel, und das
 * Foto ist das flexible Element: es gibt als Erstes Höhe ab, wenn es eng wird.
 * dvh statt vh, weil vh auf iOS Safari die ein-/ausfahrende Adressleiste
 * ignoriert und dadurch genau die untersten ~90px verschluckt -- der Button
 * lag prompt unter der Kante.
 */
/* Aufbau: randloses Hero-Foto über die volle Breite, darüber geschoben die
   Glasplatte mit Text und Formular. Kein seitlicher Rand am Foto -- das war
   vorher der Grund, warum es "klein" wirkte. */
.login-wrap {
  min-height: 100dvh; display: flex; flex-direction: column;
  max-width: 520px; margin: 0 auto;
}
.login-hero {
  flex: 0 0 auto; width: 100%;
  /* Höhe an den Viewport gekoppelt, damit die Seite nie scrollt. Das Foto ist
     das flexible Element und gibt als Erstes Höhe ab. */
  height: clamp(200px, 46dvh, 420px);
  overflow: hidden; position: relative;
  background: linear-gradient(150deg, #c9a58c, #8d6e63 55%, #5d4a41);
}
.login-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
/* Weicher Übergang vom Foto in die Glasplatte */
.login-hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 40%;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--paper) 55%, transparent));
  pointer-events: none;
}

/* Das Login-Formular sitzt auf einer Glasplatte, die das Foto überlappt --
   der Screen, auf dem das Material am deutlichsten zu sehen ist. */
.login-card {
  flex: 1; margin-top: -30px; position: relative; z-index: 1;
  border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 24px calc(20px + var(--safe-r)) calc(20px + var(--safe-b)) calc(20px + var(--safe-l));
  display: flex; flex-direction: column; justify-content: center;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  border-top: 1px solid var(--glass-edge);
  box-shadow: 0 -10px 34px rgba(36,30,26,.14), inset 0 1px 0 var(--glass-hi);
}
.login-wrap h1 { font-size: clamp(21px, 5.6vw, 27px); margin: 10px 0 0; line-height: 1.16; text-align: center; }
.login-wrap p.intro { font-size: 13.5px; color: var(--ink-soft); margin: 12px 0 20px; text-align: center; }

/* Namenszug: klar abgesetzt vom Button, mit Luft nach oben. */
.signature { text-align: center; margin-top: 30px; }
.signature .names { font-family: var(--script); font-size: clamp(34px, 10vw, 46px); line-height: 1; color: var(--clay); }
.signature .date { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin-top: 8px; }

/* Niedrige Viewports (kleine iPhones, sichtbare Browser-Leisten): Foto
   zurücknehmen und Abstände straffen, damit der Button über der Kante bleibt. */
@media (max-height: 700px) {
  .login-hero { height: clamp(160px, 34dvh, 260px); }
  .login-card { padding-top: 18px; }
  .login-wrap h1 { font-size: 20px; margin-top: 6px; }
  .login-wrap p.intro { font-size: 13px; margin: 9px 0 15px; }
  .signature { margin-top: 20px; }
  .signature .names { font-size: 32px; }
  .field { margin-bottom: 10px; }
  .btn { min-height: 50px; padding: 13px; }
}
/* Landscape auf dem Handy: Foto neben das Formular, sonst bleibt keine Höhe. */
@media (max-height: 520px) and (min-width: 560px) {
  .login-wrap { flex-direction: row; max-width: none; align-items: stretch; }
  .login-hero { flex: 0 0 42%; height: auto; }
  .login-hero::after { display: none; }
  .login-card {
    margin-top: 0; margin-left: -30px; flex: 1;
    border-radius: var(--r-l) 0 0 var(--r-l);
    border-top: 0; border-left: 1px solid var(--glass-edge);
    padding-top: calc(16px + var(--safe-t));
  }
  .signature { margin-top: 18px; }
  .signature .names { font-size: 30px; }
}

/* ---------- Upload ---------- */
.dropzone {
  /* display:block ist zwingend -- die Dropzone ist ein <label>, und Labels sind
     von Natur aus inline. Ohne das zerbricht der Rahmen in mehrere Fragmente
     und das Icon rutscht aus der Box. */
  display: block; position: relative; overflow: hidden;
  border-radius: var(--r-l); padding: 30px 18px; text-align: center;
  margin-bottom: 12px; cursor: pointer;
  background: var(--clay-soft);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--clay) 12%, transparent), transparent 70%),
    var(--card);
  border: 1px solid var(--clay);
  border-color: color-mix(in srgb, var(--clay) 34%, transparent);
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-hi);
  transition: border-color .2s ease, background-color .2s ease, transform .1s ease;
}
.dropzone:active { transform: scale(.995); }
.dropzone.dragover {
  border-color: var(--clay);
  background: var(--clay-soft);
  background: color-mix(in srgb, var(--clay) 18%, var(--card));
}
.dropzone svg { width: 30px; height: 30px; color: var(--clay); margin: 0 auto; }
.dropzone .icon-orb {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center;
  background: var(--clay-soft);
  background: linear-gradient(165deg, color-mix(in srgb, var(--clay) 22%, transparent), color-mix(in srgb, var(--clay) 8%, transparent));
  border: 1px solid var(--clay);
  border-color: color-mix(in srgb, var(--clay) 26%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.dropzone .big { font-family: var(--display); font-size: 18px; font-weight: 600; }
.dropzone .hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; }
.dropzone input[type="file"] { display: none; }

.queue { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.qhead { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; }
.qhead .h { font-family: var(--display); font-size: 15px; font-weight: 600; }
.qhead .c { color: var(--ink-soft); }
.qitem {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--r-m); padding: 10px 12px;
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-hi);
}
.qthumb { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; object-fit: cover; background: var(--surface-2); }
.qmeta { flex: 1; min-width: 0; }
.qname { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qstat { font-size: 11px; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; margin-top: 2px; }
/* Fortschrittsbalken einer Upload-Zeile. Absichtlich .qtrack und nicht .track:
   der Bildbetrachter hatte früher ebenfalls eine .track-Klasse, wodurch dessen
   Slide-Leiste das overflow:hidden von hier geerbt hat -- Folge: alle Fotos
   außer dem ersten wurden abgeschnitten und blieben schwarz. */
.qtrack {
  height: 5px; border-radius: var(--r-pill); margin-top: 7px; overflow: hidden;
  background: var(--surface-2);
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}
.trackfill {
  height: 100%; width: 0; border-radius: var(--r-pill);
  background: var(--clay);
  background: linear-gradient(90deg, color-mix(in srgb, var(--clay) 70%, #fff), var(--clay));
  transition: width .3s ease;
}
.qitem.done .trackfill {
  background: var(--sage);
  background: linear-gradient(90deg, color-mix(in srgb, var(--sage) 70%, #fff), var(--sage));
}
.qitem.err .trackfill { background: var(--danger); }
.qitem.err .qstat { color: var(--danger); }
.qslot { flex: 0 0 auto; }
.chk {
  width: 24px; height: 24px; border-radius: 50%; color: #fff;
  background: var(--sage);
  background: linear-gradient(160deg, color-mix(in srgb, var(--sage) 82%, #fff), var(--sage));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
  display: grid; place-items: center;
}
.chk svg { width: 13px; height: 13px; }
.spinner {
  width: 14px; height: 14px; border: 2px solid var(--line);
  border-color: color-mix(in srgb, var(--ink) 14%, transparent);
  border-top-color: var(--clay);
  border-radius: 50%; animation: wg-spin .8s linear infinite; flex: 0 0 auto; display: inline-block;
}
@keyframes wg-spin { to { transform: rotate(360deg); } }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--r-m); padding: 13px 14px; font-size: 12px; color: var(--ink-soft);
  margin-top: 14px; line-height: 1.5;
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.banner b { color: var(--ink); font-weight: 600; }
.banner svg { flex: 0 0 auto; margin-top: 1px; width: 16px; height: 16px; }

.section-title {
  font-family: var(--display); font-size: 17px; font-weight: 600; margin: 28px 0 12px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.section-title a { font-family: var(--ui); font-size: 12.5px; color: var(--clay); text-decoration: none; font-weight: 600; }

.rail {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.rail .shot {
  flex: 0 0 132px; aspect-ratio: 3/4; border-radius: var(--r-m); scroll-snap-align: start;
  box-shadow: var(--shadow-1); position: relative; overflow: hidden; cursor: pointer;
  background: var(--surface-2); border: 0; padding: 0;
  transition: transform .18s ease;
}
.rail .shot:active { transform: scale(.97); }
.rail .shot img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Galerie-Raster ---------- */
.gridhead { display: flex; gap: 8px; align-items: center; margin: 2px 0 14px; }
.seg {
  display: flex; flex: 1; gap: 2px; padding: 4px; border-radius: var(--r-pill);
  background: var(--card); border: 1px solid var(--card-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.seg button {
  flex: 1; font-size: 12px; font-weight: 600; border: 0; background: none; color: var(--ink-soft);
  padding: 8px 4px; border-radius: var(--r-pill); cursor: pointer; min-height: 36px;
}
.seg button.on {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
}
.grid { columns: 2; column-gap: 8px; }
@media (min-width: 480px) { .grid { columns: 3; } }
.grid .cell {
  break-inside: avoid; margin-bottom: 8px; border-radius: var(--r-s); overflow: hidden;
  position: relative; background: var(--surface-2); cursor: pointer; border: 0; padding: 0;
  width: 100%; display: block; box-shadow: var(--shadow-1);
  transition: transform .18s ease;
}
.grid .cell:active { transform: scale(.98); }
.grid .cell.skel { animation: wg-pulse 1.3s ease-in-out infinite; }
@keyframes wg-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.grid .cell img {
  width: 100%; display: block; background-size: cover; background-position: center;
  opacity: 0; transition: opacity .4s ease;
}
.grid .cell img.loaded { opacity: 1; }
.loadmore {
  text-align: center; padding: 16px 0 4px; font-size: 12.5px; color: var(--ink-soft);
  display: flex; gap: 8px; align-items: center; justify-content: center;
}

/* ---------- Bildbetrachter ----------
 * Hier zahlt sich das Material am meisten aus: die Leisten schweben über dem
 * Foto und lassen es durchscheinen, statt es hinter schwarzen Balken zu
 * verstecken. */
.viewer {
  position: fixed; inset: 0; background: #0C0A09; z-index: 70; display: none;
  flex-direction: column; touch-action: none;
}
.viewer.open { display: flex; }
.viewer .vtop {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  padding: calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) 14px calc(14px + var(--safe-l));
  display: flex; align-items: center; gap: 10px; color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,.42), rgba(0,0,0,0));
}
.viewer .count { flex: 1; font-size: 12.5px; opacity: .9; text-align: center; font-weight: 500; }
.viewer .vclose, .viewer .vshare {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
  color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: transform .08s ease, background-color .18s ease;
}
.viewer .vclose:active, .viewer .vshare:active { transform: scale(.93); }
.viewer .vclose svg, .viewer .vshare svg { width: 17px; height: 17px; }
.viewer .stage { flex: 1; position: relative; overflow: hidden; touch-action: none; }
/* Die Slide-Leiste ist absichtlich breiter als die Bühne (ein Slide pro Foto)
   und darf NICHT selbst overflow:hidden haben -- beschnitten wird ausschließlich
   von .viewer .stage darüber. */
.viewer .vtrack {
  height: 100%; display: flex; will-change: transform; overflow: visible;
}
.viewer .slide {
  flex: 0 0 100%; display: flex; align-items: center; justify-content: center; overflow: hidden;
  touch-action: none;
}
.viewer .slide img {
  max-width: 100%; max-height: 100%; object-fit: contain; touch-action: none; user-select: none;
  -webkit-user-drag: none;
}
/* Aktionsleiste als schwebende Glas-Kapsel, wie die Bottom-Nav */
.viewer .vbot {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 16px calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  display: flex; gap: 8px; color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,.46), rgba(0,0,0,0));
}
.viewer .vbot button, .viewer .vbot a {
  flex: 1; font-size: 13.5px; font-weight: 600; padding: 13px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.16);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
  color: #fff; cursor: pointer; display: flex; gap: 7px;
  align-items: center; justify-content: center; min-height: 48px; text-decoration: none;
  transition: transform .08s ease, background-color .18s ease;
}
.viewer .vbot button:active, .viewer .vbot a:active { transform: scale(.97); }
.viewer .vbot button.del {
  background: rgba(180,68,60,.72);
  background: color-mix(in srgb, var(--danger) 62%, transparent);
  border-color: color-mix(in srgb, var(--danger) 70%, transparent);
}
.viewer .vbot svg { width: 16px; height: 16px; }

/* ---------- Admin ---------- */
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.stat {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--r-m);
  padding: 16px; box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-hi);
}
.stat .n { font-family: var(--display); font-size: 25px; line-height: 1.1; font-weight: 600; }
.stat .l { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.ring {
  display: flex; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--r-m); padding: 18px; margin-top: 10px;
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-hi);
}
.ring .dial {
  width: 86px; height: 86px; flex: 0 0 auto; border-radius: 50%;
  background: conic-gradient(var(--clay) 0 var(--p, 0%), var(--surface-2) var(--p, 0%) 100%);
  background: conic-gradient(var(--clay) 0 var(--p, 0%), color-mix(in srgb, var(--ink) 8%, transparent) var(--p, 0%) 100%);
  display: grid; place-items: center; position: relative;
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.ring .dial::after {
  content: ""; position: absolute; inset: 11px; border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 1px 3px var(--glass-lo);
}
.ring .dial b { position: relative; font-family: var(--display); font-size: 17px; }
.ring .txt { font-size: 12px; color: var(--ink-soft); line-height: 1.55; }
.ring .txt strong { color: var(--ink); display: block; font-size: 14px; font-family: var(--display); font-weight: 600; margin-bottom: 3px; }
.list {
  margin-top: 14px; background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--r-m); overflow: hidden;
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-hi);
}
.list .row {
  display: flex; align-items: center; gap: 11px; padding: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); font-size: 13px;
}
.list .row:last-child { border-bottom: 0; }
.list .row .g { flex: 1; }
.list .row .g small { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 1px; }
.toggle {
  width: 46px; height: 28px; border-radius: var(--r-pill); background: var(--sage);
  position: relative; flex: 0 0 auto; cursor: pointer; border: 0;
  box-shadow: inset 0 1px 3px var(--glass-lo);
  transition: background-color .2s ease;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 21px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: left .2s cubic-bezier(.3,.8,.3,1);
}
.toggle.off { background: var(--line); background: color-mix(in srgb, var(--ink) 18%, transparent); }
.toggle.off::after { left: 3px; }

/* ---------- Bottom-Sheet (A2HS-Hinweis etc.) ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; display: none; }
.sheet.open { display: block; }
.sheet .scrim {
  position: absolute; inset: 0; background: rgba(12,10,9,.42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: wg-fade .2s;
}
@keyframes wg-fade { from { opacity: 0; } to { opacity: 1; } }
.sheet .panel {
  position: absolute; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r));
  bottom: calc(10px + var(--safe-b));
  border-radius: var(--r-l); padding: 22px 20px 22px;
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(var(--sat)); -webkit-backdrop-filter: blur(30px) saturate(var(--sat));
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-hi);
  animation: wg-up .3s cubic-bezier(.2,.9,.25,1); max-width: 440px; margin: 0 auto;
}
@keyframes wg-up { from { transform: translateY(34px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet h4 { font-size: 18px; margin: 12px 0 6px; }
.sheet p { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 14px; }
.sheet .steps { font-size: 12.5px; display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.sheet .steps div { display: flex; gap: 10px; align-items: center; }
.sheet .steps i {
  width: 24px; height: 24px; border-radius: 50%; color: var(--clay);
  background: var(--clay-soft);
  background: color-mix(in srgb, var(--clay) 16%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  display: grid; place-items: center; font-size: 11px; font-style: normal; font-weight: 700; flex: 0 0 auto;
}

/* ---------- Toasts ---------- */
.toaststack {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottomnav-h) + var(--safe-b) + 14px); z-index: 90;
  display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: var(--ink);
  background: color-mix(in srgb, var(--ink) 82%, transparent); color: var(--paper);
  backdrop-filter: blur(20px) saturate(var(--sat)); -webkit-backdrop-filter: blur(20px) saturate(var(--sat));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,.2);
  padding: 13px 17px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 500; display: flex; gap: 10px; align-items: center;
  animation: wg-toast-in .22s ease-out;
}
.toast.error { background: var(--danger); background: color-mix(in srgb, var(--danger) 88%, transparent); color: #fff; }
@keyframes wg-toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Sonstiges ---------- */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 20px 0; }
.pagination a {
  color: var(--ink); padding: 9px 15px; text-decoration: none; border-radius: var(--r-pill); font-size: 13px;
  background: var(--card); border: 1px solid var(--card-edge); min-width: 20px; text-align: center;
}
.pagination a.active {
  background: var(--clay); border-color: var(--clay); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
