/*
 * Fotoalbum PILATUS VISION – Stylesheet. Ein File, kein Build-Schritt.
 *
 * Auftritt wie die Startseite: Montserrat, Nachtblau und Alpenglühen (#e48a88); die Marke in Marcellus.
 * Die Farbwerte stehen unten im Block «Palette PILATUS VISION» (dunkel und hell).
 * Die dunkle Darstellung ist Standard (Fotos wirken auf Dunkel am besten); «Hell» und
 * «Automatisch» bleiben im Konto wählbar. Die Kopfzeile mit dem Schriftzug ist immer dunkel,
 * damit Startseite, Anmeldung und Album aus einem Guss wirken.
 *
 * Schrift: Montserrat 300/400/600/900 (SIL Open Font License), lokal ausgeliefert.
 */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 300; font-display: swap; src: url(font_montserrat-latin-300-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 300; font-display: swap; src: url(font_montserrat-latin-ext-300-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap; src: url(font_montserrat-latin-400-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap; src: url(font_montserrat-latin-ext-400-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap; src: url(font_montserrat-latin-600-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap; src: url(font_montserrat-latin-ext-600-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 900; font-display: swap; src: url(font_montserrat-latin-900-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 900; font-display: swap; src: url(font_montserrat-latin-ext-900-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap; src: url(font_marcellus-latin-400-normal.woff2) format('woff2'); }

/*
 * Design-Tokens. Kontraste geprüft (WCAG 2.2 AA): Text >= 4.5:1, Rahmen von Feldern >= 3:1,
 * dunkel und hell. Die Namen --cloth/--on-cloth stammen aus der ersten Fassung (Buchleinen)
 * und bezeichnen heute die Akzentfarbe für Text (--cloth) und für Flächen (--accent).
 */
:root {
    color-scheme: dark;

    /* Farben – dunkel (Standard) */
    --paper: #151718;          /* Seitenhintergrund, Nachtgrau der Startseite */
    --surface: #1e2122;        /* Karten, Felder, Listen */
    --surface-2: #272b2c;      /* Erhöhte Flächen: Menü, Schwebeleiste */
    --ink: #f2f2ef;            /* Text */
    --ink-muted: #a9aeab;      /* Nebentext, 8:1 */
    --line: rgb(255 255 255 / 0.1);   /* Trennlinien (nur Dekor) */
    --field-border: rgb(255 255 255 / 0.45);  /* Rahmen von Eingabefeldern, 3.7:1 */
    --accent: #e48a88;         /* Alpenglühen: Hauptaktion, Markierung */
    --accent-strong: #f0a39b;  /* Alpenglühen hell: Hover auf Flächen */
    --on-accent: #161310;      /* Text auf Bernstein, 8.5:1 */
    --cloth: #f3b3a9;          /* Akzent als Text: Links, aktive Navigation */
    --cloth-deep: #d9776d;
    --on-cloth: #161310;
    --cloth-tint: rgb(228 138 136 / 0.16);  /* Alpenglühen, sehr zart: Auswahl, aktive Navigation */
    --danger: #ff9a8f;
    --danger-tint: rgb(255 154 143 / 0.12);
    --on-danger: #1b0b0a;
    --ok: #86d9a6;
    --ok-tint: rgb(134 217 166 / 0.12);
    --focus: #f3b3a9;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -20px rgb(0 0 0 / 0.7);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.3), 0 24px 48px -16px rgb(0 0 0 / 0.75);

    /* Kopfzeile: immer dunkel, auf hell und dunkel gleich */
    --topbar-h: 60px;          /* Höhe der Kopfzeile; darunter haften Unterzeile, Vorschau-Balken und Foto */
    --bar: rgb(21 23 24 / 0.92);
    --bar-ink: #f2f2ef;
    --bar-muted: rgb(242 242 239 / 0.66);
    --bar-line: rgb(255 255 255 / 0.09);
    --bar-hover: rgb(255 255 255 / 0.08);

    /* Schrift: eine Familie, Gewichte tragen die Hierarchie (300 Titel, 400 Text, 600 Betonung) */
    --font-title: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-ui: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Typografische Skala (1.25), Basis 16.5px */
    --text-s: 0.875rem;    /* 14 */
    --text-m: 1.03125rem;  /* 16.5 */
    --text-l: 1.25rem;     /* 20 */
    --text-xl: 1.5625rem;  /* 25 */
    --text-2xl: 1.9375rem; /* 31 */
    --text-3xl: 2.4375rem; /* 39 */

    /* Abstände: 4-px-Raster */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
    --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

    /* Formen: Felder und Knöpfe weich, Karten und Kacheln deutlich gerundet */
    --radius: 10px;
    --radius-l: 16px;
    --radius-tile: 14px;
    --radius-pill: 999px;

    --measure: 38rem;          /* Lesebreite */
    --page: 100rem;            /* maximale Seitenbreite (1600 px): grosse Bildschirme zeigen mehr, Formulare bleiben lesbar */
    --touch: 44px;             /* minimale Touch-Zielgröße */

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hell: ausdrücklich gewählt, oder «Automatisch» auf einem hellen Gerät */
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        color-scheme: light;
        --paper: #f4f3f0;
        --surface: #ffffff;
        --surface-2: #ffffff;
        --ink: #1b1d1e;
        --ink-muted: #5c6260;
        --line: #e3e2dd;
        --field-border: #767d79;
        --cloth: #a15b00;
        --cloth-deep: #7d4600;
        --on-cloth: #ffffff;
        --cloth-tint: rgb(228 138 136 / 0.18);
        --danger: #a3322e;
        --danger-tint: #f6e4e2;
        --on-danger: #ffffff;
        --ok: #2f6b45;
        --ok-tint: #e2efe6;
        --focus: #a15b00;
        --shadow: 0 1px 2px rgb(27 29 30 / 0.06), 0 14px 36px -20px rgb(27 29 30 / 0.25);
        --shadow-lift: 0 2px 4px rgb(27 29 30 / 0.08), 0 24px 48px -16px rgb(27 29 30 / 0.3);
    }
}
:root[data-theme="light"] {
    color-scheme: light;
    --paper: #f4f3f0;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --ink: #1b1d1e;
    --ink-muted: #5c6260;
    --line: #e3e2dd;
    --field-border: #767d79;
    --cloth: #a15b00;
    --cloth-deep: #7d4600;
    --on-cloth: #ffffff;
    --cloth-tint: rgb(228 138 136 / 0.18);
    --danger: #a3322e;
    --danger-tint: #f6e4e2;
    --on-danger: #ffffff;
    --ok: #2f6b45;
    --ok-tint: #e2efe6;
    --focus: #a15b00;
    --shadow: 0 1px 2px rgb(27 29 30 / 0.06), 0 14px 36px -20px rgb(27 29 30 / 0.25);
    --shadow-lift: 0 2px 4px rgb(27 29 30 / 0.08), 0 24px 48px -16px rgb(27 29 30 / 0.3);
}
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Palette PILATUS VISION: Nachtblau statt Nachtgrau, Alpenglühen statt Bernstein ---------- */
:root {
    --paper: #12142a;
    --surface: #1b1e3a;
    --surface-2: #242850;
    --ink: #f4f1f2;
    --ink-muted: #b0b3c8;
    --accent: #e48a88;
    --accent-strong: #f0a39b;
    --on-accent: #1d1114;
    --cloth: #f3b3a9;
    --cloth-deep: #d9776d;
    --on-cloth: #1d1114;
    --cloth-tint: rgb(228 138 136 / 0.16);
    --focus: #f3b3a9;
    --bar: rgb(18 20 42 / 0.92);
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --paper: #f6f2ef;
        --surface: #ffffff;
        --surface-2: #ffffff;
        --ink: #1b1d33;
        --ink-muted: #5a5f78;
        --line: #e6e0dd;
        --field-border: #777a8c;
        --cloth: #a1424c;
        --cloth-deep: #7c2f38;
        --on-cloth: #ffffff;
        --cloth-tint: rgb(228 138 136 / 0.18);
        --focus: #a1424c;
    }
}
:root[data-theme="light"] {
    --paper: #f6f2ef;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --ink: #1b1d33;
    --ink-muted: #5a5f78;
    --line: #e6e0dd;
    --field-border: #777a8c;
    --cloth: #a1424c;
    --cloth-deep: #7c2f38;
    --on-cloth: #ffffff;
    --cloth-tint: rgb(228 138 136 / 0.18);
    --focus: #a1424c;
}

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

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

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--text-m);
    line-height: 1.55;
    font-weight: 400;
}

h1, h2, h3 {
    overflow-wrap: break-word;
    hyphens: auto;
    font-family: var(--font-title);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0;
    text-wrap: balance;
}

/* Seitentitel leicht, wie «ZUG» im Schriftzug */
h1 { font-size: clamp(var(--text-xl), 7vw, var(--text-2xl)); font-weight: 300; letter-spacing: 0; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-l); }
h1 strong, h1 b { font-weight: 600; }

p { margin: 0; max-width: var(--measure); }

a {
    color: var(--cloth);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

img, svg { display: block; max-width: 100%; }

[hidden] { display: none !important; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--s-4);
    top: -100px;
    z-index: 100;
    padding: var(--s-3) var(--s-4);
    background: var(--accent);
    color: var(--on-accent);
    border-radius: var(--radius-pill);
    font-weight: 600;
}
.skip-link:focus { top: var(--s-3); }

.muted { color: var(--ink-muted); }
.small { font-size: var(--text-s); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Marke PILATUS VISION (Kopfzeile; gross auf der Startseite via pilatus.css) ---------- */
.pv-logo { display: inline-flex; align-items: center; gap: 0.55em; color: inherit; text-decoration: none; line-height: 1; white-space: nowrap; }
.pv-logo__mark { display: block; width: auto; height: 1em; flex: none; }
.pv-logo__text { font-family: 'Marcellus', Georgia, serif; font-weight: 400; font-size: 0.78em; letter-spacing: 0.12em; text-transform: uppercase; transform: translateY(0.04em); }
.pv-logo--bar { font-size: 1.75rem; }
.pv-logo--small { font-size: 2rem; }
.pv-logo--cover { font-size: clamp(2.6rem, 7vw, 3.6rem); }
.pv-logo--mark { font-size: 2.8rem; gap: 0; }
.pv-logo--mark .pv-logo__mark { height: 0.95em; }
.topbar__brand .pv-logo { flex: none; }
.show__brand { margin: 0; }

/* ---------- Alter Schriftzug (Klassen bleiben gültig) ---------- */

.wordmark {
    position: relative;
    display: inline-block;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    white-space: nowrap;
}
.wordmark__a { position: relative; font-weight: 900; color: #ffffff; }
.wordmark__b { position: relative; font-weight: 300; color: var(--accent); }
a.wordmark { text-decoration: none; color: inherit; }
.wordmark--bar { font-size: 1.125rem; letter-spacing: 0.1rem; }

/* ---------- Kopfzeile: dunkle Markenleiste, auf jeder Seite gleich ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    background: var(--bar);
    color: var(--bar-ink);
    border-bottom: 1px solid var(--bar-line);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    max-width: var(--page);
    margin: 0 auto;
    padding: var(--s-2) var(--s-4);
    min-height: var(--topbar-h);
}

.topbar__brand {
    display: inline-flex;
    align-items: baseline;
    gap: var(--s-3);
    flex: 0 1 auto;
    min-width: 6.5rem; /* der Schriftzug wird nie überdeckt */
    color: var(--bar-ink);
    text-decoration: none;
    min-height: var(--touch);
    align-items: center;
}
.topbar__tenant {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 300;
    font-size: var(--text-m);
    letter-spacing: 0.02em;
    color: var(--bar-muted);
    border-left: 1px solid var(--bar-line);
    padding-left: var(--s-3);
}
.topbar__brand:hover .topbar__tenant { color: var(--bar-ink); }
/* Tablet: trägt das Logo den Namen schon, braucht die enge Kopfzeile ihn nicht nochmals (ab 1100 px wieder beides) */
@media (min-width: 760px) and (max-width: 1099px) { .topbar__logo + .topbar__tenant { display: none; } }
.topbar__brand:focus-visible { outline-offset: 4px; }

.topbar__nav {
    display: none;
    gap: var(--s-1);
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;           /* auf dem Tablet scrollt die Leiste, statt den Schriftzug zu überdecken */
    scrollbar-width: none;
    justify-content: flex-start;
}
.topbar__nav::-webkit-scrollbar { display: none; }
.topbar__brand .wordmark { flex: none; }
.topbar .topbar__role, .topbar .menu { flex: none; }

.navlink {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: var(--touch);
    padding: 0 var(--s-3);
    border-radius: var(--radius);
    color: var(--ink-muted);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.navlink > svg { flex: none; opacity: .85; }
@media (max-width: 1599px) { .navlink > svg { display: none; } } /* unter 1600 px: nur die Wörter, sonst wird die Zeile zu eng */
.navlink:hover { color: var(--ink); background: var(--cloth-tint); }
.navlink[aria-current='page'] { color: var(--cloth); background: var(--cloth-tint); font-weight: 600; }

/* In der dunklen Leiste: helle Schrift, aktiver Punkt mit Bernstein-Strich */
.topbar .navlink { color: var(--bar-muted); border-radius: var(--radius-pill); white-space: nowrap; }
/* Trenner zwischen den Punkten für alle (Alben, Suchen, Karte) und den Abschnitten für Rollen (Verwaltung, System) */
.topbar__divider { flex: none; width: 1px; height: 22px; margin: 0 var(--s-2); background: var(--bar-line); align-self: center; }
/* Werkzeuge rechts: Fehler melden, Sprache, Rolle, Konto */
.topbar__tools { display: flex; align-items: center; gap: var(--s-3); flex: none; margin-left: auto; }
.topbar__bug {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: var(--touch); height: var(--touch); padding: 0 10px; border-radius: var(--radius-pill);
    color: var(--bar-muted); text-decoration: none; font-size: var(--text-s); font-weight: 500; white-space: nowrap;
    transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.topbar__bug svg { flex: none; }
.menu__panel .menu__item--phone { display: none; } /* «Fehler melden» im Kontomenü nur auf dem Handy – am Rechner steht der Käfer in der Kopfzeile */
@media (max-width: 759px) { .menu__panel .menu__item--phone { display: flex; } }
.choice--off { opacity: .6; cursor: default; }
.topbar__bug:hover { color: var(--bar-ink); background: var(--bar-hover); }
@media (max-width: 1439px) { .topbar__bug { padding: 0; width: var(--touch); border-radius: 50%; } .topbar__bug__label { display: none; } }
.topbar .navlink:hover { color: var(--bar-ink); background: var(--bar-hover); }
.topbar .navlink[aria-current='page'] { color: var(--bar-ink); background: transparent; }
.topbar .navlink[aria-current='page']::after {
    content: '';
    position: absolute;
    left: var(--s-3);
    right: var(--s-3);
    bottom: 6px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}
.topbar :focus-visible { outline-color: var(--accent-strong); }

.page {
    max-width: var(--page);
    margin: 0 auto;
    padding: var(--s-6) var(--s-4) calc(var(--s-8) + 72px);
}

/* Dezente Fusszeile: App-Name, Urheber, Fassung – auf dem Handy über der Tableiste */
.app-foot {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 var(--s-2);
    max-width: var(--page);
    /* rückt in den unteren Innenabstand der Seite hinein (dort ist Platz für die Tableiste) und lässt die Tableiste frei */
    margin: calc(-1 * (var(--s-8) + 72px) + var(--s-4)) auto 0; padding: 0 var(--s-4) calc(72px + var(--s-3));
    font-size: 0.75rem; letter-spacing: 0.02em; color: var(--ink-muted); opacity: .8;
}
.app-foot__name { font-weight: 600; }
.app-foot__ver { opacity: .7; }
@media (min-width: 760px) { .app-foot { margin-top: calc(-1 * var(--s-8) + var(--s-4)); padding-bottom: var(--s-6); } }
.page--public + .app-foot { margin-top: 0; padding-top: var(--s-4); }

/* Untere Navigation auf dem Telefon, in Daumenreichweite */
.tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    display: flex;
    justify-content: space-around;
    background: var(--bar);
    color: var(--bar-ink);
    border-top: 1px solid var(--bar-line);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    padding: var(--s-1) var(--s-2) max(var(--s-1), env(safe-area-inset-bottom));
}

.tabbar a {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 56px;
    justify-content: center;
    color: var(--bar-muted);
    text-decoration: none;
    font-size: var(--text-s);
    border-radius: var(--radius);
}
.tabbar a[aria-current='page'] { color: var(--accent-strong); font-weight: 600; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar :focus-visible { outline-color: var(--accent-strong); }

@media (min-width: 760px) {
    .topbar__nav { display: flex; }
    .topbar__inner { padding-inline: var(--s-5); gap: var(--s-5); }
    .tabbar { display: none; }
    .page { padding: var(--s-7) var(--s-5) var(--s-8); }
}

/* ---------- Abschnitte mit Menü (Verwaltung, System): Seitenleiste am Rechner, Menüblatt auf dem Handy ---------- */

.section-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.section-layout__main { min-width: 0; }

/* Schmale Zeile über dem Inhalt (bis 1023 px): «Verwaltung › Mitglieder» und der Knopf «Menü» */
.sidenav__bar {
    display: flex; align-items: center; gap: var(--s-2);
    min-height: 44px; padding: 0 var(--s-1);
    border-bottom: 1px solid var(--line);
    font-size: var(--text-s);
}
.sidenav__crumb { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink); font-weight: 600; text-decoration: none; min-height: 44px; }
.sidenav__crumb svg { color: var(--cloth); }
.sidenav__crumb-sep { color: var(--ink-muted); }
.sidenav__current { color: var(--ink-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidenav__toggle {
    margin-left: auto; flex: none;
    display: inline-flex; align-items: center; gap: var(--s-2);
    min-height: 40px; padding: 0 var(--s-3); border-radius: var(--radius-pill);
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600;
}
.sidenav__toggle:hover { background: var(--cloth-tint); }

/* Das Menü selbst – Gruppen mit Überschrift, jeder Punkt mit Symbol und ggf. Zahl */
.sidenav__panel { display: none; }
.sidenav__head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-3); }
.sidenav__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-weight: 700; color: var(--ink); min-width: 0; }
.sidenav__title svg { color: var(--cloth); flex: none; }
.sidenav__badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--cloth-tint); color: var(--cloth); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.sidenav__close { display: none; margin-left: auto; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; color: var(--ink-muted); }
.sidenav__close:hover { background: var(--cloth-tint); color: var(--ink); }
.sidenav__group { display: grid; gap: 1px; padding: var(--s-1) 0; }
.sidenav__group + .sidenav__group { border-top: 1px solid var(--line); margin-top: var(--s-1); padding-top: var(--s-3); }
.sidenav__heading { margin: 0 0 var(--s-1); padding: 0 var(--s-3); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-muted); }
.sidenav__link {
    position: relative;
    display: flex; align-items: center; gap: var(--s-3);
    min-height: 40px; padding: 0 var(--s-3);
    border-radius: var(--radius);
    color: var(--ink); text-decoration: none; font-size: var(--text-s); font-weight: 500;
    transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.sidenav__link > svg { flex: none; color: var(--ink-muted); }
.sidenav__link > span:first-of-type { flex: 1 1 auto; min-width: 0; }
.sidenav__link .count { margin-left: auto; }
.sidenav__link:hover { background: var(--cloth-tint); }
.sidenav__link[aria-current='page'] { background: var(--cloth-tint); color: var(--cloth); font-weight: 600; }
.sidenav__link[aria-current='page'] > svg { color: var(--cloth); }
.sidenav__link[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
.sidenav__link--action { color: var(--ink-muted); }
.sidenav__backdrop { display: none; }
.count--quiet { background: var(--surface-2); color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line); }

/* Bis 1023 px: Menüblatt von unten, geöffnet über den Anker (#bereichsmenu:target) oder per Skript (data-open) */
@media (max-width: 1023px) {
    .sidenav__panel:target, .sidenav[data-open] .sidenav__panel {
        display: block;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        max-height: min(85vh, 100dvh - var(--topbar-h));
        overflow-y: auto; overscroll-behavior: contain;
        padding: var(--s-2) var(--s-3) max(var(--s-4), env(safe-area-inset-bottom));
        background: var(--surface-2); border-radius: var(--radius-l) var(--radius-l) 0 0;
        box-shadow: 0 -8px 40px rgb(0 0 0 / 0.45);
        animation: sheet-up 220ms var(--ease);
    }
    .sidenav__panel:target .sidenav__close, .sidenav[data-open] .sidenav__close { display: inline-flex; }
    .sidenav__panel:target ~ .sidenav__backdrop, .sidenav[data-open] .sidenav__backdrop {
        display: block; position: fixed; inset: 0; z-index: 39; background: rgb(0 0 0 / 0.5);
    }
    .sidenav__panel .sidenav__link { min-height: 48px; font-size: var(--text-m); }
    .sidenav__panel .sidenav__group { grid-template-columns: 1fr; }
    @keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
    @media (prefers-reduced-motion: reduce) { .sidenav__panel:target, .sidenav[data-open] .sidenav__panel { animation: none; } }
}
@media (min-width: 760px) and (max-width: 1023px) {
    /* Tablet: das Blatt nicht in voller Breite – als Fenster von rechts oben */
    .sidenav__panel:target, .sidenav[data-open] .sidenav__panel { left: auto; right: var(--s-4); bottom: auto; top: calc(var(--topbar-h) + var(--s-7)); width: 22rem; max-height: calc(100vh - var(--topbar-h) - var(--s-8)); border-radius: var(--radius-l); }
}

/* Ab 1024 px: Seitenleiste links, haftet beim Blättern; keine Zeile, kein Blatt */
@media (min-width: 1024px) {
    .section-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: var(--s-6); }
    .sidenav { position: sticky; top: calc(var(--topbar-h) + var(--s-4)); max-height: calc(100vh - var(--topbar-h) - var(--s-6)); overflow-y: auto; }
    .sidenav__bar { display: none; }
    .sidenav__panel { display: block; }
    .sidenav__head { padding-left: var(--s-3); }
}
@media (min-width: 1400px) { .section-layout { grid-template-columns: 16rem minmax(0, 1fr); gap: var(--s-7); } }

/* Übersichtsseiten: alle Seiten des Abschnitts als Karten, gruppiert wie das Menü */
.section-cards { display: grid; gap: var(--s-5); }
.section-cards__heading { margin: 0 0 var(--s-2); font-size: var(--text-s); font-weight: 600; letter-spacing: 0.02em; color: var(--ink-muted); }
.section-cards__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.section-cards__list > li { display: grid; }
/* Auf dem Handy: die Zahlen als kompakte Zeile, damit die Seiten des Abschnitts schnell erreichbar sind */
@media (max-width: 759px) {
    .stats--inline { display: flex; flex-wrap: wrap; gap: var(--s-2); }
    .stats--inline .stat { flex: 1 1 8rem; padding: var(--s-2) var(--s-3); gap: 0; }
    .stats--inline .stat dd { font-size: 1.25rem; }
    .stats--inline .stat dt { font-size: 0.75rem; }
    .stats--inline .stat dd .stat__sub { margin-top: 0; }
}
.section-card {
    display: flex; align-items: center; gap: var(--s-3);
    min-height: 72px; padding: var(--s-3) var(--s-4);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    color: var(--ink); text-decoration: none;
    transition: border-color 140ms var(--ease), background-color 140ms var(--ease), transform 140ms var(--ease);
}
.section-card:hover { border-color: var(--cloth); background: var(--cloth-tint); }
.section-card > svg:last-child { flex: none; color: var(--ink-muted); }
.section-card__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--cloth-tint); color: var(--cloth); }
.section-card__text { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.section-card__text strong { font-weight: 600; }
.section-card__text span { font-size: 0.8125rem; color: var(--ink-muted); line-height: 1.35; }
.section-card--attention { border-color: var(--accent); }
.section-card .count { flex: none; margin: 0; }

/* «Braucht Ihre Aufmerksamkeit» auf der Übersicht der Verwaltung */
.todo { padding: var(--s-4) var(--s-5); border-left: 4px solid var(--accent); }
.todo__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.todo__item { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: var(--s-1) var(--s-2); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.todo__item > svg:first-child { color: var(--cloth); flex: none; }
.todo__item > span { flex: 1 1 auto; }
.todo__item > svg:last-child { color: var(--ink-muted); flex: none; }
.todo__item:hover { background: var(--cloth-tint); }
.menu__sep { height: 1px; margin: var(--s-2) 0; background: var(--line); }

/* Gespeicherter Zugang eines Postfachs (components/mail-summary): gesperrt, auf einen Blick, «Bearbeiten» öffnet das Formular */
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.panel__head .panel__title { margin-bottom: 0; }
.mail-summary .legend { margin-top: var(--s-4); }
.legend--two { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.legend--two dd { color: var(--ink); overflow-wrap: anywhere; }
.mail-summary__secret { letter-spacing: 0.15em; font-family: ui-monospace, monospace; }
.notice-inline { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 0.8125rem; font-weight: 600; }
.notice-inline--ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.notice-inline--error { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.notify-events { display: grid; gap: var(--s-2); margin: 0 0 var(--s-4); padding: 0; list-style: none; }
.notify-events .check { align-items: flex-start; }
.notify-events .check__text { display: grid; gap: 2px; }
.notify-events .check__hint { font-size: var(--text-s); color: var(--ink-muted); }
.recipients { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-3); padding: 0; list-style: none; }
.recipients li { display: inline-flex; align-items: center; gap: var(--s-2); padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--text-s); }
.recipients li svg { color: var(--cloth); }

/* Rollenübersicht (System → Übersicht, Verwaltung → Mitglieder) */
.roles { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 0; padding: 0; list-style: none; }
.role { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.role__name { display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2); font-weight: 600; }
.role__name svg { color: var(--cloth); }
.role__who { margin: 0 0 var(--s-3); color: var(--ink-muted); font-size: var(--text-s); }
.role ul { margin: 0; padding-left: 1.1rem; font-size: var(--text-s); line-height: 1.5; }
.role li + li { margin-top: 2px; }

/* ---------- Deckel im Regal: Bereiche und Alben als Fotokarten ---------- */

.shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: var(--s-5) var(--s-4);
    padding: 0;
    margin: 0;
    list-style: none;
}
.shelf--small { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--s-4) var(--s-3); }
@media (min-width: 1200px) { .shelf { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--s-6) var(--s-5); } }
@media (min-width: 1700px) { .shelf { grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); } }

