/* ==========================================================================
   Heiligendorfer Event-Seiten
   Farben aus dem Wappen: Rot auf hellem Grund, dazu ruhiges Wiesengrün
   für "erledigt". Überschriften in einer Buchschrift, Text in Systemschrift.
   ========================================================================== */

:root {
    --red: #c41f2a;
    --red-strong: #a3121d;
    --red-soft: #fbe9ea;
    --green: #2e7a4c;
    --green-soft: #e3f1e8;
    --amber: #9a5b00;
    --amber-soft: #fbefd9;
    --blue: #2c5d9e;
    --blue-soft: #e4ecf7;

    --bg: #f3f5f2;
    --surface: #ffffff;
    --surface-2: #f7f8f6;
    --ink: #1e2420;
    --muted: #5d6761;
    --line: #dde3de;
    --field: #f4f6f3;

    --font-head: "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius-lg: 18px;
    --radius: 12px;
    --radius-sm: 8px;

    --nav-h: 64px;
    --appbar-h: 60px;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --red: #ff6b6f;
        --red-strong: #ff8a8d;
        --red-soft: #3a1f21;
        --green: #6cc493;
        --green-soft: #1d3326;
        --amber: #f0b45a;
        --amber-soft: #3a2c15;
        --blue: #8db4ea;
        --blue-soft: #1d2a3d;

        --bg: #131715;
        --surface: #1c221f;
        --surface-2: #222925;
        --ink: #e7ece8;
        --muted: #9ba69f;
        --line: #303a34;
        --field: #262e29;

        color-scheme: dark;
    }
}


/* --- Grundlagen ---------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--appbar-h) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    border-top: 5px solid var(--red);
}

h1,
h2,
h3 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 .5rem;
    letter-spacing: -.01em;
}

p {
    margin: 0 0 .75rem;
}

a {
    color: var(--red-strong);
}

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

code {
    font-size: .92em;
    background: var(--field);
    padding: .1em .35em;
    border-radius: 4px;
}

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

.muted {
    color: var(--muted);
}

.small {
    font-size: .875rem;
}

.lead {
    margin-bottom: 1.25rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    vertical-align: -.25em;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 500;
    padding: .6rem 1rem;
    background: var(--ink);
    color: var(--surface);
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: 12px;
}


/* --- Buttons ------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: .6rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

.btn--primary {
    background: var(--red);
    color: #fff;
}

.btn--primary:hover {
    background: var(--red-strong);
}

.btn--secondary {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

.btn--secondary:hover {
    border-color: var(--muted);
}

.btn--ghost {
    background: transparent;
    color: var(--ink);
}

.btn--ghost:hover {
    background: var(--field);
}

.btn--danger-ghost {
    background: transparent;
    color: var(--red-strong);
}

.btn--danger-ghost:hover {
    background: var(--red-soft);
}

.btn--small {
    min-height: 38px;
    padding: .4rem .9rem;
    font-size: .9rem;
}

.btn--compact {
    min-height: 40px;
    padding: .45rem .8rem;
    font-size: .9rem;
}

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

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--field);
    color: var(--ink);
}

.icon-btn--danger:hover {
    background: var(--red-soft);
    color: var(--red-strong);
}

@media (prefers-color-scheme: dark) {
    .btn--primary {
        color: #1b0b0c;
    }
}


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

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: .55rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--field);
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--red);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--red-soft);
}

textarea {
    resize: vertical;
    min-height: 70px;
}

input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 0;
    padding: 0;
    accent-color: var(--green);
    cursor: pointer;
}

.field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
}

.field__label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--muted);
}

.field__hint {
    font-size: .8rem;
    color: var(--muted);
}

.field--inline {
    flex-direction: row;
    align-items: center;
    gap: .6rem;
}

.field--inline select {
    width: auto;
    min-width: 7rem;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    align-items: start;
}

.field--wide,
.form-actions {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
}

.form-actions--separate {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px dashed var(--line);
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
}

.field--grow {
    flex: 1 1 220px;
}

.password-wrap {
    position: relative;
    display: block;
}

.password-wrap input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.password-toggle:hover {
    color: var(--ink);
}

/* Formular mit ungespeicherten Änderungen */
form.is-dirty .btn--primary,
form.is-dirty .icon-btn--save {
    box-shadow: 0 0 0 3px var(--amber-soft), 0 0 0 4px var(--amber);
}

form.is-dirty .icon-btn--save {
    color: var(--amber);
}


