/* Vereins-Dienstplan – übernimmt Schrift vom Theme, setzt eigene Grundwerte gegen Theme-Überschreibungen */
.vdp {
	--vdp-accent: #1d6b4f;
	--vdp-accent-ink: #fff;
	--vdp-line: rgba(0, 0, 0, .14);
	--vdp-soft: rgba(0, 0, 0, .04);
	--vdp-mine: rgba(29, 107, 79, .12);
	--vdp-err: #a4262c;
	--vdp-ok: #1d6b4f;
	--vdp-radius: 8px;
	font-size: 15px;
	line-height: 1.4;
	margin: 1.5em auto;
	width: 100%;
	max-width: 1700px;
	container-type: inline-size;
	container-name: vdp;
}

.vdp *,
.vdp *::before,
.vdp *::after { box-sizing: border-box; }
.vdp p { margin: 0; }
.vdp ul { margin: 0; }

/* Navigation */
.vdp-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75em;
	margin: 0 0 1em;
}
.vdp-nav-title { text-align: center; display: flex; flex-direction: column; min-width: 0; }
.vdp-nav-title strong { font-size: 1.15em; }
.vdp-nav-title span { opacity: .75; font-size: .9em; }
.vdp-nav-btn {
	text-decoration: none;
	padding: .5em .9em;
	border: 1px solid var(--vdp-line);
	border-radius: var(--vdp-radius);
	white-space: nowrap;
	min-height: 40px;
	display: inline-flex;
	align-items: center;
}
.vdp-today { font-size: .85em; text-decoration: underline; }
.vdp-nav-bottom { margin-top: 1em; }

/* Meldungen */
.vdp-msg {
	padding: .6em .9em;
	border-radius: var(--vdp-radius);
	margin-bottom: 1em;
	border-left: 4px solid currentColor;
	background: var(--vdp-soft);
}
.vdp-msg-ok { color: var(--vdp-ok); }
.vdp-msg-err { color: var(--vdp-err); }
.vdp-msg-info { border-left-color: var(--vdp-line); }
.vdp-msg ul { padding-left: 1.2em; }

/* Wochen */
.vdp-week { margin-bottom: 1.5em; }
.vdp-week-head {
	display: flex;
	align-items: baseline;
	gap: .6em;
	font-weight: 700;
	font-size: 1.05em;
	padding-bottom: .3em;
	margin-bottom: .6em;
	border-bottom: 2px solid var(--vdp-line);
}
.vdp-week-range { font-weight: 400; opacity: .7; font-size: .85em; }

/* Tage: Spaltenzahl richtet sich nach der verfügbaren Breite; eine unvollständige letzte Reihe wird zentriert. */
.vdp-days {
	--vdp-cols: 1;
	--vdp-gap: .75em;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--vdp-gap);
}
.vdp-days > .vdp-day {
	flex: 0 0 calc((100% - (var(--vdp-cols) - 1) * var(--vdp-gap)) / var(--vdp-cols));
}
@container vdp (min-width: 640px)  { .vdp-days { --vdp-cols: 2; } }
@container vdp (min-width: 960px)  { .vdp-days { --vdp-cols: 3; } }
@container vdp (min-width: 1560px) { .vdp-days { --vdp-cols: 5; } }

/* Tagestabelle: Bereiche × Zeitblöcke */
.vdp .vdp-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 0;
	border: 0;
	font-size: .92em;
}
.vdp .vdp-table th,
.vdp .vdp-table td {
	padding: .35em .4em;
	border: 0;
	border-top: 1px solid var(--vdp-line);
	vertical-align: middle;
	text-align: left;
	background: none;
	word-wrap: break-word;
}
.vdp .vdp-table thead th {
	border-top: 0;
	font-weight: 600;
	font-size: .82em;
	opacity: .7;
	font-variant-numeric: tabular-nums;
	padding-bottom: .25em;
}
.vdp .vdp-table .vdp-th-area,
.vdp .vdp-table .vdp-area { width: 30%; }
.vdp .vdp-table .vdp-area { font-weight: 600; }
.vdp .vdp-table td.is-mine { background: var(--vdp-mine); }
.vdp .vdp-table td.is-past { opacity: .6; }
.vdp-cell .vdp-btn { min-height: 32px; padding: .3em .4em; font-size: .92em; }
.vdp-n { display: flex; justify-content: space-between; align-items: center; gap: .3em; min-height: 32px; }
.vdp-n.is-me span:first-child { font-weight: 700; }
.vdp-cell .vdp-assign { margin-top: .3em; }
.vdp-slot-blocked { text-align: center; font-style: italic; padding: .6em; background: var(--vdp-soft); border-radius: calc(var(--vdp-radius) - 2px); }

/* Tage */
.vdp-day {
	border: 1px solid var(--vdp-line);
	border-radius: var(--vdp-radius);
	padding: .55em;
	display: flex;
	flex-direction: column;
	gap: .45em;
	min-width: 0;
}
.vdp-day.is-today { border-color: var(--vdp-accent); box-shadow: 0 0 0 1px var(--vdp-accent); }
.vdp-day.is-blocked,
.vdp-day.is-pastday { opacity: .55; }