.book {
    display: block;
    color: var(--ink);
    text-decoration: none;
    border-radius: var(--radius-l);
}

.book__cover {
    --tone: #3a3f41;
    --tone-2: #23272a;
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-l);
    background: linear-gradient(145deg, var(--tone), var(--tone-2));
    box-shadow: var(--shadow);
    transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
    isolation: isolate;
}
.book__cover--tone-0 { --tone: #4a4039; --tone-2: #2a2522; }
.book__cover--tone-1 { --tone: #34434a; --tone-2: #1f282c; }
.book__cover--tone-2 { --tone: #3f4a3b; --tone-2: #232a21; }
.book__cover--tone-3 { --tone: #4a3b47; --tone-2: #2a2129; }

.book__window { position: absolute; inset: 0; display: block; }
.book__window img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms var(--ease-out), filter 300ms var(--ease);
}

/* Ohne Titelbild: Albumzeichen, leicht, in Bernstein */
.book__icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgb(255 255 255 / 0.5);
}
.book__icon svg { width: 34%; height: 34%; stroke-width: 1.2; }

/* Beschriftung liegt unten im Bild, über einem weichen Verlauf */
.book__caption {
    position: absolute;
    inset: auto 0 0 0;
    display: grid;
    gap: 2px;
    padding: 40% var(--s-4) var(--s-3);
    background: linear-gradient(180deg, rgb(0 0 0 / 0) 0%, rgb(0 0 0 / 0.55) 55%, rgb(0 0 0 / 0.78) 100%);
    color: #ffffff;
    text-align: left;
}
.book__name {
    font-size: var(--text-m);
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}
.book__meta { font-size: var(--text-s); color: rgb(255 255 255 / 0.78); font-weight: 400; }
.shelf--small .book__name { font-size: var(--text-s); }
.shelf--small .book__caption { padding-inline: var(--s-3); }

a.book:hover .book__cover,
a.book:focus-visible .book__cover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift), 0 0 0 2px var(--accent);
}
a.book:hover .book__window img { transform: scale(1.05); }
a.book:focus-visible { outline: none; }

/* ---------- Schaltflächen ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: var(--touch);
    padding: 0 var(--s-5);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 140ms var(--ease), border-color 140ms var(--ease), box-shadow 200ms var(--ease), transform 120ms var(--ease);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(0.985); }

.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 24px -12px rgb(228 138 136 / 0.75); }
.btn--primary:hover { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 10px 28px -10px rgb(228 138 136 / 0.85); }

.btn--secondary { background: transparent; color: var(--ink); border-color: var(--field-border); }
.btn--secondary:hover { background: var(--cloth-tint); border-color: var(--cloth); }

.btn--quiet { background: transparent; color: var(--cloth); padding: 0 var(--s-3); }
.btn--quiet:hover { background: var(--cloth-tint); }

.btn--danger { background: var(--danger); color: var(--on-danger, #ffffff); }
.btn--danger:hover { filter: brightness(0.94); }

.btn--danger-quiet { background: transparent; color: var(--danger); border-color: currentColor; }
.btn--danger-quiet:hover { background: var(--danger-tint); }

.btn--block { width: 100%; }

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3);
}

/* ---------- Formulare ---------- */

.form { display: grid; gap: var(--s-5); max-width: 36rem; }

.field { display: grid; gap: var(--s-2); }

.field__label { font-weight: 600; }