/* --- Flächen ------------------------------------------------------------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.panel h3 {
    font-size: 1.2rem;
}

.panel--quiet {
    background: transparent;
    border-style: dashed;
}

.panel--narrow {
    max-width: 460px;
}

.empty {
    text-align: center;
    padding: 2rem 1.25rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .75rem;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 600;
}

.badge--accent {
    background: var(--amber-soft);
    color: var(--amber);
}


/* --- Toasts -------------------------------------------------------------- */

.toasts {
    position: fixed;
    left: 50%;
    bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 400;
    display: grid;
    gap: .5rem;
    width: min(92vw, 420px);
}

.toast {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem .75rem 1.1rem;
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--surface);
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    animation: toast-in .2s ease-out;
}

.toast > span {
    flex: 1;
}

.toast--success {
    background: var(--green);
    color: #fff;
}

.toast--error {
    background: var(--red);
    color: #fff;
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s, transform .25s;
}

.toast__close {
    border: 0;
    background: transparent;
    color: inherit;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    opacity: .85;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}

@media (prefers-color-scheme: dark) {
    .toast--success,
    .toast--error {
        color: #101311;
    }
}


/* --- Fußzeile & Hase ----------------------------------------------------- */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem 1.5rem;
    padding: 1.5rem 1rem 2rem;
    color: var(--muted);
    font-size: .875rem;
}

.site-footer nav {
    display: flex;
    gap: 1.25rem;
}

.site-footer a {
    color: var(--muted);
}

.bunny {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 200;
    width: 56px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity .25s, transform .25s;
}

.bunny.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.bunny img {
    display: block;
    width: 100%;
    height: auto;
}


/* ==========================================================================
   Öffentliche Seite
   ========================================================================== */

.layout-public .toasts {
    bottom: 24px;
}

.masthead {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: min(100% - 2rem, 1100px);
    margin: 2rem auto 1.5rem;
}

.masthead__crest img {
    display: block;
    width: 64px;
    height: auto;
}

.masthead h1 {
    margin: 0;
    font-size: clamp(1.7rem, 4.5vw, 2.8rem);
    color: var(--red-strong);
}

.masthead__date {
    margin: .3rem 0 0;
    font-size: 1.05rem;
    color: var(--muted);
}

.public-main {
    flex: 1;
    width: min(100% - 2rem, 1100px);
    margin: 0 auto 2rem;
}

.public-intro {
    max-width: 60ch;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.25rem;
    align-items: start;
}

.poster {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Banner sind breit – über die ganze Zeile */
.poster--banner {
    grid-column: 1 / -1;
}

.poster__image {
    display: block;
    background: var(--surface-2);
}

.poster__image img {
    display: block;
    width: 100%;
    height: auto;
}

.poster--story .poster__image img {
    max-height: 480px;
    margin: 0 auto;
    width: auto;
    object-fit: contain;
}

.poster__body {
    padding: 1rem 1.1rem 1.15rem;
}

.poster__body h2 {
    font-size: 1.3rem;
    margin-bottom: .2rem;
}

.poster__body p {
    color: var(--muted);
    font-size: .95rem;
}

.poster__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.poster__actions .btn {
    flex: 1 1 auto;
}

.notice {
    max-width: 560px;
    padding: 2rem 0;
}

.notice h2 {
    font-size: 1.5rem;
}

.login-panel {
    width: min(100%, 400px);
    margin: 1rem auto 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
}

.login-panel h2 {
    font-size: 1.6rem;
}


/* ==========================================================================
   Angemeldeter Bereich
   ========================================================================== */

.appbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--appbar-h);
    padding: .4rem max(1rem, env(safe-area-inset-right)) .4rem max(1rem, env(safe-area-inset-left));
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.appbar__brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.appbar__brand img {
    width: 34px;
    height: auto;
    flex: none;
}

