/*
  Stylesheet der Anwendung.

  1. Element-Baseline (Reset)
  2. Designsystem: Tokens und Komponenten

  Der frueher hier eingebettete Tailwind-Utility-Snapshot und die alten
  Bespoke-Komponenten (.form-card, .btn, .alert, .user-table, .icon--*) sind
  entfallen, seit alle Templates auf das Designsystem umgestellt sind.
*/
/* Utility baseline adapted for this project */
*,
:after,
:before {
	box-sizing: border-box;
	border: 0 solid #e5e7eb;
}
:host,
html {
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
	-moz-tab-size: 4;
	-o-tab-size: 4;
	tab-size: 4;
	font-family:
		ui-sans-serif,
		system-ui,
		sans-serif,
		Apple Color Emoji,
		Segoe UI Emoji,
		Segoe UI Symbol,
		Noto Color Emoji;
	font-feature-settings: normal;
	font-variation-settings: normal;
	-webkit-tap-highlight-color: transparent;
}
body {
	margin: 0;
	line-height: inherit;
}
hr {
	height: 0;
	color: inherit;
	border-top-width: 1px;
}
abbr:where([title]) {
	-webkit-text-decoration: underline dotted;
	text-decoration: underline dotted;
}
h1,
h2,
h3,
h4,
h5,
h6 {
	font-size: inherit;
	font-weight: inherit;
}
a {
	color: inherit;
	text-decoration: inherit;
}
b,
strong {
	font-weight: bolder;
}
code,
kbd,
pre,
samp {
	font-family:
		ui-monospace,
		SFMono-Regular,
		Menlo,
		Monaco,
		Consolas,
		Liberation Mono,
		Courier New,
		monospace;
	font-feature-settings: normal;
	font-variation-settings: normal;
	font-size: 1em;
}
small {
	font-size: 80%;
}
sub,
sup {
	font-size: 75%;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}
sub {
	bottom: -0.25em;
}
sup {
	top: -0.5em;
}
table {
	text-indent: 0;
	border-color: inherit;
	border-collapse: collapse;
}
button,
input,
optgroup,
select,
textarea {
	font-family: inherit;
	font-feature-settings: inherit;
	font-variation-settings: inherit;
	font-size: 100%;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	color: inherit;
	margin: 0;
	padding: 0;
}
button,
select {
	text-transform: none;
}
button,
input:where([type="button"]),
input:where([type="reset"]),
input:where([type="submit"]) {
	-webkit-appearance: button;
	-moz-appearance: button; /* optional, for older Firefox */
	appearance: button; /* standard property to satisfy the warning */
	background-color: transparent;
	background-image: none;
}
:-moz-focusring {
	outline: auto;
}
:-moz-ui-invalid {
	box-shadow: none;
}
progress {
	vertical-align: baseline;
}
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
	height: auto;
}
[type="search"] {
	-webkit-appearance: textfield;
	-moz-appearance: textfield; /* optional for older Firefox */
	appearance: textfield; /* standard property for compatibility */
	outline-offset: -2px;
}
::-webkit-search-decoration {
	-webkit-appearance: none;
}
::-webkit-file-upload-button {
	-webkit-appearance: button;
	font: inherit;
}
summary {
	display: list-item;
}
blockquote,
dd,
dl,
figure,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
pre {
	margin: 0;
}
fieldset {
	margin: 0;
}
fieldset,
legend {
	padding: 0;
}
menu,
ol,
ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
dialog {
	padding: 0;
}
textarea {
	resize: vertical;
}
input::-moz-placeholder,
textarea::-moz-placeholder {
	opacity: 1;
	color: #9ca3af;
}
input::placeholder,
textarea::placeholder {
	opacity: 1;
	color: #9ca3af;
}
[role="button"],
button {
	cursor: pointer;
}
:disabled {
	cursor: default;
}
audio,
canvas,
embed,
iframe,
img,
object,
svg,
video {
	display: block;
	/* vertical-align: middle; */
}
img,
video {
	max-width: 100%;
	height: auto;
}
[hidden]:where(:not([hidden="until-found"])) {
	display: none;
}
/* ---- Designsystem ---- */
/*
  Semantische Komponenten, aus denen alle Seiten aufgebaut sind: Tokens,
  Kopfzeile, Seitenraster, Karten, Formulare, Tabellen. Utility-Klassen gibt
  es bewusst nicht mehr.
*/
:root {
	--page-bg: #eef2fb;
	--card-bg: #ffffff;
	--line: #e5e9f2;
	--ink: #101623;
	--ink-soft: #4a5261;
	--ink-muted: #6b7787;
	--accent: #2f4fe0;
	--yes: #2f7a4d;
	--yes-soft: #e9f4ed;
	--yes-line: #bfe0cb;
	--open: #d6a832;
	--open-ink: #8a6a12;
	--open-soft: #fdf7e8;
	--open-line: #e6cd8f;
	--no: #a83c37;
	--no-soft: #fbeceb;
	--no-line: #f0c8c5;
	--neutral: #c8d0dd;
	--radius-card: 1.1rem;
	--radius-control: 0.7rem;
	--shadow-card: 0 1px 2px rgba(16, 22, 35, 0.04), 0 8px 24px -18px rgba(16, 22, 35, 0.35);
}