.field__hint { font-size: var(--text-s); color: var(--ink-muted); }

.field__error {
    display: flex;
    gap: var(--s-2);
    font-size: var(--text-s);
    color: var(--danger);
    font-weight: 600;
}

.input,
.select {
    width: 100%;
    height: 48px;
    padding: 0 var(--s-4);
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.input:focus-visible,
.select:focus-visible { outline-offset: 0; border-color: var(--focus); }
.input[aria-invalid='true'] { border-color: var(--danger); border-width: 2px; }
.input[readonly] { color: var(--ink-muted); background: transparent; }

.input-reveal { position: relative; }
.input-reveal .input { padding-right: 3.5rem; }
.input-reveal__toggle {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    width: var(--touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    border-radius: var(--radius);
    cursor: pointer;
}
.input-reveal__toggle svg { width: 22px; height: 22px; }

.check {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    min-height: var(--touch);
    cursor: pointer;
}
.check input { flex: none; width: 24px; height: 24px; accent-color: var(--accent); margin: 0; }

.choice-list { display: grid; gap: var(--s-2); border: 0; padding: 0; margin: 0; }
.choice-list legend { font-weight: 600; margin-bottom: var(--s-2); padding: 0; }
.choice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px var(--s-3);
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
}
.choice input { grid-row: span 2; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice__hint { font-size: var(--text-s); color: var(--ink-muted); }

/* ---------- Meldungen ---------- */

.notice {
    display: flex;
    gap: var(--s-3);
    align-items: flex-start;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--radius);
    border-left: 4px solid var(--ok);
    background: var(--ok-tint);
    max-width: var(--measure);
}
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--ok); }
.notice--error { border-left-color: var(--danger); background: var(--danger-tint); }
.notice--error svg { color: var(--danger); }
.notice--info { border-left-color: var(--accent); background: var(--cloth-tint); }
.notice--info svg { color: var(--cloth); }
.notice--welcome { border-left-color: var(--accent); background: var(--cloth-tint); max-width: none; }
.notice--welcome svg { color: var(--cloth); width: 28px; height: 28px; }
.notice--welcome .notice__title { font-weight: 700; font-size: var(--text-l); margin: 0 0 var(--s-1); }
.notice--welcome p { margin: 0; }
.notice--undo { border-left-color: var(--accent); background: var(--cloth-tint); align-items: center; }
.notice--undo svg { color: var(--cloth); margin-top: 0; }
.notice--undo p { flex: 1; margin: 0; }
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- Seitenkopf, Abschnitte, Leerzustand ---------- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
}
.page-header__text { display: grid; gap: var(--s-2); }
.page-header__back {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    font-size: var(--text-s);
    color: var(--ink-muted);
    text-decoration: none;
    min-height: 32px;
}
.page-header__back svg { width: 18px; height: 18px; }
.page-header__back:hover { color: var(--ink); }

.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
.stack--tight { gap: var(--s-4); }

.section { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.section + .section, form + .section { margin-top: var(--s-7); }
.stack > .section + .section { margin-top: 0; }
.section__title { font-size: var(--text-l); }

.panel {
    display: grid;
    gap: var(--s-4);
    padding: var(--s-5);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);
}
.panel + .panel { margin-top: var(--s-5); }
.stack > .panel + .panel { margin-top: 0; }
.panel__title { font-size: var(--text-l); }
.panel--warn { border-left: 4px solid var(--danger); }

/* Sprungleiste nach Album («Meine Likes») */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-5); }
.chip { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 32px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font-size: var(--text-s); font-weight: 500; text-decoration: none; }
.chip:hover { border-color: var(--ink-muted); background: var(--cloth-tint); }
/* Kinder: feste Chips «Kind 1 Thomas ×» */
.chips--children { margin-bottom: var(--s-3); }
.chip--static { cursor: default; padding-right: 4px; }
.chip--static:hover { border-color: var(--line); background: var(--surface); }
.chip__index { color: var(--ink-muted); font-size: 0.75rem; }
.chip__remove { margin: 0; display: inline-flex; }
/* Dichte Häkchenliste (Gruppen auf der Mitgliedsseite, Personen auf der Gruppenseite) */
.choice-list--compact { gap: 4px; }
.choice-list--compact .choice { padding: var(--s-2) var(--s-3); }
.choice-list--compact .choice input { width: 20px; height: 20px; }
.pick-list { max-height: 22rem; overflow: auto; padding: 2px; }
.pick-list .choice[hidden] { display: none; }
.panel__subtitle { margin: var(--s-4) 0 var(--s-2); font-size: var(--text-m); font-weight: 600; }
.table--compact td, .table--compact th { padding-block: 6px; }

.empty {
    display: grid;
    gap: var(--s-3);
    justify-items: start;
    padding: var(--s-6) 0;
    max-width: var(--measure);
}
.empty__title { font-size: var(--text-xl); font-weight: 300; }

/* ---------- Kennzeichen ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--s-3);
    border-radius: var(--radius-pill);
    font-size: var(--text-s);
    font-weight: 600;
    line-height: 1.4;
    background: var(--cloth-tint);
    color: var(--ink);
    white-space: nowrap;
}
.badge--muted { background: transparent; border: 1px solid var(--line); color: var(--ink-muted); }
.badge--warn { background: var(--danger-tint); color: var(--danger); }
.badge--invited { background: var(--cloth-tint); }
.badge--active { background: var(--ok-tint); color: var(--ok); }
.badge--disabled, .badge--suspended { background: var(--danger-tint); color: var(--danger); }

/* ---------- Listen und Tabellen ---------- */

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    overflow: hidden;
}
.table th {
    text-align: left;
    font-size: var(--text-s);
    font-weight: 600;
    color: var(--ink-muted);
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
}
.table td {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table__primary { font-weight: 600; color: var(--ink); text-decoration: none; }
a.table__primary:hover { text-decoration: underline; }
.table__sub { display: block; font-size: var(--text-s); color: var(--ink-muted); overflow-wrap: anywhere; }
.table__num { text-align: right; font-variant-numeric: tabular-nums; }

/* Auf schmalen Bildschirmen wird jede Zeile zu einem Eintrag */
@media (max-width: 699px) {
    .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; }
    .table--stack tr { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
    .table--stack tr:last-child { border-bottom: 0; }
    .table--stack td { padding: 2px 0; border: 0; text-align: left; }
    .table--stack td[data-label]::before {
        content: attr(data-label) ': ';
        color: var(--ink-muted);
        font-size: var(--text-s);
    }
}
.table--stack td.small { overflow-wrap: anywhere; }
/* Handy: Tabellen als Karten (6.7) – jede Zeile eine Karte, die Zeilenüberschrift als Titel, Zellen mit Beschriftung aus data-label */
@media (max-width: 759px) {
    .table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table--cards, .table--cards tbody, .table--cards tr, .table--cards td, .table--cards th[scope="row"] { display: block; }
    .table--cards { border: 0; background: none; }
    .table--cards tbody { display: grid; gap: var(--s-3); }
    .table--cards tr { padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
    .table--cards tr.is-muted { opacity: .7; }
    .table--cards th[scope="row"] { padding: 0 0 var(--s-2); border: 0; font-size: var(--text-m); }
    .table--cards td { display: flex; justify-content: space-between; gap: var(--s-3); padding: 3px 0; border: 0; text-align: right; font-size: var(--text-s); }
    .table--cards td[data-label]::before { content: attr(data-label); color: var(--ink-muted); text-align: left; flex: none; }
    .table--cards td:empty { display: none; }
    .table--cards td.small { flex-direction: column; align-items: flex-start; text-align: left; gap: 0; }
    .table-wrap:has(.table--cards) { overflow: visible; border-radius: 0; }
}
.table-wrap { position: relative; overflow-x: auto; border-radius: var(--radius-l); } /* relative: versteckte Beschriftungen bleiben im Scrollbereich */
.table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: flex-end;
    margin-bottom: var(--s-5);
}
.toolbar .field { flex: 1 1 14rem; }
.toolbar .select { width: auto; min-width: 10rem; }
.toolbar .btn { height: 48px; }

.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-4);
    margin-top: var(--s-5);
}

.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.list__item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-2) var(--s-4); min-height: 56px; border-bottom: 1px solid var(--line); }
.list__item:last-child { border-bottom: 0; }
.list__item > a { display: inline-flex; align-items: center; gap: var(--s-3); font-weight: 600; color: var(--ink); text-decoration: none; min-height: var(--touch); }
.list__item > a:hover { text-decoration: underline; }
.list__item svg { color: var(--ink-muted); }

/* ---------- Bestätigung ohne Skript: aufklappen, dann bestätigen ---------- */

.confirm > summary { list-style: none; }
.confirm > summary::-webkit-details-marker { display: none; }

.confirm__panel {
    margin-top: var(--s-3);
    padding: var(--s-4);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    background: var(--danger-tint);
    display: grid;
    gap: var(--s-3);
    max-width: var(--measure);
}