.appbar__title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.appbar__title strong {
    font-family: var(--font-head);
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar__title small {
    color: var(--muted);
    font-size: .8rem;
}

.appbar__actions {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.app-shell {
    flex: 1;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2rem;
    width: min(100% - 2rem, 1180px);
    margin: 1.75rem auto 0;
}

.sidenav {
    position: sticky;
    top: calc(var(--appbar-h) + 1.75rem);
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.sidenav__link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}

.sidenav__link:hover {
    background: var(--surface);
}

.sidenav__link.is-active {
    background: var(--red-soft);
    color: var(--red-strong);
}

.sidenav__user {
    margin: 1rem .9rem 0;
    font-size: .8rem;
    color: var(--muted);
}

.app-main {
    min-width: 0;
    max-width: 920px;
    padding-bottom: 2rem;
}

.page-heading {
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
    margin-bottom: 1.25rem;
}


/* --- Status (Termin-Seite) ----------------------------------------------- */

.panel--status {
    border-left: 6px solid var(--muted);
}

.status--live { border-left-color: var(--red); }
.status--visible { border-left-color: var(--green); }
.status--waiting { border-left-color: var(--amber); }

.status-line {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
}

.status-line h3 {
    margin-bottom: .15rem;
}

.status-line p {
    color: var(--muted);
    margin: 0;
}

.status-dot {
    flex: none;
    width: 12px;
    height: 12px;
    margin-top: .45rem;
    border-radius: 50%;
    background: var(--muted);
}

.status--live .status-dot {
    background: var(--red);
    box-shadow: 0 0 0 4px var(--red-soft);
    animation: pulse 1.6s ease-in-out infinite;
}

.status--visible .status-dot { background: var(--green); }
.status--waiting .status-dot { background: var(--amber); }

@keyframes pulse {
    50% { box-shadow: 0 0 0 8px transparent; }
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem 1.5rem;
    margin: 1.1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.facts dt {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
}

.facts dd {
    margin: .1rem 0 0;
    font-weight: 600;
}

.media-check {
    margin-top: 1rem;
}

.media-check summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--red-strong);
}

.check-list {
    list-style: none;
    padding: 0;
    margin: .75rem 0;
    display: grid;
    gap: .5rem;
}

.check-list li {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
}

.check-list li span {
    display: flex;
    flex-direction: column;
}

.check-list small {
    color: var(--muted);
    word-break: break-word;
}

.check-list .is-ok > .icon { color: var(--green); }
.check-list .is-missing > .icon { color: var(--muted); }


/* --- Checklisten --------------------------------------------------------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.toolbar__select {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.cl-cards {
    display: grid;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.cl-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.cl-card[open] {
    border-color: color-mix(in srgb, var(--line), var(--ink) 15%);
}

.cl-card__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
    list-style: none;
}

.cl-card__summary::-webkit-details-marker {
    display: none;
}

.cl-card__title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cl-card__title strong {
    font-family: var(--font-head);
    font-size: 1.15rem;
}

.cl-card__title small {
    color: var(--muted);
}

.cl-card__meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
}

.progress-text {
    font-size: .85rem;
    color: var(--muted);
    white-space: nowrap;
}

.cl-card__chevron {
    color: var(--muted);
    transition: transform .2s;
}

.cl-card[open] .cl-card__chevron {
    transform: rotate(180deg);
}

.status-pill {
    display: inline-block;
    padding: .2rem .7rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    background: var(--field);
    color: var(--muted);
    white-space: nowrap;
}

.status-pill[data-status="angefragt"] { background: var(--amber-soft); color: var(--amber); }
.status-pill[data-status="bestellt"] { background: var(--blue-soft); color: var(--blue); }
.status-pill[data-status="bestätigt"] { background: var(--blue-soft); color: var(--blue); }
.status-pill[data-status="erledigt"] { background: var(--green-soft); color: var(--green); }

.cl-card__body {
    padding: 0 1.1rem 1.1rem;
    border-top: 1px solid var(--line);
}

.cl-settings {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: .75rem;
    padding: 1rem 0;
}

.cl-notes {
    padding: 1rem 0 0;
    color: var(--muted);
}

/* Tabelle: Zeilen sind Flex-Reihen, Spaltenbreite über Klassen */
.cl-table {
    margin-top: .5rem;
}

.cl-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 0;
    border-bottom: 1px solid var(--line);
}

.cl-row:last-child {
    border-bottom: 0;
}

.cl-row--head {
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    padding-bottom: .3rem;
}

.cl-row--new {
    margin-top: .25rem;
    padding-top: .75rem;
    border-top: 1px dashed var(--line);
}

.cl-cell {
    min-width: 0;
}

.w-large { flex: 2 1 0; }
.w-medium { flex: 1 1 0; }
.w-small { flex: 0 0 110px; }
.w-mini { flex: 0 0 56px; text-align: center; }

.cl-cell--actions {
    flex: 0 0 96px;
    display: flex;
    justify-content: flex-end;
    gap: .15rem;
}