body {
	background: var(--page-bg);
	color: var(--ink);
	font-family:
		"Inter",
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		sans-serif;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* --- Grundgeruest der Seite --- */
.page-body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.page-main {
	flex: 1 0 auto;
	width: 100%;
}

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

/* --- Kopfzeile --- */
.app-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--card-bg);
	border-bottom: 1px solid var(--line);
	padding-top: env(safe-area-inset-top);
}

.app-header__inner {
	max-width: 88rem;
	margin: 0 auto;
	padding: 0.85rem 1rem;
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.app-header__brand {
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink);
	text-decoration: none;
	white-space: nowrap;
}

.app-header__brand:hover {
	text-decoration: none;
}

.app-nav {
	display: flex;
	align-items: center;
	gap: 1.4rem;
	flex: 1 1 auto;
	min-width: 0;
}

.app-nav__link {
	color: var(--ink-soft);
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
	padding: 0.2rem 0;
	border-bottom: 2px solid transparent;
	white-space: nowrap;
}

.app-nav__link:hover {
	color: var(--ink);
	text-decoration: none;
}

.app-nav__link[aria-current="page"] {
	color: var(--ink);
	font-weight: 600;
	border-bottom-color: var(--ink);
}

/* Logout is a POST form so nosurf covers it; the button has to pass for a link. */
.app-nav__logout {
	margin-left: auto;
	display: flex;
}

.app-nav__link--logout {
	color: var(--ink-muted);
	text-align: left;
}

.app-user {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.app-user__name {
	font-weight: 600;
	color: var(--ink);
}

.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 999px;
	background: var(--accent);
	color: #ffffff;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	flex-shrink: 0;
}

.avatar--sm {
	width: 2rem;
	height: 2rem;
	font-size: 0.7rem;
	background: #eef1f7;
	color: var(--ink-soft);
}

.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 0.28rem;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0.5rem;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.nav-toggle__bar {
	display: block;
	height: 2px;
	width: 100%;
	background: var(--ink);
	border-radius: 2px;
}

/* --- Seitenraster --- */
.page {
	max-width: 88rem;
	margin: 0 auto;
	padding: 1.25rem 1rem 3rem;
}

/* Schmalere Varianten fuer Formularseiten. */
.page--md {
	max-width: 46rem;
}

.page--narrow {
	max-width: 30rem;
}

.home-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
	align-items: start;
}

.home-main {
	min-width: 0;
}

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.9rem;
}

.section-label {
	margin: 0;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-muted);
}

.btn-dark {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: #16181d;
	color: #ffffff;
	font-size: 0.92rem;
	font-weight: 600;
	padding: 0.6rem 1.1rem;
	border-radius: var(--radius-control);
	text-decoration: none;
	white-space: nowrap;
}

.btn-dark:hover {
	background: #2b2f38;
	text-decoration: none;
}

.btn-dark__plus {
	font-size: 1.05rem;
	line-height: 1;
}

/* --- Terminkarten --- */
.event-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1rem;
}

.event-card {
	background: var(--card-bg);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-card);
	padding: 1rem 1.1rem;
}

.event-card__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
}

.date-chip {
	order: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 3.9rem;
	padding: 0.4rem 0.25rem;
	border-radius: 0.85rem;
	background: #f1f4fb;
	line-height: 1.1;
	flex-shrink: 0;
}

.date-chip__weekday {
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #5a6bb5;
}

.date-chip__day {
	font-size: 1.45rem;
	font-weight: 700;
	color: var(--ink);
}

.date-chip__month {
	font-size: 0.68rem;
	font-weight: 600;
	color: var(--ink-muted);
}

.event-headline {
	order: 2;
	flex: 1 1 12rem;
	min-width: 0;
}