/* ---------- Kontomenü ---------- */

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.menu > summary::-webkit-details-marker { display: none; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f5b041, #d68910);
    color: var(--on-accent);
    font-weight: 600;
    font-size: var(--text-s);
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 2px rgb(255 255 255 / 0.12);
    transition: box-shadow 140ms var(--ease);
}
.menu > summary:hover .avatar, .menu[open] > summary .avatar { box-shadow: 0 0 0 3px rgb(228 138 136 / 0.6); }
/* Grössen und Farben (Farbe folgt dem Konto, siehe avatar() in src_ui.php) */
.avatar--xs { width: 24px; height: 24px; font-size: 0.65rem; }
.avatar--s { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar--m { width: 40px; height: 40px; }
.avatar--l { width: 56px; height: 56px; font-size: var(--text-m); }
.avatar--xl { width: 128px; height: 128px; font-size: 2.4rem; font-weight: 500; }
.avatar--img { background: var(--paper); overflow: hidden; }
.avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--c1 { background: linear-gradient(145deg, #f5b041, #d68910); }
.avatar--c2 { background: linear-gradient(145deg, #5dade2, #2874a6); }
.avatar--c3 { background: linear-gradient(145deg, #58d68d, #1e8449); }
.avatar--c4 { background: linear-gradient(145deg, #ec7063, #b03a2e); }
.avatar--c5 { background: linear-gradient(145deg, #af7ac5, #76448a); }
.avatar--c6 { background: linear-gradient(145deg, #48c9b0, #148f77); }
.avatar--c7 { background: linear-gradient(145deg, #f0b27a, #ca6f1e); }
.avatar--c8 { background: linear-gradient(145deg, #85929e, #566573); }
.avatar--c2, .avatar--c3, .avatar--c4, .avatar--c5, .avatar--c6, .avatar--c8 { color: #fff; }
/* Reihe von Avataren (wer hat geliked): leicht überlappend */
.avatars { display: inline-flex; align-items: center; }
.avatars > .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatars > .avatar:first-child { margin-left: 0; }
.avatars__more { margin-left: var(--s-2); font-size: var(--text-s); color: var(--ink-muted); }

.menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + var(--s-2));
    z-index: 30;
    width: min(19.5rem, calc(100vw - 2 * var(--s-4)));
    padding: var(--s-2);
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-lift);
}
.menu__who { padding: var(--s-3); border-bottom: 1px solid var(--line); margin-bottom: var(--s-2); }
.menu__who strong { display: block; }
.menu__item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: var(--s-3);
    min-height: var(--touch);
    padding: 0 var(--s-3);
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--ink);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.menu__item:hover { background: var(--cloth-tint); }
.menu__item svg { width: 20px; height: 20px; color: var(--ink-muted); }
.menu__panel button.menu__item { text-align: left; }
.menu__panel--start { right: auto; left: 0; }
.page-header .menu > summary.btn { list-style: none; border-radius: var(--radius-pill); }

/* ---------- Kennzahlen (Systemverwaltung) ---------- */

.figures, .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: var(--s-3);
    margin: 0;
}
.stats { margin-bottom: var(--s-6); }
.figure, .stat {
    display: grid;
    gap: var(--s-1);
    padding: var(--s-4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);
}
.figure dt, .stat dt { color: var(--ink-muted); font-size: var(--text-s); }
.figure dd, .stat dd { margin: 0; font-size: var(--text-2xl); font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat--warn { border-left: 4px solid var(--danger); }
.stat dd .stat__sub, .stat dd .muted { display: block; font-size: var(--text-s); font-weight: 400; margin-top: var(--s-1); }

/* ---------- Einzelne Seiten ---------- */

.auth-heading { margin-bottom: var(--s-2); }
.auth-lead { color: var(--ink-muted); margin-bottom: var(--s-6); }
.auth-foot { margin-top: var(--s-6); font-size: var(--text-s); color: var(--ink-muted); }

.welcome { margin-bottom: var(--s-7); display: grid; gap: var(--s-2); }

.error-page {
    min-height: 100dvh; display: grid; place-items: center; padding: var(--s-5) var(--s-4);
    /* weicher, unscharfer Grund statt schwarzer Fläche */
    background:
        radial-gradient(60rem 30rem at 20% 10%, rgb(228 138 136 / 0.14), transparent 60%),
        radial-gradient(50rem 30rem at 85% 90%, rgb(134 217 166 / 0.10), transparent 60%),
        var(--paper);
}
.error-page__card {
    display: grid; gap: var(--s-3); width: min(32rem, 100%); padding: var(--s-6);
    border: 1px solid var(--line); border-radius: var(--radius-l); background: color-mix(in srgb, var(--surface-2) 82%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-lift);
}
.error-page__card .actions { margin-top: var(--s-2); }
.error-page__inner { display: grid; gap: var(--s-4); max-width: 30rem; } /* Wartungsseite */
.error-page__code { color: var(--ink-muted); font-size: var(--text-s); }
.modal__kicker { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--danger); font-size: var(--text-s); font-weight: 600; letter-spacing: 0.02em; }
.modal--error { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.modal--error .modal__title { margin-bottom: var(--s-2); }
.modal--error > p { margin: 0 0 var(--s-2); }

.definition {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--s-2) var(--s-5);
    margin: 0;
}
.definition dt { color: var(--ink-muted); }
.definition dd { margin: 0; overflow-wrap: anywhere; }

code { font-size: 0.92em; padding: 1px 5px; border-radius: 5px; background: var(--cloth-tint); }
.block { display: block; }
.debug { white-space: pre-wrap; font-size: var(--text-s); padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 60rem; overflow-x: auto; }
.btn--small { min-height: 36px; padding: 0 var(--s-4); font-size: var(--text-s); }
.btn--icon { padding: 0; width: var(--touch); }
.btn--secondary svg, .btn--quiet svg { color: currentColor; }
.actions--center { justify-content: center; }
.input--short { max-width: 24rem; }
.input--area { height: auto; padding: var(--s-3) var(--s-4); line-height: 1.5; resize: vertical; }
.select--small { height: 40px; width: auto; padding: 0 var(--s-3); }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--s-4) var(--s-5) var(--s-5); margin: 0; display: grid; gap: var(--s-4); }
.fieldset legend { font-weight: 600; padding: 0 var(--s-2); }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); margin-top: var(--s-4); }
.inline-form .field { flex: 1 1 16rem; }
.inline-form .btn { height: 48px; }
.field--date { flex: 0 1 11rem !important; }

.trail { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); font-size: var(--text-s); color: var(--ink-muted); }
.trail a { color: var(--ink-muted); text-decoration: none; }
.trail a:hover { color: var(--ink); text-decoration: underline; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.check-row { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s-3); padding: var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.check-row svg { grid-row: span 2; color: var(--ok); margin-top: 2px; }
.check-row--bad { border-left: 4px solid var(--danger); }
.check-row--bad svg { color: var(--danger); }
.check-row__name { font-weight: 600; }
.check-row > * { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Galerie ----------
 * Ohne JS: quadratisches Raster. Mit JS (.gallery--justified) setzt gallery.js pro Kachel
 * --w und --h (Breite/Höhe in px) für Blocksatz-Zeilen mit echtem Seitenverhältnis.
 * Kacheln: abgerundet; beim Darüberfahren hebt sich die Kachel mit Bernstein-Ring, das Bild
 * wächst leicht innerhalb des Rahmens.
 */
.gallery-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.sort { display: flex; gap: var(--s-2); align-items: center; min-width: 0; max-width: 100%; }
.sort .select { min-width: 0; max-width: calc(100vw - 2 * var(--s-4)); text-overflow: ellipsis; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--s-2); }
.gallery .tile-wrap {
    position: relative;
    aspect-ratio: 1;
    background: var(--tile-color, var(--surface));
    overflow: hidden;
    border-radius: var(--radius-tile);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
    transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
    isolation: isolate;
}
.gallery .tile { display: block; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; }
.gallery .tile img { width: 100%; height: 100%; object-fit: cover; }
.gallery--justified { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.gallery--justified .tile-wrap { aspect-ratio: auto; width: var(--w); height: var(--h); flex: none; }
.gallery--strip { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.tile img { transition: opacity 240ms var(--ease), transform 600ms var(--ease-out), filter 300ms var(--ease); }
.tile img.is-loading { opacity: 0; }
@media (hover: hover) {
    .gallery .tile-wrap:has(.tile:hover) { transform: translateY(-3px); box-shadow: var(--shadow-lift), 0 0 0 2px var(--accent); z-index: 1; }
    .gallery .tile:hover img { transform: scale(1.06); }
}
.tile:focus-visible { outline: none; }
.gallery .tile-wrap:has(.tile:focus-visible) { box-shadow: var(--shadow-lift), 0 0 0 3px var(--focus); z-index: 1; }
.tile__bar { position: absolute; left: 6px; bottom: 6px; z-index: 2; display: flex; align-items: center; gap: 4px; }
.tile__like, .tile__comments { display: inline-flex; align-items: center; gap: 3px; min-height: 28px; padding: 2px 8px 2px 7px; border: 0; border-radius: var(--radius-pill); background: rgb(0 0 0 / 0.5); color: #fff; font: inherit; font-size: 0.8125rem; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; backdrop-filter: blur(4px); transition: background-color 160ms var(--ease), transform 160ms var(--ease-out); }
.tile__like svg, .tile__comments svg { flex: none; }
.tile__like:hover, .tile__comments:hover { background: rgb(0 0 0 / 0.72); }
.tile__like:focus-visible, .tile__comments:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.tile__like.is-liked { color: #fff; background: rgb(214 41 70 / 0.85); }
.tile__like.is-liked svg { fill: currentColor; }
.tile__like.is-pop { transform: scale(1.18); }
.tile__like--static { cursor: default; }
.tile__like [data-tile-like-count]:empty, .tile__comments [data-tile-comments-count]:empty { display: none; }
.tile__like:has([data-tile-like-count]:empty), .tile__comments:has([data-tile-comments-count]:empty) { padding-right: 7px; }
/* Herz und Sprechblase stehen immer da – leer heisst «noch keins», ein Klick auf das Herz liked, die Blase führt zu den Kommentaren */
.is-selecting .tile__bar { display: none; }
/* Schmale Kacheln (Hochkant-Videos): Dauer nach oben rechts, Leiste etwas kleiner – nichts überlappt */
.tile-wrap { container-type: inline-size; }
@container (max-width: 200px) {
    .tile__play { bottom: auto; top: 8px; }
    .tile__like, .tile__comments { min-height: 24px; padding: 1px 6px 1px 5px; font-size: 0.75rem; }
    .tile__like svg, .tile__comments svg { width: 14px; height: 14px; }
}
/* Videos: Abspielzeichen in der Mitte und Dauer unten rechts, damit sie im Raster sofort auffallen */
.tile--video::before { content: ''; position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgb(0 0 0 / 0.5); box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85); backdrop-filter: blur(4px); pointer-events: none; transition: background-color 200ms var(--ease), transform 200ms var(--ease); }
.tile--video::after { content: ''; position: absolute; left: 50%; top: 50%; margin: -9px 0 0 -5px; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; pointer-events: none; }
.tile--video:hover::before, .tile--video:focus-visible::before { background: rgb(228 138 136 / 0.85); transform: scale(1.08); }
.map-pin--video::after { content: ''; position: absolute; left: 50%; top: 50%; margin: -7px 0 0 -4px; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #fff; filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.8)); pointer-events: none; }
.tile__play { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 2px; padding: 2px 9px 2px 5px; border-radius: var(--radius-pill); background: rgb(0 0 0 / 0.6); color: #fff; font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; backdrop-filter: blur(4px); }
.gallery--strip .tile--video::before { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
.gallery--strip .tile--video::after { margin: -7px 0 0 -4px; border-width: 7px 0 7px 12px; }
.tile--pending { display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--s-3); font-size: var(--text-s); color: var(--ink-muted); background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--paper) 10px 20px); }
.tile__select { position: absolute; top: 6px; right: 6px; z-index: 2; display: none; width: var(--touch); height: var(--touch); align-items: center; justify-content: center; cursor: pointer; }
.tile__select input { width: 24px; height: 24px; accent-color: var(--accent); margin: 0; box-shadow: 0 0 0 2px #fff; border-radius: 6px; }
.is-selecting .tile__select { display: flex; }
.is-selecting .tile-wrap:has(input:checked) { box-shadow: 0 0 0 4px var(--accent); }
.is-selecting .tile-wrap:has(input:checked) img { opacity: 0.8; }
.more { display: flex; justify-content: center; margin-top: var(--s-5); max-width: none; }
.gallery-status { text-align: center; color: var(--ink-muted); font-size: var(--text-s); min-height: 1.5em; max-width: none; }

/* Schwebende Leisten (Auswahl, Hochladen bestätigen): Glas über dem Inhalt */
.selectbar, .upload-confirm {
    position: sticky;
    bottom: calc(72px + var(--s-3));
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-lift);
}
.selectbar { margin-top: var(--s-5); }
.selectbar[hidden], .upload-confirm[hidden] { display: none; }
.selectbar__count { font-weight: 600; margin-right: auto; }
@media (max-width: 759px) {
    /* Handy: Auswahlleiste fest über der Tableiste, grosse Knöpfe */
    .selectbar { position: fixed; left: var(--s-3); right: var(--s-3); bottom: calc(72px + env(safe-area-inset-bottom)); margin: 0; padding: var(--s-3); gap: var(--s-2); }
    .selectbar__count { flex: 1 1 auto; font-size: var(--text-s); }
    .selectbar .muted { display: none; }
    .selectbar .select { flex: 1 1 100%; min-height: 44px; }
    .selectbar .btn { flex: 1 1 calc(50% - var(--s-2)); min-height: 44px; justify-content: center; }
    .is-selecting .gallery { padding-bottom: 12rem; }
}
.upload-confirm { justify-content: space-between; border-left: 4px solid var(--accent); }
.upload-confirm p { font-weight: 600; }
@media (max-width: 599px) {
    .selectbar { gap: var(--s-2); }
    .selectbar .btn { min-height: 40px; padding: 0 var(--s-3); font-size: var(--text-s); }
    .upload-confirm { padding: var(--s-3); gap: var(--s-2); }
    .upload-confirm .actions { width: 100%; }
    .upload-confirm [data-start] { flex: 1; }
    .upload-confirm [data-dup-skip], .upload-confirm [data-dup-keep] { flex: 1 1 100%; }
}
@media (min-width: 760px) { .selectbar, .upload-confirm { bottom: var(--s-4); } }

/* ---------- Fotoseite ---------- */
.photo-page { display: grid; gap: var(--s-5); }
.photo-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-inline: calc(var(--s-3) * -1); }
.photo-nav__steps { display: flex; align-items: center; gap: var(--s-1); }

.photo-stage { position: relative; margin: 0 calc(var(--s-4) * -1); background: var(--tile-color, #0d0f0f); display: flex; justify-content: center; }
/* Schliessen: x im Kreis in der oberen rechten Ecke des Bildes – zurück zur Kachel im Album (Esc ebenso) */
.photo-stage__close { position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: rgb(0 0 0 / 0.55); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.35); backdrop-filter: blur(4px); text-decoration: none; transition: background-color 140ms var(--ease), transform 140ms var(--ease-out); }
.photo-stage__close:hover { background: rgb(0 0 0 / 0.8); transform: scale(1.06); }
.photo-stage__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 759px) { .photo-stage__close { top: 8px; right: 8px; width: 36px; height: 36px; } }
.photo-stage picture { display: contents; }
.photo-stage img { width: auto; max-width: 100%; max-height: min(82vh, 1600px); height: auto; object-fit: contain; }
.photo-stage__video { display: block; width: 100%; max-width: 100%; height: auto; max-height: min(82vh, 1600px); background: #000; }
.pswp__video-wrap { position: relative; display: flex; align-items: center; justify-content: center; background: #000; }
.pswp__video-wrap video, .pswp__video-poster { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* Standbild: Gesten gehen an PhotoSwipe (Wischen), nicht an das Bild */
.pswp__video-poster { pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.pswp__video-play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 76px; height: 76px; border: 0; border-radius: 50%; padding: 0;
    display: grid; place-items: center; cursor: pointer;
    background: rgba(17, 19, 18, .62); color: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .45);
    -webkit-tap-highlight-color: transparent;
}
.pswp__video-play svg { width: 34px; height: 34px; margin-left: 4px; }
.pswp__video-play:hover, .pswp__video-play:focus-visible { background: var(--accent); color: #17140f; }
.pswp__video-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.photo-stage__pending { min-height: 40vh; display: grid; place-items: center; padding: var(--s-6); color: #e7eae6; }
@media (min-width: 760px) { .photo-stage { margin: 0; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow); } }
.photo-info { display: grid; gap: var(--s-5); }
@media (min-width: 900px) and (max-width: 1099px) { .photo-info { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } .photo-info__actions { max-width: 24rem; } }
/* Fotoseite: ab 1100 px Bühne links, Seitenleiste mit Angaben, «Gefällt», Aktionen und Kommentaren rechts */
.photo-layout { display: grid; gap: var(--s-5); align-items: start; }
@media (min-width: 1100px) {
    .photo-layout { grid-template-columns: minmax(0, 1fr) clamp(20rem, 28vw, 27rem); gap: var(--s-6); }
    .photo-layout .photo-stage { position: sticky; top: calc(var(--topbar-h) + var(--s-4)); margin: 0; }
    .photo-layout .photo-stage img, .photo-layout .photo-stage__video { max-height: calc(100vh - var(--topbar-h) - 2 * var(--s-5)); }
    .photo-side { min-width: 0; }
    .photo-side .comments { margin-top: var(--s-6); }
}
.photo-side { display: grid; gap: var(--s-5); min-width: 0; }
.photo-side .comments { max-width: none; }
/* Wer hat geliked */
.likers { font-size: var(--text-s); }
.likers--empty { margin: 0; }
.likers__summary { list-style: none; display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; min-height: var(--touch); border-radius: var(--radius); padding-right: var(--s-2); }
.likers__summary::-webkit-details-marker { display: none; }
.likers__summary:hover .likers__text, .likers__summary:focus-visible .likers__text { text-decoration: underline; }
.likers__summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.likers__text { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--ink-muted); }
.likers__text svg { color: #d62946; fill: currentColor; }
.likers__list { list-style: none; margin: var(--s-2) 0 0; padding: var(--s-2) var(--s-3); display: grid; gap: var(--s-2); max-height: 16rem; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.likers__list li { display: flex; align-items: center; gap: var(--s-3); }
.photo-info__main { display: grid; gap: var(--s-4); }
.photo-info__title { font-size: var(--text-xl); font-weight: 300; overflow-wrap: anywhere; }
.photo-info__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-start; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-1) var(--s-5); margin: 0; }
.facts > div { display: contents; }
.facts dt { color: var(--ink-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.like svg { transition: transform 160ms var(--ease); }
.like.is-liked svg { fill: var(--danger); color: var(--danger); }
.like:active svg { transform: scale(0.88); }
.like__count:empty { display: none; }
.like__count { font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.muted.small svg { display: inline; vertical-align: -3px; }

/* ---------- Rechte ---------- */
.table--rights th, .table--rights td { padding: var(--s-2) var(--s-3); }
.table--rights td { text-align: center; }
.table--rights thead th { text-align: center; white-space: nowrap; }
.table--rights thead th:first-child, .table--rights tbody th { text-align: left; }
.table--rights input.check { width: 24px; height: 24px; min-height: 0; accent-color: var(--accent); margin: 0; display: inline-block; }
.table--rights tbody th { color: var(--ink); font-size: var(--text-m); font-weight: 600; }
.who { display: inline-flex; align-items: center; gap: var(--s-2); }
.who svg { color: var(--ink-muted); flex: none; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--s-2) var(--s-5); margin: var(--s-4) 0; font-size: var(--text-s); }
.legend dt { font-weight: 600; }
.legend dd { margin: 0; color: var(--ink-muted); }
.disclosure > summary { cursor: pointer; display: flex; align-items: center; gap: var(--s-2); min-height: var(--touch); }
.disclosure > summary h2 { display: inline; }
.people { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.people li { display: grid; gap: 2px; padding: var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.people__name { font-weight: 600; }

/* ---------- Hochladen ---------- */
.uploader { display: grid; gap: var(--s-5); }
.dropzone { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-7) var(--s-4); border: 2px dashed var(--field-border); border-radius: var(--radius-l); background: var(--surface); text-align: center; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.dropzone > svg { color: var(--cloth); }
.dropzone.is-over { border-color: var(--accent); background: var(--cloth-tint); }
.dropzone__title { font-size: var(--text-l); font-weight: 600; }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-pill); }
.file-btn--camera { display: none; }
@media (pointer: coarse) { .file-btn--camera { display: inline-flex; } }
.upload-summary { display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: calc(var(--topbar-h) + var(--s-2)); z-index: 5; }
.upload-summary[hidden] { display: none; }
.upload-summary p { font-weight: 600; margin: 0; }
.upload-summary__head { display: flex; align-items: center; gap: var(--s-3); }
.upload-summary__head p { flex: 1; }
.upload-summary__icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 700; font-size: 18px; background: var(--accent-tint, var(--cloth-tint)); color: var(--accent); }
.upload-summary.is-done { border-left-color: var(--ok); }
.upload-summary.is-done .upload-summary__icon { background: var(--ok-tint); color: var(--ok); }
.upload-summary.is-failed { border-left-color: var(--danger); }
.upload-summary.is-failed .upload-summary__icon { background: var(--danger-tint, var(--cloth-tint)); color: var(--danger); }
.upload-summary__pct { font-size: 1.35rem; font-variant-numeric: tabular-nums; flex: none; }
.upload-summary__bar { width: 100%; height: 10px; accent-color: var(--accent); }
.upload-summary.is-done .upload-summary__bar { accent-color: var(--ok); }
.upload-summary.is-done .upload-summary__bar, .upload-summary.is-failed .upload-summary__bar { height: 6px; }
.upload-summary__hint { margin: 0; }
.upload-summary__hint[hidden] { display: none; }
.upload-summary .actions { margin: 0; }
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.upload-list:empty { display: none; }
.upload-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; grid-template-areas: "thumb name state action" "thumb size state action" "bar bar bar bar" "ask ask ask ask"; gap: 0 var(--s-3); align-items: center; padding: var(--s-2) var(--s-3) var(--s-2) var(--s-2); border-bottom: 1px solid var(--line); }
.upload-item:last-child { border-bottom: 0; }
.upload-item__thumb { grid-area: thumb; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--cloth-tint); color: var(--cloth); }
.upload-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-item__name { grid-area: name; align-self: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.upload-item__size { grid-area: size; align-self: start; font-size: var(--text-s); }
.upload-item__state { grid-area: state; font-size: var(--text-s); color: var(--ink-muted); text-align: right; }
.upload-item [data-remove], .upload-item [data-retry] { grid-area: action; }
.upload-item [hidden] { display: none; }
.upload-item__bar { grid-area: bar; margin-top: var(--s-2); width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; background: var(--line); overflow: hidden; accent-color: var(--accent); }
.upload-item__bar::-webkit-progress-bar { background: var(--line); }
.upload-item__bar::-webkit-progress-value { background: var(--accent); }
.upload-item__bar::-moz-progress-bar { background: var(--accent); }
.upload-item.is-done .upload-item__state { color: var(--ok); font-weight: 600; }
.upload-item.is-done .upload-item__bar::-webkit-progress-value { background: var(--ok); }
.upload-item.is-done .upload-item__bar::-moz-progress-bar { background: var(--ok); }
.upload-item.is-error .upload-item__state { color: var(--danger); font-weight: 600; }
.upload-item [data-retry] { grid-column: 1 / -1; justify-self: start; }
/* Mögliche Doppelte: die ganze Zeile bernsteinfarben, Rückfrage mit zwei Knöpfen direkt darunter */
.upload-item.is-duplicate { background: var(--cloth-tint); box-shadow: inset 4px 0 0 var(--accent); }
.upload-item.is-duplicate .upload-item__state { color: var(--cloth); font-weight: 600; }
.upload-item__ask { grid-area: ask; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-2); padding-top: var(--s-2); border-top: 1px dashed var(--field-border); color: var(--ink); }
.upload-item__ask > svg { flex: none; color: var(--cloth); }
.upload-item__ask-text { flex: 1 1 18rem; min-width: 0; line-height: 1.45; }
.upload-item__ask-actions { display: flex; gap: var(--s-2); flex: none; }
.upload-item__ask[hidden] { display: none; }
.upload-confirm.has-dups { border-left-color: var(--cloth); }
.upload-confirm__dups { display: flex; align-items: flex-start; gap: var(--s-2); margin: 0; flex-basis: 100%; color: var(--cloth); font-weight: 600; }
.upload-confirm__dups svg { flex: none; margin-top: 2px; }
.upload-confirm__dups[hidden] { display: none; }
.upload-option { margin: var(--s-4) 0 0; }

/* ---------- Verwaltung → Einstellungen: vom Super-Admin zugeteilt (nur lesend) ---------- */
.assigned { border-left: 4px solid var(--cloth); margin-bottom: var(--s-5); }
.assigned .panel__title { display: flex; align-items: center; gap: var(--s-2); }
.assigned__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: var(--s-2) var(--s-4); margin: var(--s-3) 0 0; }
.assigned__list > div { display: grid; gap: 2px; padding: var(--s-2) 0; border-top: 1px solid var(--line); }
.assigned__list dt { font-size: var(--text-s); color: var(--ink-muted); }
.assigned__list dd { margin: 0; font-weight: 600; }
.panel__title:has(> svg) { display: flex; align-items: center; gap: var(--s-2); }
.panel__title > svg { flex: none; color: var(--cloth); }
.table tr.is-muted { opacity: .6; }

/* ---------- Papierkorb ---------- */
.trash-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--s-4); }
.trash-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; display: grid; box-shadow: var(--shadow); }
.trash-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--line); }
.trash-card__body { display: grid; gap: var(--s-2); padding: var(--s-3); }
.trash-card__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Lightbox (PhotoSwipe) ---------- */
.pswp { --pswp-bg: #0d0f0f; --pswp-placeholder-bg: #1e2122; font-family: var(--font-ui); }
/* Eigene Knöpfe in der Leiste: Herz, Sprechblase, Details, Herunterladen – alle gleich gross und weiss */
.pswp__button--like, .pswp__button--comments, .pswp__button--details, .pswp__button--download { width: auto !important; min-width: 50px; padding: 0 12px !important; display: inline-flex !important; align-items: center; justify-content: center; gap: 6px; color: #fff; font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none; }
.pswp__button--like svg, .pswp__button--comments svg, .pswp__button--details svg, .pswp__button--download svg { width: 24px; height: 24px; flex: none; }
.pswp__button--like.is-liked svg { fill: #ff9a8f; color: #ff9a8f; }
.pswp__button--download[hidden], .pswp__button--like[hidden], .pswp__button--comments[hidden] { display: none !important; }
/* Beschriftung unten im Bild und Leiste rechts (Beschriftung, Kommentare) – 6.7 */
.pswp-caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgb(0 0 0 / 0.65), rgb(0 0 0 / 0)); color: #fff; font-size: 15px; text-align: center; pointer-events: none; text-shadow: 0 1px 2px rgb(0 0 0 / 0.6); }
.pswp-caption[hidden] { display: none; }
.pswp-panel { position: absolute; top: 60px; right: 0; bottom: 0; z-index: 7; width: min(24rem, 100%); overflow: auto; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); background: rgb(18 20 20 / 0.94); color: #fff; backdrop-filter: blur(10px); border-left: 1px solid rgb(255 255 255 / 0.12); font-size: 15px; line-height: 1.45; }
.pswp-panel[hidden] { display: none; }
.pswp--panel .pswp-caption { display: none; } /* steht dann in der Leiste */
.pswp-panel__close { position: absolute; top: 6px; right: 10px; width: 40px; height: 40px; border: 0; background: none; color: #fff; font-size: 26px; cursor: pointer; border-radius: 50%; }
.pswp-panel__close:hover { background: rgb(255 255 255 / 0.12); }
.pswp-panel__title { margin: 0 44px 2px 0; font-size: 18px; font-weight: 600; }
.pswp-panel__meta { margin: 0 0 12px; color: rgb(255 255 255 / 0.7); font-size: 13px; }
.pswp-panel__h { margin: 16px 0 8px; font-size: 13px; font-weight: 600; text-transform: none; color: rgb(255 255 255 / 0.7); }
.pswp-panel__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pswp-panel__list li { padding: 8px 10px; background: rgb(255 255 255 / 0.07); border-radius: 10px; overflow-wrap: anywhere; }
.pswp-panel__ago { color: rgb(255 255 255 / 0.55); font-size: 12px; }
.pswp-panel__empty { color: rgb(255 255 255 / 0.6); margin: 0; }
.pswp-panel__form { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; flex-wrap: wrap; }
.pswp-panel__input { flex: 1 1 10rem; min-width: 0; padding: 8px 10px; border: 1px solid rgb(255 255 255 / 0.25); border-radius: 8px; background: rgb(0 0 0 / 0.35); color: #fff; font: inherit; font-size: 15px; }
.pswp-panel__input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pswp-panel__form button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--accent); color: #1a1200; font: inherit; font-weight: 600; cursor: pointer; }
.pswp-panel__form button[disabled] { opacity: .6; }
.pswp-panel__error { flex-basis: 100%; margin: 0; color: #ff9a8f; font-size: 13px; }
.pswp-panel__link { display: inline-block; margin-top: 16px; color: var(--accent); text-decoration: none; font-weight: 600; }
.pswp-panel__link:hover { text-decoration: underline; }
@media (max-width: 759px) {
    .pswp-panel { top: auto; left: 0; width: 100%; max-height: 60dvh; border-left: 0; border-top: 1px solid rgb(255 255 255 / 0.12); border-radius: 16px 16px 0 0; }
    .pswp--panel .pswp-caption { display: none; }
}
.pswp__counter { font-variant-numeric: tabular-nums; }
.pswp__button:focus-visible { outline: 3px solid #f3b3a9; outline-offset: -3px; }

/* Startseite: «Zuletzt hinzugefügt» auf dem Telefon auf zwei Reihen begrenzen */
@media (max-width: 699px) { .gallery--strip .tile-wrap:nth-child(n+7) { display: none; } }

/* ---------- «Neu»: zuletzt hinzugefügte Fotos als runde Bilder mit Ring (über dem Titel der Albumübersicht) ---------- */
.fresh { margin: calc(var(--s-2) * -1) 0 var(--s-5); }
.fresh__title { display: flex; align-items: baseline; gap: var(--s-2); margin: 0 0 var(--s-2); font-size: var(--text-s); font-weight: 600; letter-spacing: 0.01em; color: var(--ink); }
.fresh__count { display: inline-block; padding: 0 7px; border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); font-size: 0.75rem; font-weight: 700; line-height: 1.5; }
.fresh__sub { font-weight: 400; color: var(--ink-muted); }
.gallery--fresh {
    --ring: 76px;
    display: flex;
    flex-wrap: nowrap;
    gap: var(--s-3);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--s-4);
    padding: 10px var(--s-4) var(--s-2); /* oben Platz für Ring und Vergrösserung beim Darüberfahren – overflow-x schneidet sonst oben ab */
    margin-inline: calc(var(--s-4) * -1);
    scrollbar-width: none;
}
.gallery--fresh::-webkit-scrollbar { display: none; }
.gallery--fresh .tile-wrap { flex: none; width: calc(var(--ring) + 12px); aspect-ratio: auto; overflow: visible; background: none; box-shadow: none; border-radius: 0; scroll-snap-align: start; display: grid; justify-items: center; gap: 6px; }
.gallery--fresh .tile { position: relative; display: block; width: var(--ring); height: var(--ring); border-radius: 50%; overflow: hidden; background: var(--tile-color, var(--surface)); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent); transition: box-shadow 160ms var(--ease), transform 160ms var(--ease-out); }
.gallery--fresh .tile img { width: 100%; height: 100%; object-fit: cover; }
.gallery--fresh .tile--video::before { width: 28px; height: 28px; margin: -14px 0 0 -14px; box-shadow: 0 0 0 1.5px rgb(255 255 255 / 0.85); }
.gallery--fresh .tile--video::after { margin: -5px 0 0 -3px; border-width: 5px 0 5px 9px; }
.fresh__label { max-width: 100%; font-size: 0.75rem; line-height: 1.2; color: var(--ink-muted); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
@media (hover: hover) {
    .gallery--fresh .tile-wrap:has(.tile:hover) { transform: none; box-shadow: none; }
    .gallery--fresh .tile:hover { transform: scale(1.05); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent-strong, #f5b041); }
    .gallery--fresh .tile:hover img { transform: none; }
}
.gallery--fresh .tile-wrap:has(.tile:focus-visible) { box-shadow: none; }
.gallery--fresh .tile:focus-visible { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus); }
@media (max-width: 699px) { .gallery--fresh { --ring: 64px; gap: var(--s-2); padding-inline: var(--s-3); } }
@media (min-width: 1200px) { .gallery--fresh { --ring: 88px; } }

/* ---------- Konto, Zwei-Faktor, Freigabe, E-Mail, Protokoll ---------- */
.form--wide { max-width: 42rem; }
.field--short { max-width: 22rem; }
.field-row { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.field-row > .field { flex: 1 1 12rem; }
.field-group { display: grid; gap: var(--s-5); padding-left: var(--s-4); border-left: 3px solid var(--cloth-tint); }
.field-group[hidden] { display: none; }
.choice input[type="checkbox"] { grid-row: span 2; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--accent); }

.steps { margin: 0; padding-left: 1.4em; display: grid; gap: var(--s-4); }
.steps li::marker { font-weight: 700; color: var(--cloth); }
.qr-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); margin-top: var(--s-3); }
.qr { width: 200px; height: 200px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.secret code { font-size: var(--text-m); letter-spacing: 0.06em; word-break: break-all; }
.backup-codes { list-style: none; margin: 0 0 var(--s-5); padding: var(--s-4); display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--s-2) var(--s-5);
    background: var(--surface); border: 1px dashed var(--field-border); border-radius: var(--radius-l); max-width: 36rem; counter-reset: code; }
.backup-codes code { font-size: var(--text-m); letter-spacing: 0.05em; background: none; }

.share__url code { display: block; padding: var(--s-2) var(--s-3); word-break: break-all; font-size: var(--text-s); }
.notice > div { display: grid; gap: var(--s-2); min-width: 0; }
.notice > div > .btn { justify-self: start; }

.page--public { max-width: 64rem; }
.photo-stage--public { margin: 0; border-radius: var(--radius-l); overflow: hidden; }
.public-note { margin-top: var(--s-4); }
.narrow { max-width: 30rem; display: grid; gap: var(--s-4); }

/* ---------- Darstellung: hell / dunkel / automatisch ---------- */

.theme-switch { display: grid; gap: var(--s-2); margin: 0; }
.theme-switch__label { font-size: var(--text-s); color: var(--ink-muted); }
.theme-switch__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    max-width: 22rem;
}
.theme-switch__option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--touch);
    padding: var(--s-1) 2px;
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: var(--text-s);
    line-height: 1.2;
    cursor: pointer;
}
.theme-switch__option svg { color: var(--ink-muted); }
.theme-switch__option:hover { background: var(--cloth-tint); }
.theme-switch__option[aria-pressed='true'] { background: var(--accent); color: var(--on-accent); }
.theme-switch__option[aria-pressed='true'] svg { color: currentColor; }
.theme-switch__option:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; position: relative; z-index: 1; }

.menu__theme { padding: var(--s-2) var(--s-3) var(--s-3); border-bottom: 1px solid var(--line); margin-bottom: var(--s-2); }
.menu__theme .theme-switch__options { max-width: none; }
.menu__theme .theme-switch__option { font-size: 0.8125rem; padding: var(--s-1) 2px; }

.page-foot {
    display: flex;
    justify-content: center;
    padding: var(--s-5) var(--s-4) calc(var(--s-6) + env(safe-area-inset-bottom));
}
.page-foot .theme-switch { width: min(100%, 20rem); }
.page-foot .theme-switch__label { text-align: center; }

/* Honigtopf gegen Formular-Programme: für Menschen unsichtbar, auch für Screenreader */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.check--top { align-items: flex-start; }
.check--top input { margin-top: 2px; flex: none; }

/* ---------- Anfragen auf Zugang, Beitrittslinks ---------- */

.section-title { font-size: var(--text-l); margin: var(--s-6) 0 var(--s-3); }
.admin section + section, .admin section + .panel, .admin .actions + .panel, .admin .join-sheet + .actions + .panel { margin-top: var(--s-6); }
.count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.5em; height: 1.5em; padding: 0 0.45em; margin-left: var(--s-1);
    border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent);
    font-size: 0.75rem; font-weight: 600; line-height: 1;
}

.requests { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
.request {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-4);
    padding: var(--s-4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-l);
}
.request__name { font-size: var(--text-l); margin: 0; }
.request__who p { margin: var(--s-1) 0 0; overflow-wrap: anywhere; }
.request__message {
    margin: var(--s-3) 0 0;
    padding: var(--s-2) var(--s-3);
    border-left: 2px solid var(--line);
    font-style: italic;
    overflow-wrap: anywhere;
}
.request__actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); }
.request__approve { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); }
.request__approve .field { margin: 0; min-width: 9rem; }
.request__approve .choice-list { min-width: 12rem; }
@media (min-width: 900px) {
    .request { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
    .request__actions { justify-content: flex-end; max-width: 28rem; }
}

/* Druckbares Blatt mit QR-Code: immer hell, damit es auf Papier stimmt */
.join-sheet {
    display: grid;
    gap: var(--s-5);
    padding: var(--s-5);
    background: #ffffff;
    color: #1b1d1e;
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    margin-bottom: var(--s-5);
}
.join-sheet__qr .qr { width: min(100%, 15rem); height: auto; display: block; }
.join-sheet__text h2 { font-size: var(--text-xl); margin: 0 0 var(--s-3); }
.join-sheet__text .muted { color: #5c6260; }
.join-sheet__url { font-weight: 600; overflow-wrap: anywhere; color: #a15b00; }
@media (min-width: 700px) { .join-sheet { grid-template-columns: auto 1fr; align-items: center; } }

/* ---------- Kommentare und Meldungen ---------- */

.comments { max-width: var(--measure); margin-top: var(--s-7); }
.comments__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.comments__title { font-size: var(--text-xl); font-weight: 300; margin: 0; }
.comments__title .muted { font-size: var(--text-m); font-weight: 400; }
.comments__list { list-style: none; padding: 0; margin: 0 0 var(--s-5); display: grid; gap: var(--s-4); }
.comment { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s-3); padding: var(--s-1) 0; scroll-margin-top: calc(var(--topbar-h) + var(--s-6)); }
.comment__avatar { grid-row: 1 / span 3; margin-top: 2px; }
.comment__meta, .comment__body, .comment__actions { grid-column: 2; }
.comment:target .comment__body { background: var(--accent-tint, rgb(228 138 136 / 0.14)); border-radius: var(--radius); padding: var(--s-1) var(--s-2); margin-left: calc(var(--s-2) * -1); }
.comment--hidden .comment__avatar { opacity: 0.5; }
.comment--hidden .comment__body { color: var(--ink-muted); }
.comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); margin: 0; font-size: var(--text-s); }
.comment__meta time { color: var(--ink-muted); }
.comment__author { font-size: var(--text-m); }
.comment__body { margin: var(--s-1) 0 0; line-height: 1.55; overflow-wrap: anywhere; white-space: normal; }
.comment__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); margin-top: var(--s-1); margin-left: calc(var(--s-3) * -1); }
.comment__actions .confirm[open] { flex-basis: 100%; }
.comment__actions .confirm > summary.btn { min-height: 36px; padding: 0 var(--s-3); font-size: var(--text-s); border: 0; background: none; }
.comment-form { display: grid; gap: var(--s-3); }