.cl-row input:not([type="checkbox"]),
.cl-row select {
    min-height: 40px;
    padding: .4rem .55rem;
}

.with-unit {
    position: relative;
    display: block;
}

.with-unit input {
    padding-right: 1.8rem !important;
}

.with-unit > span {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.tick {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 2px solid var(--line);
    border-radius: 6px;
}

.tick.is-on {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.tick .icon {
    width: 16px;
    height: 16px;
    stroke-width: 3;
}


/* --- Dateien & Benutzer -------------------------------------------------- */

.file-list,
.user-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.file-list li + li,
.user-list li + li {
    border-top: 1px solid var(--line);
}

.file-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.1rem;
    color: inherit;
    text-decoration: none;
}

.file-row:hover {
    background: var(--surface-2);
}

.file-row__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--red-soft);
    color: var(--red-strong);
    flex: none;
}

.file-row__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.file-row__text small,
.user-row__text small {
    color: var(--muted);
}

.file-row__action {
    color: var(--muted);
}

.user-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.1rem;
}

.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    background: var(--field);
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--muted);
}

.user-row__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.user-row__actions {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.dialog {
    width: min(92vw, 420px);
    border: 0;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}

.dialog::backdrop {
    background: rgba(20, 24, 22, .55);
}

.secret {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0 1.25rem;
    padding: .75rem;
    background: var(--field);
    border-radius: var(--radius);
}

.secret code {
    flex: 1;
    background: none;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .06em;
    word-break: break-all;
}


/* ==========================================================================
   Mobil
   ========================================================================== */

@media (max-width: 899px) {
    body {
        padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    }

    .layout-public {
        padding-bottom: 0;
    }

    .app-shell {
        display: block;
        margin-top: 1.25rem;
    }

    /* Menü wird zur Leiste am unteren Rand */
    .sidenav {
        position: fixed;
        inset: auto 0 0 0;
        top: auto;
        z-index: 150;
        flex-direction: row;
        justify-content: space-around;
        gap: 0;
        height: calc(var(--nav-h) + env(safe-area-inset-bottom));
        padding: 0 .25rem env(safe-area-inset-bottom);
        background: var(--surface);
        border-top: 1px solid var(--line);
    }

    .sidenav__link {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        gap: .15rem;
        padding: .35rem .2rem;
        border-radius: 0;
        font-size: .7rem;
        font-weight: 600;
        color: var(--muted);
    }

    .sidenav__link .icon {
        width: 1.45rem;
        height: 1.45rem;
    }

    .sidenav__link:hover {
        background: transparent;
    }

    .sidenav__link.is-active {
        background: transparent;
        color: var(--red-strong);
    }

    .sidenav__user {
        display: none;
    }

    .appbar__actions .btn span {
        display: none;
    }

    .bunny {
        bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
        width: 46px;
    }

    .layout-public .bunny {
        bottom: 14px;
    }

    .masthead {
        margin-top: 1.25rem;
        gap: .9rem;
    }

    .masthead__crest img {
        width: 48px;
    }

    .cl-settings {
        grid-template-columns: 1fr 1fr;
    }

    .cl-settings .field:first-of-type {
        grid-column: 1 / -1;
    }
}

/* Checklisten-Zeilen auf schmalen Geräten als kleine Karten */
@media (max-width: 640px) {
    .cl-row--head {
        display: none;
    }

    .cl-row {
        flex-wrap: wrap;
        gap: .5rem .75rem;
        padding: .75rem 0;
    }

    .cl-cell[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: .75rem;
        font-weight: 600;
        color: var(--muted);
        margin-bottom: .15rem;
    }

    .w-large {
        flex: 1 1 100%;
    }

    .w-medium,
    .w-small {
        flex: 1 1 calc(50% - .5rem);
    }

    .w-mini {
        flex: 0 0 auto;
        text-align: left;
    }

    .cl-cell--actions {
        flex: 1 1 100%;
        justify-content: flex-end;
    }

    .poster-grid {
        grid-template-columns: 1fr;
    }

    .user-row__actions .btn span {
        display: none;
    }
}

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

/* ==========================================================================
   Planung: Event-Übersicht, Reiter, Dateien, Benutzer
   ========================================================================== */

.section-title {
    font-size: 1.15rem;
    margin: 1.75rem 0 .75rem;
}

.event-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: grid;
    gap: .75rem;
}

.event-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: inherit;
    text-decoration: none;
}