.event-headline__top {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 0.7rem;
}

.event-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--ink);
	line-height: 1.25;
}

.event-card.is-open .event-title {
	font-size: 1.45rem;
}

.status-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	border-radius: 999px;
	border: 1px solid transparent;
	padding: 0.22rem 0.65rem;
	font-size: 0.82rem;
	font-weight: 600;
	white-space: nowrap;
}

.status-badge--yes {
	background: var(--yes-soft);
	border-color: var(--yes-line);
	color: var(--yes);
}

.status-badge--open {
	background: var(--open-soft);
	border-color: var(--open-line);
	color: var(--open-ink);
}

.status-badge--no {
	background: var(--no-soft);
	border-color: var(--no-line);
	color: var(--no);
}

/* Sektion eines Termins (PROJ-15 AC-25): neutral, damit sie nicht wie ein
   Antwortstatus gelesen wird. */
.status-badge--section {
	background: #fff;
	border-color: var(--line);
	color: var(--ink-soft);
}

.event-meta {
	margin: 0.35rem 0 0;
	color: var(--ink-muted);
	font-size: 0.95rem;
}

/* --- Fortschritt --- */
.event-progress {
	order: 4;
	flex: 1 1 55%;
	min-width: 0;
}

/* Im aufgeklappten Zustand steht der Balken auf einer eigenen Zeile. */
.event-card.is-open .event-progress {
	flex-basis: 100%;
	margin-top: 0.35rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--line);
}

.progress {
	display: flex;
	height: 0.5rem;
	border-radius: 999px;
	overflow: hidden;
	background: var(--neutral);
}

.progress__seg {
	display: block;
	height: 100%;
}

.progress__seg--yes {
	background: var(--yes);
}

.progress__seg--open {
	background: var(--open);
}

.progress__seg--no {
	background: var(--no);
}

.progress-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 0.9rem;
	margin: 0.45rem 0 0;
	font-size: 0.92rem;
	font-weight: 600;
}

.legend--yes {
	color: var(--yes);
}

.legend--open {
	color: var(--open-ink);
}

.legend--no {
	color: var(--ink-muted);
	font-weight: 500;
}

.event-card:not(.is-open) .legend--no {
	display: none;
}

/* --- Schnellauswahl --- */
.rsvp {
	order: 5;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
}

.rsvp__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 2.9rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-control);
	background: var(--card-bg);
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease;
}

.rsvp__btn--yes {
	color: var(--yes);
}

.rsvp__btn--open {
	color: var(--open-ink);
}

.rsvp__btn--no {
	color: var(--no);
}

.rsvp__btn:hover {
	border-color: #cdd5e4;
	background: #f7f9fd;
}

.rsvp__btn--yes.is-active {
	background: var(--yes);
	border-color: var(--yes);
	color: #ffffff;
}

.rsvp__btn--open.is-active {
	background: var(--open);
	border-color: var(--open);
	color: #3d3009;
}

.rsvp__btn--no.is-active {
	background: var(--no);
	border-color: var(--no);
	color: #ffffff;
}

.rsvp__btn:focus-visible,
.event-toggle:focus-visible,
.declined-toggle:focus-visible,
.nav-toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* --- Auf- und Zuklappen --- */
.event-toggle {
	order: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	background: transparent;
	color: var(--ink-muted);
	cursor: pointer;
	flex-shrink: 0;
}

.event-toggle__chevron {
	display: block;
	width: 0.55rem;
	height: 0.55rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.15s ease;
}

.event-card.is-open .event-toggle__chevron {
	transform: translateY(2px) rotate(225deg);
}

.event-body {
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--line);
}

.js .event-card:not(.is-open) .event-body {
	display: none;
}

/* --- Teilnehmer --- */
.member-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr));
	gap: 0.5rem;
}

.chip {
	display: block;
	text-align: center;
	padding: 0.45rem 0.35rem;
	border-radius: 0.6rem;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid transparent;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.chip:hover {
	text-decoration: none;
	filter: brightness(0.97);
}

.chip--yes {
	background: var(--yes);
	color: #ffffff;
}

.chip--open {
	background: #fdf9ee;
	border: 1px dashed var(--open-line);
	color: var(--open-ink);
}

.chip--no {
	background: var(--no-soft);
	border-color: var(--no-line);
	color: var(--no);
}

.declined-toggle {
	display: none;
	margin-top: 0.85rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--accent);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

/* --- Mitteilungen --- */
.card {
	background: var(--card-bg);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-card);
	padding: 1.15rem 1.25rem 1.25rem;
}