.disclosure > summary { list-style: none; cursor: pointer; display: inline-flex; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] > summary { background: var(--cloth-tint); }
.disclosure__panel {
    margin-top: var(--s-2);
    padding: var(--s-4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    width: min(32rem, calc(100vw - 2 * var(--s-4)));
}
.comment__actions .disclosure[open] { flex-basis: 100%; }
.photo-info__actions .disclosure[open] { flex-basis: 100%; }
.photo-info__actions .disclosure__panel { width: 100%; }

.report__main { display: flex; gap: var(--s-4); align-items: flex-start; min-width: 0; }
.report__thumb { flex: none; }
.report__thumb img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.report__reasons { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; gap: var(--s-2); }
.report__reasons .block { display: block; overflow-wrap: anywhere; }
@media (max-width: 480px) { .report__main { flex-direction: column; } }

/* ---------- Downloads, Gastlinks, Fehler melden ---------- */

.notice + .panel, .notice + section { margin-top: var(--s-5); }
.download-progress progress { width: 100%; height: 12px; accent-color: var(--accent); }
.download-parts { list-style: none; padding: 0; margin: var(--s-4) 0 0; display: grid; gap: var(--s-3); }
.download-parts li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.tabs { display: flex; gap: var(--s-1); margin-bottom: var(--s-5); border-bottom: 1px solid var(--line); padding-bottom: var(--s-2); }
.tabs--settings, .tabs--account { flex-wrap: wrap; }
.tabs--account .navlink { gap: var(--s-2); }
.tabs__count { font-size: var(--text-xs); background: var(--cloth-tint); color: var(--cloth); border-radius: 999px; padding: 0 6px; margin-left: 2px; }
.tabpanel { display: grid; gap: var(--s-5); }
.tabpanel[hidden] { display: none; }
.tabs--settings .navlink { gap: var(--s-2); }
details.assigned > summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); list-style: none; cursor: pointer; min-height: var(--touch); }
details.assigned > summary::-webkit-details-marker { display: none; }
details.assigned > summary .panel__title { margin: 0; }
details.assigned > summary::after { content: ''; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(45deg); transition: transform .15s; }
details.assigned[open] > summary::after { transform: rotate(-135deg); }
details.assigned > summary + p { margin-top: var(--s-3); }
.mail-status { margin-bottom: var(--s-5); }
.mail-preset { max-width: 30rem; }
.notice + .stats { margin-top: var(--s-4); }
.mail-help { max-width: var(--measure); padding: var(--s-3) var(--s-4); border-radius: var(--radius); background: var(--cloth-tint); }
.mail-help[hidden] { display: none; }
.mail-help > * { margin: 0; }
.mail-help > * + * { margin-top: var(--s-2); }
.mail-help ol { padding-left: 1.4em; display: grid; gap: var(--s-1); }
.mail-help code { word-break: break-all; }
.mail-test { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); }
.mail-test > .field { flex: 1 1 18rem; max-width: 26rem; }
.panel.share { margin-top: var(--s-6); }