.event-card:hover {
    border-color: color-mix(in srgb, var(--line), var(--ink) 25%);
}

/* Kalenderblatt: das Datum ist die wichtigste Information */
.event-card__date {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 64px;
    padding: .35rem 0 .45rem;
    border-radius: var(--radius);
    background: var(--red-soft);
    color: var(--red-strong);
    line-height: 1.05;
    border-top: 6px solid var(--red);
}

.event-card__date strong {
    font-family: var(--font-head);
    font-size: 1.7rem;
}

.event-card__date small {
    font-size: .75rem;
    font-weight: 700;
}

.event-card__body {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    flex: 1;
    min-width: 0;
}

.event-card__name {
    font-family: var(--font-head);
    font-size: 1.2rem;
}

.event-card__when {
    color: var(--muted);
    font-size: .92rem;
}

.event-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .9rem;
    margin-top: .3rem;
    font-size: .85rem;
}

.event-card__go {
    flex: none;
    color: var(--muted);
    transform: rotate(-90deg);
}

.state-pill {
    display: inline-block;
    padding: .15rem .65rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .78rem;
    background: var(--field);
    color: var(--muted);
}

.state--live .state-pill { background: var(--red-soft); color: var(--red-strong); }
.state--visible .state-pill { background: var(--green-soft); color: var(--green); }
.state--waiting .state-pill { background: var(--amber-soft); color: var(--amber); }

.event-list--past .event-card {
    background: transparent;
}

.event-list--past .event-card__date {
    background: var(--field);
    color: var(--muted);
    border-top-color: var(--line);
}

.with-suffix {
    display: flex;
    align-items: stretch;
}

.with-suffix input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    min-width: 0;
}

.with-suffix > span {
    display: flex;
    align-items: center;
    padding: 0 .7rem;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--surface-2);
    color: var(--muted);
    font-size: .9rem;
    white-space: nowrap;
}

.event-head {
    margin-bottom: 1rem;
}

.event-head .page-heading {
    margin-bottom: .2rem;
}

.event-head__date {
    color: var(--muted);
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    margin-bottom: .5rem;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover {
    color: var(--ink);
}

.icon--back {
    transform: rotate(90deg);
}

.icon--up {
    transform: rotate(180deg);
}

.tabs {
    display: flex;
    gap: .25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.tabs__link {
    padding: .7rem 1rem;
    margin-bottom: -1px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.tabs__link:hover {
    color: var(--ink);
}

.tabs__link.is-active {
    color: var(--red-strong);
    border-bottom-color: var(--red);
}

.file-section {
    margin-bottom: 1.5rem;
}

.file-section .section-title {
    margin-top: 0;
    margin-bottom: .2rem;
}

.file-section .file-list {
    margin-top: .75rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding-right: .6rem;
}

.file-item .file-row {
    flex: 1;
    min-width: 0;
}

.file-row__icon--thumb {
    overflow: hidden;
    background: var(--surface-2);
}

.file-row__icon--thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-row-wrap {
    padding-bottom: .25rem;
}

.user-edit {
    margin: 0 1.1rem .75rem 4.1rem;
}

.user-edit summary {
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    color: var(--red-strong);
}

.user-edit form {
    margin-top: .75rem;
}

.event-boxes {
    border: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .6rem;
}

.event-boxes legend {
    margin-bottom: .4rem;
    padding: 0;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .8rem .45rem .6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
    font-size: .92rem;
}

.check:has(input:checked) {
    border-color: var(--green);
    background: var(--green-soft);
}

.check input {
    width: 18px;
    height: 18px;
}

.toggle-form {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

[hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .user-edit {
        margin-left: 1.1rem;
    }

    .event-card {
        gap: .8rem;
        padding: .85rem;
    }

    .event-card__date {
        width: 54px;
    }
}

/* Formular "Neues Event": Subdomain braucht Platz */
.form-grid--create {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Nur-Lese-Zeilen (Helfer) bleiben auf dem Handy eine kompakte Zeile */
@media (max-width: 640px) {
    div.cl-row:not(.cl-row--head) {
        flex-wrap: nowrap;
        padding: .55rem 0;
    }

    div.cl-row .cl-cell[data-label]::before {
        display: none;
    }

    div.cl-row .w-large {
        flex: 2 1 0;
    }

    div.cl-row .w-medium,
    div.cl-row .w-small {
        flex: 1 1 0;
    }
}