.card__title {
	margin: 0 0 0.9rem;
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--ink);
}

.message-textarea {
	display: block;
	width: 100%;
	min-height: 6.5rem;
	padding: 0.75rem 0.9rem;
	border: 1px solid #dfe4ee;
	border-radius: var(--radius-control);
	background: #fbfcfe;
	color: var(--ink);
	font: inherit;
	line-height: 1.45;
	resize: none;
	overflow-y: auto;
}

.message-textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(47, 79, 224, 0.15);
}

.message-form__actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 0.9rem;
	flex-wrap: wrap;
}

.switch {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	cursor: pointer;
}

.switch__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.switch__track {
	position: relative;
	display: inline-block;
	width: 2.75rem;
	height: 1.6rem;
	border-radius: 999px;
	background: #d7dded;
	transition: background 0.15s ease;
	flex-shrink: 0;
}

.switch__thumb {
	position: absolute;
	top: 0.2rem;
	left: 0.2rem;
	width: 1.2rem;
	height: 1.2rem;
	border-radius: 999px;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(16, 22, 35, 0.25);
	transition: transform 0.15s ease;
}

.switch__input:checked + .switch__track {
	background: var(--accent);
}

.switch__input:checked + .switch__track .switch__thumb {
	transform: translateX(1.15rem);
}

.switch__input:focus-visible + .switch__track {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.switch__label {
	color: var(--ink-soft);
	font-size: 0.95rem;
}

.message-list {
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0;
}

.message-item {
	padding: 1rem 0;
	border-top: 1px solid var(--line);
}

.message-item__head {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.message-item__author {
	font-weight: 700;
	color: var(--ink);
}

.message-item__time {
	font-size: 0.85rem;
	color: var(--ink-muted);
}

.message-item__text {
	margin: 0.55rem 0 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	color: var(--ink);
}

.empty-state {
	background: var(--card-bg);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	padding: 2rem 1rem;
	text-align: center;
	color: var(--ink-muted);
}

.empty-hint {
	margin: 0.5rem 0 0;
	color: var(--ink-muted);
	font-size: 0.95rem;
}

/* --- Schmale Viewports --- */
@media (max-width: 767.98px) {
	.js .app-nav {
		display: none;
		order: 4;
		flex-basis: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0.25rem;
		padding-top: 0.5rem;
		border-top: 1px solid var(--line);
	}

	.js .app-header.is-nav-open .app-nav {
		display: flex;
	}

	.app-nav__link {
		padding: 0.6rem 0;
	}

	.app-nav__logout {
		margin-left: 0;
	}

	.js .nav-toggle {
		display: flex;
		order: 3;
	}

	.app-user {
		order: 2;
		margin-left: auto;
	}

	.app-user__name {
		display: none;
	}

	.section-label {
		font-size: 0.72rem;
		letter-spacing: 0.1em;
	}

	.btn-dark {
		padding: 0.55rem 0.8rem;
		font-size: 0.85rem;
	}

	/* Der Chevron sitzt in der oberen rechten Ecke der Karte. */
	.event-card {
		position: relative;
		padding: 0.9rem 1rem;
	}

	.event-card__head {
		align-items: flex-start;
		gap: 0.65rem 0.75rem;
	}

	.event-headline {
		padding-right: 1.75rem;
	}

	/* Der Statushinweis steht immer unter dem Titel, nie daneben. */
	.event-headline__top {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.35rem;
	}

	/* Datum, Uhrzeit und Abstand sollen in einer Zeile bleiben. */
	.event-meta {
		font-size: 0.8rem;
	}

	.event-toggle {
		position: absolute;
		top: 0.6rem;
		right: 0.5rem;
	}

	.event-progress {
		flex: 1 1 45%;
		align-self: center;
	}

	.rsvp {
		align-self: center;
	}

	/* Im aufgeklappten Zustand steht der Balken allein in seiner Zeile,
	   die Schnellauswahl rueckt darunter nach links. */
	.event-card.is-open .rsvp {
		margin-left: 0;
	}

	.rsvp__btn {
		width: 2.6rem;
		height: 2.6rem;
		font-size: 1rem;
	}

	/* Fuenf Teilnehmer je Reihe; die Schrift ist entsprechend kleiner. */
	.member-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 0.4rem;
	}

	.chip {
		padding: 0.4rem 0.25rem;
		font-size: 0.62rem;
	}

	/* Absagen werden erst auf Tippen sichtbar, sonst wird die Liste zu lang. */
	.js .event-card:not(.show-declined) .member-grid__item--declined {
		display: none;
	}

	.js .declined-toggle {
		display: inline-block;
	}
}

@media (min-width: 768px) {
	.event-progress {
		order: 3;
		flex: 0 0 14rem;
	}

	.rsvp {
		order: 4;
	}

	.event-toggle {
		order: 5;
	}

	.event-card.is-open .event-progress {
		order: 6;
	}

	.member-grid {
		grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
	}

	.event-card {
		padding: 1.15rem 1.35rem;
	}
}

@media (min-width: 1024px) {
	.home-layout {
		grid-template-columns: minmax(0, 1fr) 26rem;
		gap: 1.5rem;
	}

	.home-sidebar {
		position: sticky;
		top: 6rem;
	}

	.page {
		padding: 1.75rem 1.5rem 3rem;
	}
}

/* ---- New design: Seiten, Formulare, Feedback ---- */
/*
  Gemeinsame Bausteine der uebrigen Seiten. Die Namen sind bewusst anders
  gewaehlt als in der Alt-Schicht (.form-*, .btn-*, .alert), damit beide
  Schichten waehrend der Migration nebeneinander bestehen koennen.
*/

/* --- Seitenkopf --- */
.page-head {
	margin-bottom: 1.25rem;
}

.page-title {
	margin: 0;
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--ink);
	line-height: 1.2;
}