.bug-dialog {
    width: min(36rem, calc(100vw - 2 * var(--s-4)));
    max-height: calc(100dvh - 2 * var(--s-4));
    padding: var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    background: var(--surface-2);
    color: var(--ink);
    box-shadow: var(--shadow-lift);
}
.bug-dialog::backdrop { background: rgb(0 0 0 / 0.55); backdrop-filter: blur(3px); }
/* Allgemeines Fenster über der Seite (z. B. «Neue Gruppe»): Karte in der Mitte, Hintergrund abgedunkelt und unscharf */
.modal {
    position: fixed; inset: 0; margin: auto;
    width: min(32rem, calc(100vw - 2 * var(--s-4))); max-height: calc(100dvh - 2 * var(--s-4));
    padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--radius-l);
    background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow-lift);
}
.modal:not([open]) { display: none; }
.modal::backdrop { background: rgb(0 0 0 / 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal__close { position: absolute; top: var(--s-2); right: var(--s-2); }
.modal__title { font-size: var(--text-xl); margin: 0 var(--s-7) var(--s-4) 0; }
/* Karten (Gruppen-Übersicht) */
.cards { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; gap: var(--s-3); }
.cards--groups { grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); }
.card__link { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-4); color: inherit; text-decoration: none; border-radius: inherit; }
.card__link:hover { background: var(--cloth-tint); }
.card__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--cloth-tint); color: var(--cloth); }
.card__body { display: grid; gap: 2px; min-width: 0; }
.card__title { font-size: var(--text-m); font-weight: 600; }
.card__text { font-size: var(--text-s); }
.card__meta { font-size: var(--text-s); color: var(--ink-muted); }
.card__chevron { color: var(--ink-muted); }
.bug-dialog__close { position: absolute; top: var(--s-2); right: var(--s-2); }
.bug-dialog__title { font-size: var(--text-xl); margin: 0 var(--s-7) var(--s-3) 0; }
.bug-dialog [data-bug-form-area] { display: grid; gap: var(--s-4); }
.bug-dialog [data-bug-form-area][hidden] { display: none; }
.bug-dialog__shot { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); min-height: 4rem; display: grid; place-items: center; overflow: hidden; }
.bug-dialog__shot img { display: block; width: 100%; height: auto; max-height: 40vh; object-fit: contain; object-position: top; }
.bug-dialog__shot p { margin: var(--s-3); }
.shot-cover { display: inline-flex; align-items: center; justify-content: center; background: #8a918d; color: #fff; font: 600 12px/1 var(--font-ui); }
.bug__text { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.bug__shot { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }

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

.map-header { margin-bottom: var(--s-4); }
.map-link { display: flex; align-items: center; gap: var(--s-1); min-height: 24px; width: fit-content; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.map {
    height: min(70vh, 640px);
    min-height: 320px;
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    background: var(--surface);
    z-index: 0;
    overflow: hidden;
}
.map:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.map__noscript { padding: var(--s-5); }
.map-pin { background: none; border: 0; }
.leaflet-container .leaflet-marker-pane .map-pin img {
    display: block; width: 48px; height: 48px; object-fit: cover;
    max-width: none !important; border: 2px solid #fff; border-radius: 10px; box-shadow: 0 2px 8px rgb(0 0 0 / 0.45); background: #8a918d;
}
.leaflet-container .leaflet-marker-pane .map-pin--group img { box-shadow: 3px 3px 0 -1px #fff, 3px 3px 0 1px rgb(0 0 0 / 0.25), 0 2px 8px rgb(0 0 0 / 0.45); }
.map-pin__n {
    position: absolute; right: -6px; top: -8px; min-width: 22px; height: 22px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: #e48a88; color: #1d1114; font: 600 12px/1 var(--font-ui);
}
.leaflet-marker-icon:focus-visible img { outline: 3px solid #f3b3a9; outline-offset: 2px; }
.leaflet-container { font-family: var(--font-ui); }
.leaflet-container a { color: #a15b00; }
.leaflet-control-attribution { font-size: 11px; }
.map-places__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.map-places__list a {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-3); align-items: baseline;
    padding: var(--s-2) var(--s-3); border-radius: var(--radius); color: var(--ink); text-decoration: none; min-height: var(--touch);
}
.map-places__list a:hover { background: var(--cloth-tint); }
.map-places__list .muted { grid-column: 1; }
.map-places__n { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
@media (min-width: 1000px) {
    .map-layout { grid-template-columns: minmax(0, 1fr) 16rem; align-items: start; }
    .map { height: min(78vh, 760px); }
    .map-places { max-height: min(78vh, 760px); overflow: auto; }
    .map-places .section-title { margin-top: 0; }
}

/* Zielgrösse mindestens 24 px auch für einzeln stehende Textlinks (WCAG 2.5.8) */
.auth-foot a, p.small a, .page-header__back, .table a, .trail a { display: inline-flex; align-items: center; min-height: 24px; }

@media (max-width: 599px) {
    .topbar__tenant { display: none; } /* der Abschnitt steht in der Unterzeile bzw. in der Tableiste */
}

@media print {
    .no-print, .sidenav, .page-foot, .notice, .topbar, .tabbar, .page-header__back, .actions, .skip-link { display: none !important; }
    .join-sheet { border: 0; padding: 0; }
    .join-sheet__qr .qr { width: 7cm; }
    .backup-codes { border: 1px solid #000; }
}

@media (forced-colors: active) {
    .btn, .input, .select, .tile-wrap, .book__cover { border: 1px solid ButtonText; }
    .topbar .navlink[aria-current='page']::after { background: Highlight; }
}

/* ---------- Diashow ----------
 * Zwei Ebenen (.show__layer) wechseln sich ab; data-transition am Wurzelelement wählt den Übergang.
 * Immer dunkel, unabhängig von der gewählten Darstellung: eine Bühne für Fotos.
 */
.slideshow-body {
    color-scheme: dark;
    --paper: #0d0e1c; --surface: #1b1e3a; --surface-2: #242850; --ink: #f4f1f2; --ink-muted: #b0b3c8;
    --line: rgb(255 255 255 / 0.1); --field-border: rgb(255 255 255 / 0.45); --cloth: #f3b3a9; --cloth-deep: #d9776d;
    --cloth-tint: rgb(228 138 136 / 0.16); --focus: #f3b3a9; --on-cloth: #1d1114;
    background: #000;
    overflow: hidden;
}
.show { position: fixed; inset: 0; background: #000; color: #fff; }
.show__stage { position: absolute; inset: 0; overflow: hidden; }
.show__layer { position: absolute; inset: 0; opacity: 0; will-change: opacity, transform; }
.show__layer.is-active { opacity: 1; z-index: 1; }
.show[data-transition="fade"] .show__layer { transition: opacity 1s ease; }
.show[data-transition="fadeblack"] .show__layer.is-out { transition: opacity 0.5s ease; }
.show[data-transition="fadeblack"] .show__layer.is-in { transition: opacity 0.5s ease 0.5s; }
.show[data-transition="slide"] .show__layer { transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease; }
.show[data-transition="slide"] .show__layer.is-in.from-right:not(.is-active) { transform: translateX(100%); }
.show[data-transition="slide"] .show__layer.is-in.from-left:not(.is-active) { transform: translateX(-100%); }
.show[data-transition="slide"] .show__layer.is-out-left { transform: translateX(-30%); }
.show[data-transition="slide"] .show__layer.is-out-right { transform: translateX(30%); }
.show[data-transition="slide"] .show__layer.is-active { transform: none; }
.show[data-transition="zoom"] .show__layer { transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.9s ease; }
.show[data-transition="zoom"] .show__layer.is-in:not(.is-active) { transform: scale(1.18); }
.show[data-transition="zoom"] .show__layer.is-out { transform: scale(0.94); }
.show[data-transition="zoom"] .show__layer.is-active { transform: none; }
.show[data-transition="wipe"] .show__layer { transition: clip-path 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease 0.8s; }
.show[data-transition="wipe"] .show__layer.is-in:not(.is-active) { clip-path: inset(0 0 0 100%); opacity: 1; }
.show[data-transition="wipe"] .show__layer.is-in.is-active { clip-path: inset(0 0 0 0); opacity: 1; z-index: 2; }
.show[data-transition="wipe"] .show__layer.is-out { clip-path: inset(0 0 0 0); }

.show__slide { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: var(--tile-color, #000); }
.show__bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(32px) brightness(0.5); transform: scale(1.05); }
.show__media { position: relative; z-index: 1; display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 24px 80px -24px rgb(0 0 0 / 0.8); }
img.show__media { max-width: 100vw; max-height: 100vh; }
video.show__media { width: 100%; height: 100%; }
.show__media--kb { animation-timing-function: linear; animation-fill-mode: forwards; }
.show__media--kb-0 { animation-name: kb-in; }
.show__media--kb-1 { animation-name: kb-out; }
.show__media--kb-2 { animation-name: kb-left; }
.show__media--kb-3 { animation-name: kb-top; }
@keyframes kb-in { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes kb-out { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes kb-left { from { transform: translateX(-2%) scale(1.06); } to { transform: translateX(2%) scale(1.06); } }
@keyframes kb-top { from { transform: translateY(-2%) scale(1.06); } to { transform: translateY(2%) scale(1.06); } }

/* Startkarte: Einstellungen, Start, Export */
.show__start { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; overflow: auto; padding: var(--s-5) var(--s-4); background: #000 center / cover no-repeat; }
.show__start::before { content: ''; position: absolute; inset: 0; background: rgb(0 0 0 / 0.35); backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1); }
.show__card { position: relative; }
.show__card { width: min(42rem, 100%); display: grid; gap: var(--s-4); padding: var(--s-6); padding-top: calc(var(--s-6) + 4px); background: rgb(18 20 21 / 0.58); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); border: 1px solid rgb(255 255 255 / 0.14); border-radius: var(--radius-l); box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.08); }
.show__close { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; justify-content: center; width: var(--touch); height: var(--touch); border-radius: 50%; color: #fff; background: rgb(255 255 255 / 0.1); border: 1px solid rgb(255 255 255 / 0.18); transition: background-color 160ms var(--ease), transform 160ms var(--ease); }
.show__close:hover, .show__close:focus-visible { background: var(--accent); color: var(--on-accent); transform: scale(1.05); outline: none; }
.show__card .btn--secondary { border-color: rgb(255 255 255 / 0.55); color: #fff; }
.show__card .btn--secondary:hover { background: rgb(255 255 255 / 0.12); }
.show__card .btn--quiet { color: rgb(255 255 255 / 0.85); border: 1px solid rgb(255 255 255 / 0.25); }
.show__card .btn--quiet:hover { background: rgb(255 255 255 / 0.1); }
.show__remember { margin-top: var(--s-2); }
.show__card .wordmark--bar { font-size: 1rem; }
.show__title { font-size: var(--text-2xl); font-weight: 300; }
.show__lead { color: var(--ink-muted); }
.show__settings { display: grid; gap: var(--s-4); }
.show__row { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); }
.show__row--checks { gap: var(--s-1) var(--s-5); }
.show__opt { display: grid; gap: 4px; font-size: var(--text-s); font-weight: 600; }
.show__opt .select { min-width: 12rem; }
.show__hint { margin: 0; }
@media (hover: none) and (pointer: coarse) { .show__hint { display: none; } } /* Tastaturtipp nicht auf dem Handy */
.show__export summary { list-style: none; cursor: pointer; }
.show__export summary::-webkit-details-marker { display: none; }
.show__exportform { display: grid; gap: var(--s-3); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }

/* Steuerung unten, blendet sich aus */
.show__controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 0 var(--s-4) calc(env(safe-area-inset-bottom) + var(--s-4)); transition: opacity 0.4s ease; }
.show.is-idle .show__controls { opacity: 0; pointer-events: none; }
.show.is-idle { cursor: none; }
.show__progress { height: 3px; margin: 0 auto var(--s-3); max-width: 60rem; border-radius: 2px; background: rgb(255 255 255 / 0.22); overflow: hidden; }
.show__progress span { display: block; width: 0; height: 100%; background: var(--accent); }
.show__bar { display: flex; align-items: center; gap: var(--s-1); width: fit-content; max-width: 100%; margin: 0 auto; padding: var(--s-1) var(--s-2); background: rgb(21 23 24 / 0.8); border: 1px solid rgb(255 255 255 / 0.1); border-radius: var(--radius-pill); backdrop-filter: blur(12px); }
.show__btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; transition: background-color 140ms var(--ease); }
.show__btn:hover { background: rgb(255 255 255 / 0.12); }
.show__btn:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.show__btn--main { background: var(--accent); color: var(--on-accent); }
.show__btn--main:hover { background: var(--accent-strong); }
.show__btn svg { width: 22px; height: 22px; }
.show__ico-play, .show.is-paused .show__ico-pause { display: none; }
.show.is-paused .show__ico-play { display: block; }
.show__btn[aria-pressed="true"] .show__ico-on, .show__btn[aria-pressed="false"] .show__ico-off { display: none; }
.show__counter { padding: 0 var(--s-2); font-size: var(--text-s); font-variant-numeric: tabular-nums; }
.show__caption { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-s); color: rgb(255 255 255 / 0.7); }
@media (max-width: 599px) { .show__caption { display: none; } .show__card { padding: var(--s-5) var(--s-4); } .show__opt .select { min-width: 0; width: 100%; } .show__opt { flex: 1 1 100%; } }

/* Ohne JavaScript */
.show__list { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--s-2); }
.show__list img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-tile); }
@media (prefers-reduced-motion: reduce) { .show__media--kb { animation: none; } }

/* ---------- Rolle und Vorschau «Ansicht als Mitglied» ---------- */
.topbar__role__sys { display: inline-flex; align-items: center; margin-left: 5px; color: var(--cloth); vertical-align: -2px; }
.topbar__role {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--bar-line);
    color: var(--bar-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.topbar__role--preview { color: var(--on-accent); background: var(--accent); border-color: transparent; }
@media (max-width: 759px) {
    .topbar__role { display: none; } /* Handy: kein Platz – das Kontomenü nennt die Rolle */
    .topbar__bug { display: none; } /* Handy: «Fehler melden» steht im Kontomenü */
    /* Handy: alles in einer Zeile – Schriftzug darf schrumpfen, Werkzeuge rücken enger zusammen */
    .topbar__inner { gap: var(--s-2); padding-inline: var(--s-3); }
    .topbar__brand { min-width: 0; flex: 1 1 auto; }
    .topbar__brand .wordmark--bar { font-size: 1rem; letter-spacing: 0.08rem; }
    .topbar__tools { gap: 6px; }
    .topbar__bug { width: 40px; height: 40px; min-width: 40px; }
    .topbar__tools .lang-switch__seg { min-width: 30px; padding: 0 6px; }
}
@media (min-width: 760px) and (max-width: 1199px) {
    .topbar__role { display: none; } /* Tablet und kleine Desktops: Platz für die Navigation; das Kontomenü nennt die Rolle */
    .topbar__tenant { max-width: 7rem; } /* Name des Bereichs gekürzt, damit alle Menüpunkte Platz haben */
    .topbar__inner { gap: var(--s-4); }
}
@media (min-width: 1200px) and (max-width: 1439px) {
    .topbar__tenant { max-width: 11rem; } /* mittlere Desktops: langer Bereichsname gekürzt, damit «System» und die Sprach-Pille Platz haben */
}
@media (max-width: 439px) { .topbar__role__sys { display: none; } } /* auf schmalen Handys nur die Rolle im Bereich; das Menü nennt den Rest */
.menu__role { display: block; margin-top: var(--s-1); font-size: var(--text-s); color: var(--cloth); }
.menu__item--accent { color: var(--cloth); font-weight: 600; }
.preview-bar {
    position: sticky;
    top: var(--topbar-h);
    z-index: 24;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-3);
    padding: var(--s-2) var(--s-4);
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 8px 24px -16px rgb(0 0 0 / 0.6);
}
.preview-bar p { margin: 0; max-width: none; flex: 1 1 20rem; font-size: var(--text-s); }
.preview-bar svg { flex: none; }
.preview-bar .btn--primary { background: var(--on-accent); color: #fff; box-shadow: none; }
.preview-bar .btn--primary:hover { background: #2a2420; color: #fff; }

/* ---------- Reihenfolge der Alben (Ziehen oder Pfeile) ---------- */
.order__list { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: grid; gap: var(--s-2); }
.order__item { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-tile); transition: box-shadow 160ms var(--ease), transform 160ms var(--ease), opacity 160ms var(--ease); }
.order__item.is-dragging { opacity: 0.45; }
.order__item.is-over { box-shadow: 0 0 0 2px var(--accent); }
.order__item:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.order__grip { color: var(--ink-muted); cursor: grab; touch-action: none; }
.order__item.is-dragging .order__grip { cursor: grabbing; }
.order__thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--paper); display: grid; place-items: center; color: var(--ink-muted); }
.order__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order__name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.order__arrows { display: flex; gap: 2px; }
.order__status:empty { display: none; }
@media (max-width: 599px) { .order__item { grid-template-columns: auto 1fr auto; } .order__thumb { display: none; } }

/* ---------- Hochladen: Hinweis während des Einlesens, Spinner ---------- */
.upload-picking { display: flex; align-items: center; justify-content: center; gap: var(--s-2); margin: var(--s-3) 0 0; font-size: var(--text-s); color: var(--ink-muted); }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--line); } }