.vdp-day-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-weight: 600;
}
.vdp-date { font-weight: 400; opacity: .7; font-size: .9em; }

/* Blöcke */
.vdp-slot {
	background: var(--vdp-soft);
	border-radius: calc(var(--vdp-radius) - 2px);
	padding: .5em .55em;
	display: flex;
	flex-direction: column;
	gap: .4em;
	min-width: 0;
}
.vdp-slot.is-mine { background: var(--vdp-mine); }
.vdp-slot.is-past { opacity: .6; }
.vdp-slot-blocked { text-align: center; font-style: italic; }

.vdp-slot-head { display: flex; justify-content: space-between; gap: .3em; font-weight: 600; }
.vdp-cap { font-weight: 400; opacity: .65; font-size: .85em; font-variant-numeric: tabular-nums; }
.vdp-time { font-variant-numeric: tabular-nums; }

.vdp-names { list-style: none; padding: 0; }
.vdp-names li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: .4em;
	padding: .1em 0;
	overflow-wrap: anywhere;
}
.vdp-names li.is-me span:first-child { font-weight: 700; }

.vdp-free,
.vdp-anon { opacity: .65; font-size: .9em; }
.vdp-hint { font-size: .75em; opacity: .6; }
.vdp-muted { opacity: .7; }

/* Bedienelemente */
.vdp-form { margin: 0; }
.vdp-inline { display: inline; }

.vdp .vdp-btn {
	width: 100%;
	cursor: pointer;
	border: 0;
	border-radius: calc(var(--vdp-radius) - 2px);
	padding: .5em .6em;
	min-height: 38px;
	background: var(--vdp-accent);
	color: var(--vdp-accent-ink);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
}
.vdp .vdp-btn:hover { filter: brightness(1.1); }
.vdp .vdp-btn-sec { width: auto; background: transparent; color: inherit; border: 1px solid var(--vdp-line); font-weight: 400; }

.vdp .vdp-x {
	cursor: pointer;
	border: 1px solid var(--vdp-line);
	background: transparent;
	color: inherit;
	border-radius: 50%;
	width: 30px;
	height: 30px;
	min-height: 0;
	line-height: 1;
	padding: 0;
	font-size: 1.05em;
	flex: none;
}
.vdp .vdp-x:hover { color: var(--vdp-err); border-color: var(--vdp-err); }

.vdp-assign { display: flex; gap: .3em; }
.vdp-assign select { flex: 1; min-width: 0; font: inherit; font-size: .85em; padding: .2em; }

/* Anmeldung / Registrierung */
.vdp-auth {
	border: 1px solid var(--vdp-line);
	border-radius: var(--vdp-radius);
	padding: 1em;
	margin-bottom: 1.25em;
	display: flex;
	flex-direction: column;
	gap: .75em;
	max-width: 560px;
	margin-left: auto;
	margin-right: auto;
}
.vdp-auth-title { font-size: 1.15em; font-weight: 700; }
.vdp-sub, .vdp-note { opacity: .75; font-size: .9em; }
.vdp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75em; }
.vdp-field { display: flex; flex-direction: column; gap: .3em; font-weight: 600; font-size: .9em; margin: 0; }
.vdp-field small { font-weight: 400; opacity: .7; }
.vdp .vdp-field input {
	font: inherit;
	font-weight: 400;
	padding: .55em .65em;
	border: 1px solid var(--vdp-line);
	border-radius: calc(var(--vdp-radius) - 2px);
	width: 100%;
	max-width: 100%;
	min-height: 42px;
	margin: 0;
	background: #fff;
	color: #222;
}
.vdp-check { display: flex; gap: .5em; align-items: center; font-size: .9em; }
.vdp-check input { margin: 0; flex: none; width: 18px; height: 18px; }
.vdp-links { font-size: .9em; line-height: 1.6; }
.vdp-auth .vdp-btn { width: auto; align-self: flex-start; padding: .6em 1.6em; }
.vdp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.vdp-pinbox { border-color: var(--vdp-accent); border-width: 2px; }
.vdp-pin {
	font-size: 2.4em;
	font-weight: 700;
	letter-spacing: .2em;
	font-variant-numeric: tabular-nums;
	text-align: center;
	padding: .2em 0;
	background: var(--vdp-mine);
	border-radius: var(--vdp-radius);
}

.vdp-userbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1em;
	padding: .5em .8em;
	margin-bottom: 1em;
	background: var(--vdp-soft);
	border-radius: var(--vdp-radius);
	font-size: .9em;
}