.page-lead {
	margin: 0.4rem 0 0;
	color: var(--ink-muted);
	font-size: 0.98rem;
}

/* Mehrere Karten untereinander auf einer Seite. */
.card + .card {
	margin-top: 1.25rem;
}

/* --- Kartenkopf mit Beschreibung --- */
.card__head {
	margin-bottom: 1.1rem;
}

.card__head .card__title {
	margin-bottom: 0.3rem;
}

.card__lead {
	margin: 0;
	color: var(--ink-muted);
	font-size: 0.95rem;
}

/* --- Hinweise --- */
.notice {
	margin: 0 0 1rem;
	padding: 0.75rem 0.95rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-control);
	font-size: 0.95rem;
	font-weight: 500;
}

.notice--error {
	background: var(--no-soft);
	border-color: var(--no-line);
	color: var(--no);
}

.notice--ok {
	background: var(--yes-soft);
	border-color: var(--yes-line);
	color: var(--yes);
}

/* --- Fusszeile --- */
.app-footer {
	flex-shrink: 0;
	padding: 0 1rem 1.5rem;
	text-align: center;
}

.app-footer__link {
	font-size: 0.85rem;
	color: var(--ink-muted);
	text-decoration: none;
}

.app-footer__version {
	margin-left: 1rem;
	font-size: 0.85rem;
	color: var(--ink-muted);
}

.app-footer__link:hover,
.app-footer__link[aria-current="page"] {
	color: var(--accent);
	text-decoration: underline;
}

/* --- Fliesstext-Seiten (Datenschutzerklaerung) --- */
.page--prose {
	max-width: 52rem;
}

.legal {
	color: var(--ink-soft);
	line-height: 1.6;
}

.legal h2 {
	margin: 1.75rem 0 0.6rem;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--ink);
}

.legal h3 {
	margin: 1.25rem 0 0.4rem;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--ink);
}

.legal p {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
}

.legal ul {
	margin: 0 0 0.9rem;
	padding-left: 1.2rem;
	font-size: 0.95rem;
}

.legal li {
	margin-bottom: 0.35rem;
}

.legal strong {
	color: var(--ink);
}

.legal code {
	padding: 0.05rem 0.3rem;
	border: 1px solid var(--line);
	border-radius: 0.35rem;
	background: var(--page-bg);
	font-size: 0.85em;
}

.legal__address {
	padding-left: 0.9rem;
	border-left: 3px solid var(--line);
}

/* Der Widerspruchshinweis muss sich vom Fliesstext abheben (Art. 21 Abs. 4). */
.legal__callout {
	padding: 0.75rem 0.95rem;
	border: 1px solid var(--open-line);
	border-radius: var(--radius-control);
	background: var(--open-soft);
	color: var(--ink);
}

.legal__updated {
	margin-top: 1.75rem;
	font-size: 0.85rem;
	color: var(--ink-muted);
}

/* --- Formulare --- */
.form-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
}

.form-row + .form-row {
	margin-top: 1rem;
}