/* ---------- Hintergrundmusik (Verwaltung → Einstellungen) ---------- */
.music { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line); max-width: 42rem; }
.music > .section-title { margin-top: 0; }
.music__current { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-tile); margin: var(--s-3) 0; }
.music__current > svg { color: var(--accent); }
.music__text { display: grid; min-width: 0; overflow-wrap: anywhere; }
.music__player { grid-column: 1 / -1; width: 100%; max-width: 32rem; height: 40px; }
.music__current .confirm { grid-column: 1 / -1; }
.music__current .confirm[open] { grid-column: 1 / -1; justify-self: stretch; }
.music__upload { margin-top: var(--s-3); }
.music__upload .input[type="file"] { padding: var(--s-2) var(--s-3); }
@media (min-width: 700px) { .music__current { grid-template-columns: auto 1fr auto; } .music__current .confirm { grid-column: 3; justify-self: end; } .music__player { grid-column: 2 / -1; } }

/* ---------- Profilbild: Konto und Zuschneide-Dialog ---------- */
.member-cell { display: inline-flex; align-items: center; gap: var(--s-3); }
.member-cell > .avatar { flex: none; }
.profile__row { display: flex; gap: var(--s-5); align-items: flex-start; flex-wrap: wrap; }
.profile__text { display: grid; gap: var(--s-3); flex: 1 1 18rem; min-width: 0; }
.profile__text p { margin: 0; }
.profile__pick { cursor: pointer; }
.menu__avatar { position: relative; display: inline-flex; width: 56px; height: 56px; margin-bottom: var(--s-2); border-radius: 50%; text-decoration: none; }
.menu__avatar .avatar { width: 56px; height: 56px; font-size: 1.25rem; }
.menu__avatar-edit { position: absolute; right: -2px; bottom: -2px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 2px var(--surface); }
.menu__avatar:hover .menu__avatar-edit, .menu__avatar:focus-visible .menu__avatar-edit { background: var(--accent-strong); }
.profile.is-dropping { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.profile__pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.avatar-dialog { width: min(24rem, calc(100vw - 2 * var(--s-4))); }
.avatar-crop { display: grid; place-items: center; margin: var(--s-3) 0; }
.avatar-crop__canvas { width: 280px; height: 280px; max-width: 100%; border-radius: var(--radius); background: var(--paper); touch-action: none; cursor: grab; }
.avatar-crop__canvas:active { cursor: grabbing; }
.avatar-crop__zoom { display: block; margin: 0 auto var(--s-4); max-width: 280px; }
.avatar-crop__zoom input { width: 100%; accent-color: var(--accent); }

/* ---------- Sicherung (System) ---------- */
.list__item--stack { align-items: flex-start; }
.list__item--stack > div { min-width: 0; flex: 1 1 auto; }
.list__item--stack .download-progress { margin-top: var(--s-2); max-width: 32rem; }
.list__item--stack .actions { margin: var(--s-2) 0 0; }

/* ---------- Passkeys ---------- */
.auth-or { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-3) 0; color: var(--ink-muted); font-size: var(--text-s); }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.passkey-login { display: grid; gap: var(--s-2); }
.passkeys .list { margin-bottom: var(--s-4); }
.passkeys .list__item .confirm[open] { flex-basis: 100%; }

/* ---------- Ankündigungen und Wartungsfenster ---------- */
.announce-stack { display: grid; gap: 1px; }
.announce {
    display: flex; align-items: flex-start; gap: var(--s-3);
    padding: var(--s-3) max(var(--s-4), calc((100% - var(--page)) / 2 + var(--s-4)));
    background: var(--surface); color: var(--ink); border-bottom: 2px solid var(--accent); font-size: var(--text-s);
}
.announce > svg { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--accent); }
.announce--maintenance { border-bottom-color: var(--danger); }
.announce--maintenance > svg { color: var(--danger); }
.announce--running { background: var(--danger-tint); }
.announce__text { flex: 1 1 0; min-width: 12rem; display: grid; gap: 2px; }
.announce__text p { margin: 0; }
.announce__title strong { font-size: var(--text-m); }
.announce__when { color: var(--ink-muted); margin-left: var(--s-2); white-space: nowrap; }
.announce__body { max-width: 70ch; color: var(--ink-muted); }
.announce__countdown { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; color: var(--cloth); }
.announce--maintenance .announce__countdown { color: var(--danger); }
.announce__countdown svg { width: 16px; height: 16px; }
.announce__ok { flex: none; align-self: center; }
.announce--preview { border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--s-3) var(--s-4); }
.announce-stack--floating {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 60dvh; overflow: auto;
    box-shadow: 0 -5px 20px rgb(0 0 0 / 0.5); animation: announceUp 0.5s ease-out both;
}
.announce--floating { border-bottom: 0; border-top: 2px solid var(--accent); background: rgb(35 37 38 / 0.97); color: #fff; }
.announce--floating.announce--maintenance { border-top-color: var(--danger); }
.announce--floating .announce__body, .announce--floating .announce__when { color: #d7d9d6; }
@keyframes announceUp { from { transform: translateY(100%); opacity: 0; } }
@media (max-width: 640px) {
    .announce { flex-wrap: wrap; }
    .announce__when { display: block; margin-left: 0; white-space: normal; }
    .announce__ok { flex-basis: 100%; }
    .announce__ok .btn { width: 100%; }
}
@media (max-width: 640px) {
    /* Auf dem Handy nicht schwebend (würde Anmeldeformular und Fusszeile verdecken), sondern oben im Fluss */
    .announce-stack--floating { position: static; max-height: none; box-shadow: none; animation: none; }
    .announce--floating { border-top: 0; border-bottom: 2px solid var(--accent); }
    .announce--floating.announce--maintenance { border-bottom-color: var(--danger); }
}
@media (prefers-reduced-motion: reduce) { .announce-stack--floating { animation: none; } }

.announcement-list { margin-bottom: var(--s-6); }
.announcement-row__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-1); }
.announcement-row__head a { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; color: var(--ink); }
.announcement-row__head a svg { width: 20px; height: 20px; color: var(--cloth); }
.announcement-row--cancelled .announcement-row__head a, .announcement-row--past .announcement-row__head a { color: var(--ink-muted); }
.announcement-row .badge svg { width: 14px; height: 14px; vertical-align: -2px; }
.list__item--stack > .actions--column { flex: 0 0 auto; flex-direction: column; align-items: stretch; margin: 0; }
.actions--column .btn { justify-content: center; }
.form--full { max-width: none; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s-4); }
.form-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: var(--s-5); }
.choice-list--row { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
.check--indent { margin-left: calc(24px + var(--s-3)); }
.plain-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-1); }

