/* Musterdorfer Veranstaltungen – Gestaltung wie Kalenderdienst und
   Flohmarkt (kalenderdienst.musterdorf.de, flohmarkt.musterdorf.de):
   gleiche Farben, rote Kopfzeile mit Ausklapp-Menü, zentrierter Inhalt,
   Karten mit rotem Rand, Kartenansicht auf dem Handy, roter Fußbereich.

   Diese Datei liegt identisch in planung/assets/ und public/assets/. */

:root {
  --brand-red: #c8102e;
  --brand-red-dark: #9c0c23;
  --brand-white: #ffffff;
  --text: #2a2a2a;
  --muted: #757575;
  --border: #e8e0e1;
  --tile-bg: #ffffff;
  --tile-shadow: 0 1px 3px rgba(200, 16, 46, 0.12);
  --hover: #fdf5f6;
  --field: #ffffff;
  --green: #2e7d32;
  --green-soft: #e8f5e9;
  --amber: #8a5300;
  --amber-soft: #fff4e5;
  --blue: #33475b;
  --blue-soft: #eef2f7;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--brand-white);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand-red); }
code { background: #f7f6f6; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
img, svg { max-width: 100%; }
p { margin: 0 0 12px; }
h1 { font-size: 26px; margin: 10px 0 18px; }
h2 { font-size: 20px; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { text-align: center; max-width: 800px; margin: 0 auto 20px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 2px; }

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

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 500; padding: 8px 14px; background: #fff; color: var(--brand-red); border-radius: 6px; }
.skip-link:focus { top: 12px; }

.icon {
  width: 1.2em; height: 1.2em; flex: none;
  fill: none; stroke: currentColor; vertical-align: -0.22em;
}
.icon--back { transform: rotate(90deg); }
.icon--up { transform: rotate(180deg); }

/* ---------- Kopfzeile ---------- */

header.topbar {
  background: var(--brand-red);
  color: #fff;
  padding: 14px 20px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.topbar-brand { font-weight: 700; font-size: 18px; }

/* Events-Logo (rund): groß, links, ragt über die Kopfzeile hinaus */
.topbar-logo-link {
  position: absolute; left: 16px; top: 6px; width: 104px; height: 104px; z-index: 11;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 50%; box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  padding: 0;
}
.topbar-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (min-width: 821px) {
  .topbar-brand { margin-left: 124px; }
}
.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-public-nav { display: flex; flex-wrap: wrap; gap: 10px; }
header.topbar .topbar-public-nav a {
  border: 1.5px solid #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  white-space: nowrap;
}
header.topbar .topbar-public-nav a:hover { background: #fff; color: var(--brand-red); }

.nav-menu { position: relative; }
.nav-menu > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  user-select: none;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after { content: '▾'; font-size: 10px; opacity: 0.85; transition: transform 0.15s ease; }
.nav-menu[open] > summary::after { transform: rotate(180deg); }
.nav-menu > summary:hover { background: rgba(255, 255, 255, 0.15); }
.nav-menu-user { font-weight: 400; opacity: 0.85; }

.nav-menu nav {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 10px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
header.topbar .nav-menu nav a {
  color: var(--text);
  font-weight: 400;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
  display: block;
}
header.topbar .nav-menu nav a:hover { background: var(--hover); }
header.topbar .nav-menu nav a.active { color: var(--brand-red); font-weight: 700; background: var(--hover); }
.nav-menu nav form { margin: 6px 0 0; border-top: 1px solid var(--border); padding-top: 6px; }
.nav-logout {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
}
.nav-logout:hover { background: var(--hover); }

/* ---------- Inhalt ---------- */

.container { max-width: 900px; margin: 0 auto; padding: 20px 16px 100px; flex: 1 0 auto; width: 100%; }
.container.wide { max-width: 1100px; }
.container > h1, .page-heading { text-align: center; }
.page-date { text-align: center; color: var(--muted); margin: -10px 0 20px; }

.login-wrap { max-width: 420px; margin: 0 auto; text-align: left; }

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

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 auto 16px; font-size: 14px; text-align: left; max-width: 900px; display: flex; gap: 10px; align-items: flex-start; }
.flash > span { flex: 1; }
.flash.success { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }
.flash.error { background: #fdecec; border: 1px solid var(--brand-red); color: var(--brand-red-dark); }
.flash.info { background: #eef2f7; border: 1px solid #b9c6d6; color: #33475b; }
.flash__close { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 4px; opacity: .8; }

/* kurze Rückmeldung aus app.js (z. B. „Kopiert“) */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 400; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 10px 14px; border-radius: 8px; background: var(--text); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast--error { background: var(--brand-red); }
.toast.is-leaving { opacity: 0; transition: opacity .25s; }

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

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin: 0 auto 20px;
}
.panel h3 { color: var(--brand-red); }
.panel--quiet { border-left: 6px solid var(--brand-red); }
.empty { text-align: center; padding: 28px 20px; }
.empty h3 { color: var(--text); }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field__label { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.field__hint { font-size: 12px; color: var(--muted); }
.field--inline { flex-direction: row; align-items: center; gap: 10px; }
.field--inline select { width: auto; min-width: 7rem; }
.field--wide, .form-actions { grid-column: 1 / -1; }
.field--grow { flex: 1 1 220px; }

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  min-height: 40px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-red); box-shadow: 0 0 0 3px rgba(200, 16, 46, .12); }
textarea { resize: vertical; min-height: 70px; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--brand-red); cursor: pointer; }

.form-stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: start; }
.form-grid--create { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

.with-unit { position: relative; display: block; }
.with-unit input { padding-right: 30px !important; }
.with-unit > span { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 13px; }

.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 10px; border: 1px solid var(--border); border-left: 0; border-radius: 0 6px 6px 0; background: #f7f6f6; color: var(--muted); font-size: 14px; white-space: nowrap; }

/* 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); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand-red);
  color: #fff;
  border: 1px solid var(--brand-red);
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--brand-red-dark); border-color: var(--brand-red-dark); color: #fff; }
.btn--secondary, .btn--ghost, .btn--danger-ghost { background: #fff; color: var(--brand-red); border: 1px solid var(--brand-red); }
.btn--secondary:hover, .btn--ghost:hover, .btn--danger-ghost:hover { background: var(--hover); color: var(--brand-red-dark); }
.btn--small { padding: 5px 12px; font-size: 13px; border-radius: 999px; }
.btn--compact { padding: 6px 12px; font-size: 14px; }
button:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--brand-red); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn--danger:hover { border-color: var(--brand-red); }

/* ---------- Fußbereich ---------- */

.site-footer { flex-shrink: 0; background: var(--brand-red); padding: 20px 16px; text-align: center; font-size: 13px; color: #fff; }
.site-footer p { margin: 0; }
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer a:hover { opacity: 0.85; }

/* Hase: nach oben */
.bunny { position: fixed; right: 14px; bottom: 14px; z-index: 200; width: 52px; 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 Seiten ---------- */

.public-intro { text-align: center; max-width: 640px; margin: 0 auto 22px; color: var(--muted); }

.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; align-items: start; }
.poster { margin: 0; background: #fff; border: 1px solid var(--border); border-top: 5px solid var(--brand-red); border-radius: 10px; box-shadow: var(--tile-shadow); overflow: hidden; }
.poster--banner { grid-column: 1 / -1; }
.poster__image { display: block; background: #f7f6f6; }
.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: 14px 16px 16px; }
.poster__body h2 { color: var(--brand-red); font-size: 19px; margin-bottom: 4px; }
.poster__body p { color: var(--muted); font-size: 14px; }
.poster__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.poster__actions .btn { flex: 1 1 auto; }

.notice { max-width: 560px; margin: 0 auto; text-align: center; background: #fff; border: 1px solid var(--border); border-top: 5px solid var(--brand-red); border-radius: 10px; padding: 24px 20px; }
.notice h2 { color: var(--brand-red); }

.past-events { max-width: 760px; margin: 24px auto 0; }
.past-events summary { cursor: pointer; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.helper-login { text-align: center; margin-top: 36px; font-size: 14px; }
.helper-login a { color: var(--muted); }

.check-system { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 6px; font-size: 14px; }
.check-system li { display: flex; gap: 8px; align-items: flex-start; }
.check-system .is-ok { color: var(--green); }
.check-system .is-missing { color: var(--brand-red-dark); }
.check-system small { display: block; color: var(--muted); }

/* ---------- Planung: Event-Karten ---------- */

.section-title { color: var(--brand-red); text-align: center; font-size: 18px; margin: 28px 0 12px; }

.event-list { list-style: none; margin: 0 auto 20px; padding: 0; display: grid; gap: 12px; max-width: 760px; }
.event-card {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  background: var(--tile-bg);
  border: 1px solid var(--border);
  border-left: 6px solid var(--brand-red);
  border-radius: 10px;
  box-shadow: var(--tile-shadow);
  color: inherit; text-decoration: none;
}
.event-card:hover { background: var(--hover); }
.event-card__date {
  flex: none; display: flex; flex-direction: column; align-items: center;
  width: 62px; padding: 4px 0 6px;
  border-radius: 8px; background: var(--hover); color: var(--brand-red);
  line-height: 1.05; border-top: 6px solid var(--brand-red);
}
.event-card__date strong { font-size: 26px; }
.event-card__date small { font-size: 12px; font-weight: 700; }
.event-card__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.event-card__name { font-size: 18px; color: var(--brand-red); }
.event-card__when { color: var(--muted); font-size: 14px; }
.event-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; font-size: 13px; }
.event-card__go { flex: none; color: var(--brand-red); transform: rotate(-90deg); }

.state-pill, .status-pill {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .2px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; line-height: 1.4; white-space: nowrap;
  background: #f2f0f0; color: var(--muted);
}
.state--live .state-pill, .state-pill--today { background: var(--brand-red); color: #fff; }
.state--visible .state-pill { background: var(--green-soft); color: var(--green); }
.state--waiting .state-pill { background: var(--blue-soft); color: var(--blue); }
.status-pill[data-status="angefragt"] { background: var(--amber-soft); color: var(--amber); }
.status-pill[data-status="bestellt"],
.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); }

.event-list--past .event-card { border-left-color: #bbb; opacity: .8; }
.event-list--past .event-card__date { background: #f2f0f0; color: var(--muted); border-top-color: #bbb; }
.event-list--past .event-card__name { color: var(--text); }

/* ---------- Ein Event: Kopf und Reiter ---------- */

.event-head { text-align: center; margin-bottom: 12px; }
.event-head .page-heading { margin-bottom: 2px; }
.event-head__date { color: var(--muted); margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 2px; margin-bottom: 4px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--brand-red); }

.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; border-bottom: 2px solid var(--border); }
.tabs__link { padding: 8px 14px; text-decoration: none; color: var(--text); border-radius: 8px 8px 0 0; margin-bottom: -2px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs__link:hover { background: var(--hover); }
.tabs__link.is-active { color: var(--brand-red); font-weight: 700; border-bottom-color: var(--brand-red); }

/* Status der öffentlichen Seite */
.panel--status { border-left: 6px solid #bbb; }
.status--live { border-left-color: var(--brand-red); }
.status--visible { border-left-color: var(--green); }
.status--waiting { border-left-color: var(--blue); }
.status-line { display: flex; gap: 12px; align-items: flex-start; }
.status-line h3 { color: var(--text); margin-bottom: 2px; }
.status-line p { color: var(--muted); margin: 0; }
.status-dot { flex: none; width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: #bbb; }
.status--live .status-dot { background: var(--brand-red); box-shadow: 0 0 0 4px #fdecec; }
.status--visible .status-dot { background: var(--green); }
.status--waiting .status-dot { background: var(--blue); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }
.facts dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-weight: 600; }

.media-check { margin-top: 14px; }
.media-check summary { cursor: pointer; font-weight: 600; color: var(--brand-red); }
.check-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 8px; 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: 12px; margin-bottom: 18px; }
.toolbar__select { display: flex; gap: 8px; align-items: center; }

.cl-cards { display: grid; gap: 12px; margin-bottom: 20px; }
.cl-card { background: #fff; border: 1px solid var(--border); border-left: 6px solid var(--brand-red); border-radius: 10px; box-shadow: var(--tile-shadow); }
.cl-card__summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; cursor: pointer; list-style: none; }
.cl-card__summary::-webkit-details-marker { display: none; }
.cl-card__summary:hover { background: var(--hover); }
.cl-card__title { display: flex; flex-direction: column; min-width: 0; }
.cl-card__title strong { font-size: 17px; color: var(--brand-red); }
.cl-card__title small { color: var(--muted); }
.cl-card__meta { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.progress-text { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cl-card__chevron { color: var(--brand-red); transition: transform .2s; }
.cl-card[open] .cl-card__chevron { transform: rotate(180deg); }
.cl-card__body { padding: 0 16px 16px; border-top: 1px solid var(--border); }
.cl-notes { padding: 14px 0 0; color: var(--muted); }

.cl-table { margin-top: 8px; }
.cl-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.cl-row:last-child { border-bottom: 0; }
.cl-row--head { font-size: 13px; font-weight: 700; color: var(--brand-red); padding-bottom: 4px; }
.cl-row--new { margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--border); }
.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 90px; display: flex; justify-content: flex-end; gap: 4px; }
.cl-row input:not([type="checkbox"]), .cl-row select { min-height: 38px; padding: 6px 8px; }

.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px; }
.tick.is-on { background: var(--green); border-color: var(--green); color: #fff; }
.tick .icon { width: 16px; height: 16px; stroke-width: 3; }
.toggle-form { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Dateien und Benutzer ---------- */

.file-section { margin-bottom: 24px; }
.file-section .section-title { margin-top: 0; margin-bottom: 2px; }
.file-section > p { text-align: center; }

.file-list, .user-list { list-style: none; margin: 12px 0 20px; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.file-list li + li, .user-list li + li { border-top: 1px solid var(--border); }
.file-item { display: flex; align-items: center; padding-right: 10px; border-left: 4px solid transparent; }
.file-item:hover { border-left-color: var(--brand-red); background: var(--hover); }
.file-item .file-row { flex: 1; min-width: 0; }
.file-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; color: inherit; text-decoration: none; }
.file-row__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--hover); color: var(--brand-red); flex: none; }
.file-row__icon--thumb { overflow: hidden; background: #f7f6f6; }
.file-row__icon--thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-row__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.file-row__text strong { color: var(--brand-red); }
.file-row__text small, .user-row__text small { color: var(--muted); }

.user-row-wrap { padding-bottom: 4px; }
.user-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--brand-red); color: #fff; font-weight: 700; }
.user-row__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.user-edit { margin: 0 14px 12px 66px; }
.user-edit summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--brand-red); }
.user-edit form { margin-top: 12px; }

fieldset.event-boxes { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; }
fieldset.event-boxes legend { margin-bottom: 6px; padding: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; font-size: 14px; }
.check:has(input:checked) { border-color: var(--brand-red); background: var(--hover); }
.check input { width: 18px; height: 18px; }

.dialog { width: min(92vw, 440px); border: 0; border-top: 6px solid var(--brand-red); border-radius: 12px; padding: 24px; background: #fff; color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.dialog::backdrop { background: rgba(42, 42, 42, .55); }
.dialog h3 { color: var(--brand-red); }
.secret { display: flex; align-items: center; gap: 12px; margin: 14px 0 18px; padding: 12px; background: var(--hover); border: 1px solid var(--border); border-radius: 8px; }
.secret code { flex: 1; background: none; border: 0; font-size: 20px; font-weight: 700; letter-spacing: .06em; word-break: break-all; }

/* ---------- Planung: Kopf, Zustand, Gruppen ---------- */

.plan-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 24px; }
.plan-head__select { display: flex; flex-wrap: wrap; gap: 12px; }
.plan-head__select .field { min-width: 170px; }
.plan-head__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.plan-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-head__actions form { margin: 0; }

.plan-state { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .2px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.plan-state--planung { background: var(--green-soft); color: var(--green); }
.plan-state--nachbereitung { background: var(--amber-soft); color: var(--amber); }
.plan-state--archiv { background: #f2f0f0; color: var(--muted); border: 1px solid var(--border); }

.plan-banner { align-items: center; }
.plan-banner form { margin: 0; }
.plan-banner a { font-weight: 600; white-space: nowrap; }
.plan-start { border-left: 6px solid var(--green); }
.plan-start h3 { color: var(--green); }

.cl-group { margin-bottom: 22px; }
.cl-group__title { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--border); }
.cl-group .cl-card + .cl-card { margin-top: 10px; }

progress { width: 70px; height: 8px; vertical-align: middle; accent-color: var(--green); appearance: none; -webkit-appearance: none; border: 0; border-radius: 4px; background: #eee; overflow: hidden; }
progress::-webkit-progress-bar { background: #eee; border-radius: 4px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 4px; }
.progress { display: inline-flex; align-items: center; gap: 6px; }

/* Karte: erst die Zeilen, darunter die Angaben zur Karte */
.cl-form { padding-top: 10px; }
.cl-details { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-top: 16px; padding: 14px; background: #faf8f8; border: 1px solid var(--border); border-radius: 8px; }
.cl-details .field--wide { grid-column: 1 / -1; }
.cl-form__actions { margin-top: 14px; justify-content: space-between; }

.cl-ref { display: block; margin-top: 2px; font-size: 12px; color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-ref.is-same { color: var(--muted); }
.cl-ref-notes { display: block; margin-top: 6px; padding: 8px 10px; font-size: 13px; color: var(--text); background: var(--amber-soft); border-radius: 6px; }

.cl-missing { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding: 10px; border: 1px dashed #f0c27a; border-radius: 8px; background: #fffaf2; }
.cl-missing__title { font-size: 13px; font-weight: 600; color: var(--amber); margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid #f0c27a; border-radius: 999px; background: #fff; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--brand-red); color: var(--brand-red); }
.chip .icon { width: 14px; height: 14px; }

.cl-row--new { background: #fcfcfc; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { color: var(--brand-red); }
.plan-later { text-align: center; margin-top: 10px; }

/* ---------- Startseite: „Als Nächstes“ ---------- */

.event-next { position: relative; margin-bottom: 8px; }
.event-next__label { display: inline-block; margin: 0 0 6px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-red); }
.event-card--next { border-width: 2px; border-left-width: 8px; padding: 18px 18px; }
.event-card--next .event-card__name { font-size: 22px; }
.event-card__plan { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.event-card__links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0 4px; }

/* ---------- Archiv ---------- */

.archive-list { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.archive-item { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: #fff; border: 1px solid var(--border); border-left: 6px solid var(--brand-red); border-radius: 10px; box-shadow: var(--tile-shadow); color: inherit; text-decoration: none; }
.archive-item:hover { background: var(--hover); }
.archive-item.state--archiv { border-left-color: #bbb; }
.archive-item__year { font-size: 26px; font-weight: 800; color: var(--brand-red); min-width: 70px; }
.archive-item.state--archiv .archive-item__year { color: var(--muted); }
.archive-item__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.archive-item__body small { color: var(--muted); }

/* ---------- Drucken (Protokoll) ---------- */

@media print {
  header.topbar, .tabs, .site-footer, .bunny, .back-link, .plan-head__actions, .plan-banner form,
  .cl-form__actions, .cl-cell--actions, .cl-missing, .panel--quiet, .plan-later, .flash__close, .toasts,
  .plan-head__select noscript { display: none !important; }
  body { display: block; }
  .container { padding: 0; max-width: none; }
  .panel, .cl-card { box-shadow: none; break-inside: avoid; }
  .cl-card__chevron { display: none; }
  input, select, textarea { border: 0; padding: 0; min-height: 0; background: none; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Löschen mit Kontrollaufgabe (wie Flohmarkt/Kalenderdienst) ---------- */

.panel--danger { border-color: var(--brand-red); }
.panel--danger h3 { color: var(--brand-red-dark); }
.aufgabe-inline input { max-width: 8em; }
.modal-overlay { position: fixed; inset: 0; background: rgba(42, 42, 42, .55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.modal-overlay[hidden] { display: none !important; }
.modal-box { background: #fff; border-radius: 12px; border-top: 6px solid var(--brand-red); padding: 24px; max-width: 420px; width: 100%; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.modal-box .modal-titel { color: var(--brand-red); margin-top: 0; }
.modal-box p { font-size: 14px; line-height: 1.5; }
.modal-box .modal-frage { font-size: 20px; font-weight: 700; margin: 10px 0; }
.modal-box input { width: 100%; }
.modal-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- Handy und Tablet hochkant (bis 820 px) ---------- */

@media (max-width: 820px) {
  header.topbar { flex-wrap: wrap; row-gap: 14px; padding: 10px 14px; }
  .topbar-logo-link { width: 44px; height: 44px; left: 12px; top: 8px; padding: 0; border-radius: 50%; }
  .topbar-brand { margin-left: 50px; }
  .nav-menu { position: static; }
  .nav-menu nav { top: calc(100% + 4px); left: 12px; right: 12px; min-width: 0; }

  .container { padding: 14px 12px 60px; }
  h1 { font-size: 22px; margin: 6px 0 14px; }
  .panel { padding: 14px; }

  /* Eingabefelder mindestens 16 px: sonst zoomt iOS beim Antippen hinein */
  input, select, textarea { font-size: 16px; min-height: 44px; }
  input[type="checkbox"] { min-height: 0; }

  .cl-details { grid-template-columns: 1fr 1fr; }
  .cl-details .field:first-of-type { grid-column: 1 / -1; }
  .plan-head { align-items: stretch; }
  .plan-head__select, .plan-head__select .field { flex: 1 1 100%; }
  .event-card--next .event-card__name { font-size: 19px; }
  .archive-item { gap: 10px; }
  .archive-item__year { font-size: 20px; min-width: 52px; }
  .bunny { width: 44px; }
}

/* Checklisten-Zeilen auf schmalen Geräten als kleine Karten */
@media (max-width: 640px) {
  .cl-row--head { display: none; }
  .cl-row { flex-wrap: wrap; gap: 8px 12px; padding: 12px 0; }
  .cl-cell[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
  .w-large { flex: 1 1 100%; }
  .w-medium, .w-small { flex: 1 1 calc(50% - 8px); }
  .w-mini { flex: 0 0 auto; text-align: left; }
  .cl-cell--actions { flex: 1 1 100%; justify-content: flex-end; }

  /* Nur-Lese-Zeilen (Helfer, Protokoll) bleiben eine kompakte Zeile */
  .cl-row--view { flex-wrap: nowrap; padding: 8px 0; }
  .cl-row--view .cl-cell[data-label]::before { display: none; }
  .cl-row--view .w-large { flex: 2 1 0; }
  .cl-row--view .w-medium, .cl-row--view .w-small { flex: 1 1 0; }
  .cl-row--view .cl-ref { white-space: normal; }

  /* Bearbeiten: jede Zeile als kleiner Block, Name über die ganze Breite */
  .cl-row--edit .w-mini { order: -1; flex: 0 0 auto; }
  .cl-row--edit .w-large { flex: 1 1 calc(100% - 60px); }
  .cl-row--edit .cl-cell--actions { flex: 1 1 100%; }
  .cl-row--new .cl-cell--actions { display: none; }
  .tabs__link { padding: 8px 9px; }
  .cl-form__actions .btn { flex: 1 1 auto; }
  .modal-knoepfe { flex-direction: column; }
  .modal-knoepfe .btn { width: 100%; }

  .poster-grid { grid-template-columns: 1fr; }
  .event-card { gap: 12px; padding: 12px; }
  .event-card__date { width: 54px; }
  .user-edit { margin-left: 14px; }
  .form-actions .btn { flex: 1 1 auto; }
}

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

/* ---------- Anmeldung über das Benutzerkonto (UMS) ---------- */

.ums-login .card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin: 0 auto 16px; display: grid; gap: 10px; }
.ums-login .card label:not(.check) { font-size: 13px; font-weight: 600; color: var(--text); }
.ums-login .card p { margin: 0; }
.ums-login .btn-voll { width: 100%; justify-content: center; margin-top: 6px; }
.ums-login .btn-secondary { background: #fff; color: var(--brand-red); border: 1px solid var(--brand-red); }
.ums-login .klein { font-size: 14px; }
.ums-login .check { border: 0; padding: 0; border-radius: 0; background: transparent; }
.ums-login .ums-hinweis { text-align: center; }

/* ---------- Planung im neuen Aufbau (Oktober 2026) ---------- */

.w-xs { flex: 0 0 92px; }
.pl-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.pl-toc a { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 13px; text-decoration: none; color: var(--text); }
.pl-toc a:hover { border-color: var(--brand-red); color: var(--brand-red); }
.pl-section { scroll-margin-top: 12px; }
.pl-section--plain { margin: 0 auto 20px; }
.pl-title { font-size: 19px; color: var(--brand-red); margin: 0 0 6px; }
.pl-section__kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.pl-section__kopf::-webkit-details-marker { display: none; }
.pl-section__kopf .pl-title { margin: 0; }
.pl-section__chevron { flex: none; color: var(--brand-red); transition: transform .2s; }
.pl-section[open] > .pl-section__kopf { margin-bottom: 12px; }
.pl-section[open] > .pl-section__kopf .pl-section__chevron { transform: rotate(180deg); }
.pl-section:not([open]) { padding-top: 14px; padding-bottom: 14px; margin-bottom: 10px; }
.pl-section--plain > .pl-section__kopf { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 20px; }
.pl-section--plain[open] > .pl-section__kopf { margin-bottom: 14px; }
.pl-section--plain:not([open]) { padding: 0; }
.pl-sub { font-size: 15px; margin: 18px 0 2px; color: var(--text); }
.pl-sub small { font-weight: 400; }
.pl-liste { padding-top: 4px; }
.pl-liste__actions { margin-top: 10px; justify-content: flex-end; }
.pl-einzel { margin-top: 8px; }
.pl-facts { margin: 8px 0 0; }
.pl-facts__wide { grid-column: 1 / -1; }
.pl-extra { font-size: 13px; }
.pl-stand { margin-bottom: 14px; }
.pl-stand .cl-card__body { padding-top: 10px; }
.pl-stand__delete { margin-top: 16px; text-align: right; }
.pl-add { margin-top: 6px; }
.pl-hinweise { border-left: 6px solid var(--amber); }
.pl-hinweise h3 { color: var(--amber); }
.pl-hinweise ul { margin: 6px 0 0; padding-left: 20px; }
.pl-hinweise--vorjahr { border-left-color: var(--green); }
.pl-hinweise--vorjahr h3 { color: var(--green); }
.pl-preise { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 8px; }
.pl-anzahl { width: 72px; text-align: right; }
.pl-preise th, .pl-preise td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.pl-preise th { color: var(--brand-red); font-size: 13px; }
.pill { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #f2f0f0; color: var(--muted); white-space: nowrap; }
.pill--amber { background: var(--amber-soft); color: var(--amber); }
.pill--green { background: var(--green-soft); color: var(--green); }
.cl-row.is-abgewaehlt { opacity: .5; }
.cl-row.is-variante { background: #fffaf2; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.check--small { padding: 3px 8px 3px 6px; font-size: 13px; }
.pl-liste textarea { min-height: 40px; }

@media print {
  .pl-toc, .pl-liste__actions, .pl-stand__delete, .pl-add, .plan-start, .cl-row--new { display: none !important; }
  .pl-stand[open] .cl-card__body, .pl-stand .cl-card__body { display: block; }
}

@media (max-width: 640px) {
  .w-xs { flex: 1 1 calc(50% - 8px); }
  .cl-row--view .w-xs { flex: 0 0 70px; }
}
.pl-mt { margin-top: 12px; }
.cl-row:has(> .pl-umbruch) { flex-wrap: wrap; }
.pl-umbruch { flex-basis: 100%; height: 0; }
.pl-z2 { flex: 1 1 240px; }
.cl-row--edit .pl-z2 input,
.cl-row--edit .pl-z2 select { min-height: 34px; font-size: 14px; background: #fcfbfb; }

/* ---------- Ausgaben (Aufbauplan, Einkauf, Preisliste, Protokoll) ---------- */

.aus-head { align-items: center; }
.aus-arten { display: flex; flex-wrap: wrap; gap: 6px; }
.aus-arten a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 14px; }
.aus-arten a:hover { border-color: var(--brand-red); color: var(--brand-red); }
.aus-arten a.is-active { background: var(--brand-red); border-color: var(--brand-red); color: #fff; font-weight: 600; }
.aus-druckkopf { display: none; }
.aus-tabelle td { vertical-align: top; }
.aus-tabelle tr.is-variante td { background: #fffaf2; }
.aus-zeit { width: 70px; white-space: nowrap; }
.aus-zahl { text-align: right !important; white-space: nowrap; }
.aus-haken { width: 28px; text-align: center !important; }
.aus-kaestchen { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--muted); border-radius: 3px; vertical-align: middle; }
.aus-quelle { margin-left: 4px; font-size: 11px; }
.aus-legende { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.aus-protokoll h3 { margin-top: 22px; }
.aus-protokoll h3:first-child { margin-top: 0; }
.aus-stand { margin-top: 20px; }

@media print {
  .aus-head, .aus-quelle { display: none !important; }
  .aus-druckkopf { display: block; margin-bottom: 10px; }
  .aus-druckkopf h2 { margin: 0; font-size: 18px; }
  .event-head { display: none; }
  .aus-phase, .aus-liste { break-inside: auto; }
  .aus-tabelle tr { break-inside: avoid; }
}

@media (max-width: 640px) {
  .aus-tabelle { font-size: 13px; }
  .aus-tabelle th, .aus-tabelle td { padding: 4px 5px; }
  .aus-protokoll .aus-tabelle { display: block; overflow-x: auto; }
}
.aus-pdf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.aus-pdf-stand { margin: -6px 0 8px; font-size: 13px; }
form.inline { display: inline; margin: 0; }
.schild-dateien p,
.schild-vorlage,
.schild-bilder { margin: 0 0 10px; }
.schild-bild { display: inline-flex; align-items: center; gap: 2px; margin: 0 8px 4px 0; padding: 2px 4px 2px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; }
.schild-bild .icon-btn { width: 26px; height: 26px; }
fieldset.schild-rand { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(70px, 1fr)); gap: 8px; }
fieldset.schild-rand legend { grid-column: 1 / -1; margin-bottom: 4px; padding: 0; }
fieldset.schild-rand > .field__hint { grid-column: 1 / -1; }
.schild-rand-form { margin: 4px 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.schild-rand-form .form-actions { margin-top: 10px; align-items: center; }

/* ---------- Treffen und Anwesenheit ---------- */

.tr-qr { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 10px 0 16px; }
.tr-qr__bild svg { width: 140px; height: 140px; display: block; }
.tr-link { word-break: break-all; font-size: 12px; }
.tr-tabelle td { vertical-align: middle; }
.tr-aktionen { white-space: nowrap; text-align: right; }
.tr-edit, .tr-neu { margin-top: 6px; }
.tr-edit summary, .tr-neu summary { cursor: pointer; display: inline; }
.tr-edit form, .tr-neu form { margin-top: 10px; text-align: left; white-space: normal; }
.tr-user { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.tr-druck { text-align: center; }
.tr-druck__titel { font-size: 18px; }
.tr-druck__qr svg { width: min(70vw, 420px); height: auto; }
pre.code { white-space: pre-wrap; word-break: break-all; background: #f7f6f6; padding: 10px; border-radius: 6px; }
.eintrag-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.eintrag-form { max-width: 560px; }
.eintrag-ok { border: 0; padding: 0; border-radius: 0; background: none; align-items: flex-start; font-size: 13px; }
.eintrag-ok input { margin-top: 2px; flex: none; }
.field__error { color: var(--brand-red-dark); font-size: 13px; }
.aus-versand fieldset { margin-top: 6px; }

@media print {
  .tr-druck button { display: none; }
}