@media (min-width: 640px) {
	.form-row--split {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.form-row--auto {
		grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	}
}

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

.field__label {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ink-soft);
}

.field__note {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--ink-muted);
}

.field__hint {
	margin: 0.1rem 0 0;
	font-size: 0.85rem;
	color: var(--ink-muted);
}

.control {
	display: block;
	width: 100%;
	min-height: 2.85rem;
	padding: 0.65rem 0.85rem;
	border: 1px solid #dfe4ee;
	border-radius: var(--radius-control);
	background: #fbfcfe;
	color: var(--ink);
	font: inherit;
	line-height: 1.4;
	appearance: none;
	-webkit-appearance: none;
}

.control:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(47, 79, 224, 0.15);
}

/* Eine Auswahlliste behält den Pfeil des Browsers; .control nimmt ihn sonst
   mit appearance: none weg, und ein Bild dafür ließe die CSP nicht zu. */
select.control {
	appearance: auto;
	-webkit-appearance: menulist;
}

.control::placeholder {
	color: #98a1b0;
}

.control--sm {
	min-height: 2.4rem;
	padding: 0.45rem 0.7rem;
	font-size: 0.92rem;
}

/* --- Passwortfeld mit Augensymbol (PROJ-17, www/js/password.js) ---
   Das Symbol ist eine CSS-Maske aus einem data:-SVG und nimmt die Textfarbe
   an; die CSP erlaubt data: für Bilder bereits. */
.password-field {
	position: relative;
	min-width: 0;
}

.password-field .control {
	padding-right: 2.75rem;
}

.password-field .control--sm {
	padding-right: 2.5rem;
}

/* Edge bringt ein eigenes Aufdecken-Symbol mit; nur unseres soll erscheinen.
   Zwei getrennte Regeln: Ein Browser, der einen der beiden Selektoren nicht
   kennt, verwirft sonst die ganze Regel. */
.password-field .control::-ms-reveal {
	display: none;
}

.password-field .control::-ms-clear {
	display: none;
}

.password-toggle {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	min-height: 2.4rem;
	padding: 0;
	border: 0;
	border-radius: var(--radius-control);
	background: transparent;
	color: var(--ink-muted);
	cursor: pointer;
}

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

.password-toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}

.password-toggle__icon {
	display: block;
	width: 1.15rem;
	height: 1.15rem;
	background-color: currentColor;
	-webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
	mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.password-toggle[aria-pressed="true"] .password-toggle__icon {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}

.form-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1.25rem;
}

.form-buttons--end {
	justify-content: flex-end;
}

.form-buttons--between {
	justify-content: space-between;
}

/* --- Schaltflaechen --- */
.btn-accent,
.btn-quiet,
.btn-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.65rem 1.4rem;
	border: 1px solid transparent;
	border-radius: var(--radius-control);
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.btn-accent {
	background: var(--accent);
	color: #ffffff;
}

.btn-accent:hover {
	background: #2743c4;
	text-decoration: none;
}

.btn-quiet {
	background: var(--card-bg);
	border-color: var(--line);
	color: var(--ink-soft);
}

.btn-quiet:hover {
	background: #f7f9fd;
	color: var(--ink);
	text-decoration: none;
}

.btn-remove {
	background: var(--no-soft);
	border-color: var(--no-line);
	color: var(--no);
}

.btn-remove:hover {
	background: var(--no);
	color: #ffffff;
	text-decoration: none;
}

.btn-sm {
	padding: 0.42rem 0.85rem;
	font-size: 0.88rem;
}

.btn-block {
	width: 100%;
}

.btn-accent:focus-visible,
.btn-quiet:focus-visible,
.btn-remove:focus-visible,
.btn-dark:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* --- Dezenter Textlink --- */
/* Nebenwege, die neben einer Schaltflaeche stehen und nicht mit ihr um
   Aufmerksamkeit konkurrieren sollen. Farbe und Unterstreichung kommen von der
   Grundregel fuer a. */
.link-quiet {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.95rem;
	font-weight: 600;
}

/* --- Schalter mit Beschreibung --- */
.switch--stack {
	align-items: flex-start;
}

.switch--stack .switch__track {
	margin-top: 0.15rem;
}

.switch__text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.switch__desc {
	font-size: 0.85rem;
	color: var(--ink-muted);
}

/* --- Statusauswahl --- */
.status-choice {
	display: grid;
	gap: 0.6rem;
}