.vdp-userlinks { display: flex; gap: 1em; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Tablet & Handy ---------- */
@media (max-width: 640px) {
	.vdp { font-size: 16px; }

	.vdp-nav-txt { display: none; }
	.vdp-nav-btn { padding: .5em .9em; font-size: 1.1em; min-height: 44px; min-width: 44px; justify-content: center; }
	.vdp-nav-bottom .vdp-nav-btn { flex: 1; }

	/* Ein Tag pro Zeile */
	.vdp-days { grid-template-columns: 1fr; gap: .5em; }
	.vdp-day { padding: .5em; }
	.vdp .vdp-table { font-size: .95em; }
	.vdp .vdp-table th, .vdp .vdp-table td { padding: .35em .3em; }
	.vdp .vdp-table .vdp-th-area, .vdp .vdp-table .vdp-area { width: 28%; }

	/* Vergangene Tage nur als Zeile */
	.vdp-day.is-pastday .vdp-table { display: none; }
	.vdp-day.is-pastday .vdp-day-head::after { content: "vorbei"; font-weight: 400; font-size: .8em; opacity: .7; margin-left: auto; padding-left: .5em; }
	.vdp-day.is-pastday .vdp-date { margin-left: .5em; }
	.vdp-day.is-pastday .vdp-day-head { justify-content: flex-start; }

	/* Große Tippflächen, 16px gegen Auto-Zoom auf iPhones */
	.vdp .vdp-btn { min-height: 44px; font-size: 16px; }
	.vdp-cell .vdp-btn { min-height: 40px; font-size: 15px; padding: .3em .2em; }
	.vdp .vdp-x { width: 36px; height: 36px; }
	.vdp .vdp-field input,
	.vdp-assign select { font-size: 16px; min-height: 44px; }
	.vdp-assign { flex-wrap: wrap; }
	.vdp-assign select { flex: 1 1 100%; }
	.vdp-assign .vdp-btn-sec { width: 100%; }

	.vdp-auth { padding: .85em; }
	.vdp-auth .vdp-btn { width: 100%; align-self: stretch; }
	.vdp-pin { font-size: 2em; }
}

/* Sehr schmale Geräte */
@media (max-width: 360px) {
	.vdp .vdp-table { font-size: .88em; }
	.vdp-cell .vdp-btn { font-size: 14px; }
}

/* Druck-Link in der Wochenüberschrift */
.vdp-week-head .vdp-print { margin-left: auto; font-weight: 400; font-size: .85em; text-decoration: underline; }

/* Bereichsnamen sauber trennen statt mitten im Wort umbrechen */
.vdp .vdp-table th { overflow-wrap: normal; word-wrap: normal; word-break: normal; hyphens: auto; -webkit-hyphens: auto; }

/* Eintragen-Knöpfe in der Tabelle zurückhaltend, damit Namen hervorstechen */
.vdp .vdp-cell .vdp-btn {
	background: transparent;
	color: var(--vdp-accent);
	border: 1px solid var(--vdp-accent);
	font-weight: 600;
}
.vdp .vdp-cell .vdp-btn:hover { background: var(--vdp-accent); color: var(--vdp-accent-ink); filter: none; }
.vdp .vdp-cell .vdp-btn-sec { color: inherit; border-color: var(--vdp-line); font-weight: 400; }
.vdp .vdp-table td.is-mine .vdp-n span:first-child { color: var(--vdp-accent); }

@media (max-width: 640px) {
	.vdp .vdp-table .vdp-th-area, .vdp .vdp-table .vdp-area { width: 33%; font-size: .92em; }
}

/* Web-App: Installations- und Benachrichtigungsleiste */
.vdp .vdp-appbar {
	border: 1px solid var(--vdp-line);
	border-radius: var(--vdp-radius);
	padding: .5em .75em;
	margin: 0 0 1em;
	background: var(--vdp-soft);
	font-size: .95em;
}
.vdp .vdp-appbar[hidden] { display: none; }
.vdp .vdp-appbar-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .5em 1em;
	padding: .25em 0;
}
.vdp .vdp-appbar-row + .vdp-appbar-row { border-top: 1px solid var(--vdp-line); }
.vdp .vdp-appbar-btns { display: inline-flex; flex-wrap: wrap; gap: .4em; }
.vdp .vdp-btn.vdp-btn-small { width: auto; padding: .35em .8em; font-size: .9em; margin: 0; }
@media (max-width: 640px) {
	.vdp .vdp-appbar-btns { width: 100%; }
	.vdp .vdp-btn.vdp-btn-small { flex: 1 1 auto; font-size: 16px; }
}

/* Kurze Einblendung nach Eintragen/Austragen */
.vdp .vdp-msg.vdp-toast {
	position: fixed;
	left: 50%;
	bottom: max(16px, env(safe-area-inset-bottom));
	transform: translateX(-50%);
	z-index: 99999;
	width: max-content;
	max-width: calc(100vw - 32px);
	margin: 0;
	background: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
	border: 1px solid var(--vdp-line);
	border-left: 4px solid currentColor;
	font-weight: 600;
	cursor: pointer;
	transition: opacity .3s, transform .3s;
}
.vdp .vdp-msg.vdp-toast.vdp-toast-out { opacity: 0; transform: translateX(-50%) translateY(8px); }

/* SMS: Löschen-Knopf ohne eigenen Rahmen */
.vdp .vdp-auth.vdp-auth-plain { border: 0; padding: 0 1em; margin-top: -.5em; }
.vdp .vdp-auth-plain .vdp-btn { align-self: flex-start; }