.maintenance-body { background: var(--paper); }
.maintenance-page .error-page__inner { max-width: 36rem; }
.maintenance-page .wordmark--bar { margin-bottom: var(--s-3); }
.maintenance-page__when { font-weight: 600; margin: 0; }
.maintenance-page__body { color: var(--ink-muted); max-width: 60ch; }
.maintenance-page__countdown { font-size: var(--text-m); }
.maintenance-page__foot { margin-top: var(--s-4); }

/* ---------- Sprachumschalter ---------- */
.lang-switch { margin: 0; flex: none; }
/* Pille mit zwei Hälften: die aktive Sprache ist ausgefüllt, die andere ein Knopf */
.lang-switch__pill { display: inline-flex; align-items: stretch; min-height: 32px; padding: 2px; border-radius: var(--radius-pill); border: 1px solid var(--bar-line); background: transparent; }
.lang-switch__seg {
    display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 0 8px;
    border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--bar-muted);
    font: inherit; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; line-height: 1; cursor: pointer;
}
.lang-switch__seg.is-active { background: var(--accent); color: var(--on-accent); cursor: default; }
.lang-switch__seg:not(.is-active):hover { color: var(--bar-ink, #fff); background: var(--bar-hover); }
.lang-switch__seg:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- KI-Bildsuche: Schlagwörter, ähnliche Fotos ---------- */
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: var(--s-3) 0 0; }
.tag {
    display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: var(--radius-pill);
    border: 1px solid var(--line); background: var(--cloth-tint); color: var(--cloth); font-size: var(--text-s); font-weight: 600; text-decoration: none;
}
.tag:hover { border-color: var(--cloth); text-decoration: none; }
.tags__hint { margin-left: var(--s-1); }
.similar { margin-top: var(--s-6); }
.similar .section__title .muted { font-weight: 400; margin-left: var(--s-2); }

/* ---------- Migration aus Piwigo (System) ---------- */
.step { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: var(--s-1); border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 0.8em; font-weight: 700; }
.migration .input--file { padding: var(--s-2) var(--s-3); }
.migration__progress progress { width: 100%; height: 12px; accent-color: var(--accent); }
.migration [data-uploaded-for] { display: flex; align-items: center; gap: var(--s-2); color: var(--ok); }
.migration__errors { margin: var(--s-2) 0 0; padding-left: var(--s-5); color: var(--danger); }
.migration__source { padding: var(--s-4); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-l); background: var(--surface-2); margin-bottom: var(--s-4); }
.migration__source-title { display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-3); font-size: var(--text-m); }
.migration__source-title svg { color: var(--cloth); }
.migration__or { margin: var(--s-4) 0 var(--s-2); font-weight: 600; }
.migration__fresh { padding: var(--s-4); border: 1px solid var(--danger); border-left-width: 4px; border-radius: var(--radius-l); background: var(--danger-tint); margin: var(--s-3) 0 var(--s-4); display: grid; gap: var(--s-3); }
.migration__fresh[hidden] { display: none; }
.migration__run { min-width: 0; flex: 1 1 auto; }
.migration__stats { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: var(--s-2) 0; color: var(--ink-muted); }
.migration__stats strong { color: var(--ink); }
.migration__log summary { cursor: pointer; color: var(--cloth); }
.migration__log pre { max-height: 20rem; overflow: auto; padding: var(--s-3); border-radius: var(--radius); background: var(--paper); white-space: pre-wrap; }
.panel--danger { border: 1px solid var(--danger-tint); }
.panel--danger .select { flex: 1 1 16rem; max-width: 28rem; width: auto; }
label.link { color: var(--cloth); text-decoration: underline; cursor: pointer; }

/* Zum Aktualisieren nach unten ziehen (Handy): Pfeil über der Kopfzeile, dreht sich beim Laden */
.ptr { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; justify-content: center; align-items: center; gap: var(--s-2); height: 0; overflow: hidden; color: var(--ink-muted); font-size: var(--text-s); pointer-events: none; transform: translateY(calc(var(--pull, 0px) - 56px)); transition: transform 160ms var(--ease), height 0s; }
.ptr.is-pulling { height: 56px; background: var(--surface-2); box-shadow: var(--shadow-lift); transition: transform 0s; }
.ptr__icon { display: inline-flex; width: 22px; height: 22px; transition: transform 160ms var(--ease); }
.ptr__icon svg { width: 22px; height: 22px; }
.ptr.is-ready { color: var(--cloth); }
.ptr.is-ready .ptr__icon { transform: rotate(180deg); }
.ptr.is-loading .ptr__icon { animation: ptr-spin 0.9s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (pointer: coarse) { html, body { overscroll-behavior-y: contain; } } /* eigener Pfeil statt des Browser-Effekts */
@media (prefers-reduced-motion: reduce) { .ptr, .ptr__icon { transition: none; } .ptr.is-loading .ptr__icon { animation: none; } }

/* Hinweis nach der Anmeldung (Passkey einrichten): schmale Leiste über dem Inhalt */
.nudge { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); margin: var(--s-4) auto 0; width: min(var(--page), calc(100% - 2 * var(--s-4))); padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-l); background: var(--surface-2); }
.nudge > svg { flex: none; color: var(--cloth); }
.nudge__text { flex: 1 1 18rem; display: grid; gap: 2px; font-size: var(--text-s); }
.nudge__text strong { font-size: var(--text-m); }
.nudge__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.nudge__actions form { display: contents; }
.page-header__icon-title { display: flex; align-items: center; gap: var(--s-2); }
.page-header__icon-title svg { color: var(--cloth); flex: none; }

/* ---------- Einrichtung im Browser (/setup) ----------
 * Links die Schritte als senkrechte Leiste (erledigt mit Häkchen, aktueller Schritt in Bernstein),
 * rechts der Schritt. Auf dem Handy werden die Schritte zu einer kompakten Zeile über dem Inhalt.
 */
.setup { display: grid; grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr); gap: var(--s-6); align-items: start; padding-bottom: var(--s-8); }
.setup__main { min-width: 0; max-width: 46rem; }
.setup__logbtn { margin-left: auto; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; position: sticky; top: calc(var(--topbar-h) + var(--s-4)); }
.setup-steps__item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--radius); color: var(--ink-muted); }
.setup-steps__mark { display: inline-grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 1px solid var(--line); font-size: var(--text-s); font-weight: 600; }
.setup-steps__item--done { color: var(--ink); }
.setup-steps__item--done .setup-steps__mark { border-color: transparent; background: var(--ok-tint); color: var(--ok); }
.setup-steps__item--current { color: var(--ink); background: var(--cloth-tint); font-weight: 600; }
.setup-steps__item--current .setup-steps__mark { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.setup-steps__item--skipped .setup-steps__label { text-decoration: line-through; }
.check-row--warn { border-left: 4px solid var(--accent); }
.check-row--warn svg { color: var(--cloth); }
.check-row__fix { grid-column: 2; padding-top: var(--s-1); color: var(--ink); }
.check-row__fix::before { content: 'So beheben: '; font-weight: 600; }
.setup-ok > summary { cursor: pointer; padding: var(--s-2) 0; color: var(--ink-muted); }
.setup-ok[open] > summary { margin-bottom: var(--s-2); }
.setup-preview { border-left: 4px solid var(--accent); }
.setup-preview__list { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s-2); }
.setup-preview__list li::marker { color: var(--cloth); }
.setup-preview .actions form, .setup .actions form { display: contents; }
.setup-path { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.setup-codeform .input { max-width: 20rem; font-size: var(--text-l); letter-spacing: 0.12em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.setup .field-row > .field:last-child:has(input[type='number']) { flex: 0 1 8rem; }
.setup-skip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.setup-skip p { margin: 0; }
.setup-finish { border-left: 4px solid var(--ok); }
.setup-log { margin: 0; max-height: 70vh; overflow: auto; padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    font-size: 0.8125rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.setup-log__err { color: var(--danger); }
.setup-log__warn { color: var(--cloth); }
@media (max-width: 760px) {
    .setup { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
    .setup-steps { position: static; display: flex; flex-wrap: wrap; gap: var(--s-1); }
    .setup-steps__item { padding: var(--s-1); }
    .setup-steps__item:not(.setup-steps__item--current) .setup-steps__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .setup-steps__item--current { padding-right: var(--s-3); }
}
.setup .btn { white-space: normal; text-align: center; max-width: 100%; }
.setup code { overflow-wrap: anywhere; }

/* Assistenten (Album anlegen, Personen einladen): Schrittleiste */
.wizard { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); counter-reset: none; }
.wizard__step { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-muted); font-size: var(--text-s); }
.wizard__num { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1.5px solid currentColor; font-weight: 700; font-size: 0.85rem; }
.wizard__step--current { color: var(--ink); font-weight: 600; }
.wizard__step--current .wizard__num { background: var(--cloth); border-color: var(--cloth); color: var(--on-cloth, #fff); }
.wizard__step--done { color: var(--ink); }
.wizard__step--done .wizard__num { background: var(--ok-tint, var(--surface)); border-color: var(--ok, var(--cloth)); color: var(--ok, var(--cloth)); }
.wizard__step + .wizard__step::before { content: ''; width: 1.5rem; height: 1px; background: var(--line); margin-right: var(--s-1); }
@media (max-width: 40rem) { .wizard__step + .wizard__step::before { display: none; } .wizard__label { font-size: var(--fs-xs, 0.8rem); } }
.wizard-nav { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; margin-top: var(--s-5); }
.wizard-nav__right { display: flex; gap: var(--s-3); flex-wrap: wrap; }
/* Personenliste im Einladungs-Assistenten */
.people-rows { display: grid; gap: var(--s-2); }
.people-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: var(--s-2); }
@media (max-width: 40rem) { .people-row { grid-template-columns: 1fr; } }
/* Rechte-Übersicht Alben × Gruppen */
.matrix { border-collapse: collapse; width: 100%; font-size: var(--text-s); }
.matrix th, .matrix td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { text-align: left; white-space: normal; min-width: 14rem; }
.matrix thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; vertical-align: bottom; }
.matrix thead th .muted { display: block; font-weight: 400; }
.matrix .matrix__depth-1 td:first-child { padding-left: 1.6rem; }
.matrix .matrix__depth-2 td:first-child { padding-left: 2.8rem; }
.matrix .matrix__depth-3 td:first-child { padding-left: 4rem; }
.matrix .matrix__inherit td:first-child a::after { content: ' ↑'; color: var(--ink-muted); }
.matrix__yes { color: var(--ok); font-weight: 700; }
.matrix__no { color: var(--ink-muted); opacity: .5; }
.matrix__none td:first-child { color: var(--danger); }
.matrix td a { color: inherit; text-decoration: none; }
.matrix td a:hover, .matrix td a:focus-visible { text-decoration: underline; }
.matrix__hint { font-size: 0.72rem; color: var(--ink-muted); display: block; font-weight: 400; }
.people-row--head { padding: 0 var(--s-2); }
.mail-preview { white-space: pre-wrap; font: inherit; font-size: var(--text-s); line-height: 1.5; margin: 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--cloth-tint); color: var(--ink); }
.choice > span svg { display: inline; vertical-align: -3px; margin-right: 4px; }

/* ---------- Logo und App-Icon (8.8) ---------- */
.topbar__logo { display: block; height: 32px; max-width: 180px; width: auto; object-fit: contain; flex: none; }
@media (max-width: 720px) { .topbar__logo { height: 28px; max-width: 140px; } }
.logo-panel__preview { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-3) 0; }
.logo-preview { position: relative; display: grid; place-items: center; min-width: 220px; height: 72px; padding: 0 var(--s-4); border-radius: var(--radius); border: 1px solid var(--line); }
.logo-preview--dark { background: #232526; }
.logo-preview--auth { background: radial-gradient(circle at 30% 20%, #3a2a10, #151718 70%); }
.logo-preview--icon { background: var(--surface-2); min-width: 120px; }
.logo-preview__img { height: 32px; max-width: 180px; object-fit: contain; }
.logo-preview__img--big { height: 44px; max-width: 200px; }
.logo-preview__icon { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--shadow); }
.logo-preview__label { position: absolute; left: 8px; bottom: 4px; font-size: 0.68rem; color: #9a9a9a; letter-spacing: 0.02em; }
.logo-panel__hints { display: grid; gap: var(--s-1); margin: var(--s-2) 0 var(--s-3); }
.logo-panel__hints .field__hint { margin: 0; }
.input--color { width: 72px; height: 40px; padding: 2px; cursor: pointer; }
.home-screen { display: grid; gap: var(--s-4); }
.home-screen__icon { display: grid; justify-items: center; gap: var(--s-2); justify-self: center; padding: var(--s-4) var(--s-6); border-radius: var(--radius-l); background: var(--surface-2); }
.home-screen__icon img { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); }
.home-screen__icon span { font-size: var(--text-s); }
.home-screen__install { display: grid; gap: var(--s-2); justify-items: start; }
.home-screen__install[hidden], .home-screen__steps[hidden], .home-screen__done[hidden] { display: none; }
.share-new__buttons { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0; }
.share-new .share__url { margin: var(--s-2) 0; }
/* Öffentlicher Fotolink: Karte mit Logo, Titel, Herkunft und Ablauf */
.shared { display: grid; gap: var(--s-4); }
.shared__head { display: flex; align-items: center; gap: var(--s-4); }
.shared__logo { height: 48px; max-width: 200px; object-fit: contain; flex: none; }
.shared__title { margin: 0; font-size: var(--text-xl, 1.4rem); line-height: 1.2; }
.shared__meta { margin: var(--s-1) 0 0; color: var(--ink-muted); font-size: var(--text-s); }
.shared__stage { box-shadow: var(--shadow); }
.shared__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.shared__foot p { margin: 0; display: flex; align-items: center; gap: var(--s-1); flex-wrap: wrap; }
@media (max-width: 720px) { .shared__head { align-items: flex-start; } .shared__logo { height: 40px; max-width: 140px; } }