.status-choice__option {
	display: flex;
	align-items: flex-start;
	gap: 0.8rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-control);
	background: var(--card-bg);
	cursor: pointer;
}

.status-choice__option:hover {
	background: #f7f9fd;
}

.status-choice__input {
	width: 1.15rem;
	height: 1.15rem;
	margin: 0.15rem 0 0;
	flex-shrink: 0;
	accent-color: var(--accent);
}

.status-choice__input:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.status-choice__text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.status-choice__title {
	font-weight: 700;
	color: var(--ink);
}

.status-choice__note {
	font-size: 0.88rem;
	color: var(--ink-muted);
}

/* Die gewaehlte Option wird eingefaerbt; ohne :has()-Unterstuetzung bleibt
   nur der Radio-Button markiert. */
.status-choice__option--yes .status-choice__input {
	accent-color: var(--yes);
}

.status-choice__option--no .status-choice__input {
	accent-color: var(--no);
}

.status-choice__option--open .status-choice__input {
	accent-color: var(--open);
}

.status-choice__option--yes:has(.status-choice__input:checked) {
	background: var(--yes-soft);
	border-color: var(--yes-line);
}

.status-choice__option--no:has(.status-choice__input:checked) {
	background: var(--no-soft);
	border-color: var(--no-line);
}

.status-choice__option--open:has(.status-choice__input:checked) {
	background: var(--open-soft);
	border-color: var(--open-line);
}

/* --- Kachelraster (Admin-Dashboard) --- */
.tile-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
}

@media (min-width: 640px) {
	.tile-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.tile {
	display: block;
	padding: 1.15rem 1.25rem;
	background: var(--card-bg);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-card);
	text-decoration: none;
	color: inherit;
}

.tile:hover {
	border-color: #cdd5e4;
	background: #f7f9fd;
	text-decoration: none;
}

.tile__title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--ink);
}

.tile__text {
	margin: 0.35rem 0 0;
	font-size: 0.92rem;
	color: var(--ink-muted);
}

/* --- Datentabellen --- */
.data-table__scroll {
	overflow-x: auto;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.94rem;
}

.data-table th {
	padding: 0.55rem 0.75rem;
	text-align: left;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-muted);
	border-bottom: 1px solid var(--line);
	white-space: nowrap;
}

.data-table td {
	padding: 0.7rem 0.75rem;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	vertical-align: top;
}

.data-table tbody tr:last-child td {
	border-bottom: 0;
}

.data-table__cell--wrap {
	min-width: 14rem;
	overflow-wrap: anywhere;
}

.data-table__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}

/* --- Aktionszeile der Mitgliedertabelle --- */
/*
  Die Aktionen stehen in einer eigenen Tabellenzeile unter den Daten des
  Mitglieds. Dadurch steht ihnen die volle Tabellenbreite zur Verfuegung und
  alle Schaltflaechen passen gleich breit in eine Reihe.
*/
.member-row td {
	border-bottom: 0;
}

.member-row--actions td {
	padding-top: 0.15rem;
}

.row-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: flex-start;
}

.row-actions > form,
.row-actions > .row-edit {
	flex: 0 0 9rem;
}

.row-actions .btn-sm,
.row-actions .row-edit__summary {
	width: 100%;
}

/* --- Zeilen-Editor (natives details/summary) --- */
.row-edit {
	position: relative;
}

.row-edit__summary {
	display: inline-block;
	text-align: center;
	padding: 0.42rem 0.85rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-control);
	background: var(--card-bg);
	color: var(--ink-soft);
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.row-edit__summary::-webkit-details-marker {
	display: none;
}

.row-edit[open] .row-edit__summary {
	background: #f7f9fd;
	color: var(--ink);
}

.row-edit__panel {
	display: grid;
	gap: 0.5rem;
	margin-top: 0.6rem;
	padding: 0.85rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-control);
	background: #fbfcfe;
	min-width: 13rem;
}

.row-edit__hint {
	margin: 0;
	font-size: 0.82rem;
	color: var(--ink-muted);
}

/* Auf breiten Viewports schwebt der Editor ueber der Zeile, damit das
   Aufklappen die Aktionsreihe nicht auseinanderdrueckt. */
@media (min-width: 768px) {
	.row-edit__panel {
		position: absolute;
		top: 100%;
		right: 0;
		z-index: 5;
		width: 17rem;
		box-shadow: var(--shadow-card);
	}

	/* Der Scroll-Container wuerde das schwebende Panel sonst abschneiden. */
	.data-table__scroll:has(.row-edit[open]) {
		overflow: visible;
	}
}

/* --- Auswahlliste zum Aufklappen (natives details/summary) ---
   "Weitere Mitglieder einladen" auf /create (PROJ-15 AC-35). Zugeklappt
   kostet sie eine Zeile; lange Listen scrollen in sich, damit der
   Speichern-Knopf erreichbar bleibt. */
.picker {
	border: 1px solid var(--line);
	border-radius: var(--radius-control);
	background: var(--card-bg);
}

.picker__summary {
	padding: 0.6rem 0.85rem;
	color: var(--ink-soft);
	font-size: 0.92rem;
	font-weight: 600;
	cursor: pointer;
	user-select: none;
}

.picker[open] .picker__summary {
	color: var(--ink);
	border-bottom: 1px solid var(--line);
}

.picker__panel {
	display: grid;
	gap: 0.6rem;
	padding: 0.85rem;
	background: #fbfcfe;
	border-radius: 0 0 var(--radius-control) var(--radius-control);
}

.picker__panel .field__hint {
	margin: 0;
}

.picker__list {
	display: grid;
	gap: 0.5rem;
	max-height: 18rem;
	overflow-y: auto;
}

/* --- Filterleiste --- */
.filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75rem;
	margin-bottom: 1.1rem;
}

.filter-bar .field {
	width: 9rem;
}

/* --- Wartungsseite --- */
.maintenance-card {
	text-align: center;
	margin-top: 2rem;
}

.maintenance-card__text {
	margin: 0;
	color: var(--ink-soft);
	line-height: 1.6;
}

/* --- Termin-Kopf auf der Detailseite --- */
.event-summary {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1rem;
}

.event-summary__text {
	min-width: 0;
}

.event-summary .event-title {
	font-size: 1.45rem;
}

/* --- Schmale Viewports (neue Seiten) --- */
@media (max-width: 767.98px) {
	.page-title {
		font-size: 1.35rem;
	}

	.form-buttons--between,
	.form-buttons--end {
		justify-content: stretch;
	}

	.form-buttons--between .btn-accent,
	.form-buttons--between .btn-quiet,
	.form-buttons--end .btn-accent,
	.form-buttons--end .btn-quiet {
		flex: 1 1 auto;
	}

	/* Tabellenzeilen werden zu Karten mit vorangestellter Spaltenbezeichnung. */
	.data-table,
	.data-table tbody,
	.data-table tr,
	.data-table td {
		display: block;
		width: 100%;
	}

	.data-table thead {
		display: none;
	}

	.data-table tr {
		margin-bottom: 0.75rem;
		padding: 0.8rem 0.9rem;
		border: 1px solid var(--line);
		border-radius: var(--radius-card);
		background: var(--card-bg);
	}

	.data-table tr:last-child {
		margin-bottom: 0;
	}

	.data-table td {
		padding: 0.28rem 0;
		border-bottom: 0;
	}

	.data-table td[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 0.72rem;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: var(--ink-muted);
	}

	/* Daten- und Aktionszeile eines Mitglieds bilden zusammen eine Karte. */
	.data-table .member-row {
		margin-bottom: 0;
		border-bottom: 0;
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
		padding-bottom: 0;
	}

	.data-table .member-row--actions {
		border-top: 0;
		border-top-left-radius: 0;
		border-top-right-radius: 0;
		padding-top: 0;
	}

	/* Zwei gleich breite Spalten; "Loeschen" steht darunter in voller Breite. */
	.row-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		margin-top: 0.5rem;
	}

	.row-actions > form {
		display: flex;
	}

	.row-actions > form > .btn-sm {
		flex: 1;
	}

	.row-actions > form:last-child,
	.row-actions > .row-edit[open] {
		grid-column: 1 / -1;
	}

	.filter-bar .field {
		width: 100%;
	}
}

/* ---------------------------------------------------------------------------
   SPA states (event2verifyApp): the loading line while a page fetches its
   data, and the banner that says the page shows cached data without a
   connection.
   --------------------------------------------------------------------------- */

.page-loading {
	margin: 2rem auto;
	text-align: center;
	color: var(--ink-muted);
}

.offline-banner {
	margin: 0 auto;
	padding: 0.6rem 1rem;
	background: var(--open-soft);
	border-bottom: 1px solid var(--open-line);
	color: var(--open-ink);
	font-size: 0.9rem;
	text-align: center;
}

.offline-banner[hidden] {
	display: none;
}

button[disabled],
.btn-accent[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}
