/**
 * Terminplaner by Borkenfeld.tech – Timeline-Styles
 *
 * Vertikale Zeitachse mit wechselseitig links/rechts angedockten Terminen.
 * Status-Farben: Zukunft = Grün, Heute = Gelb (mit Pulse), Vergangenheit = Grau.
 * Responsive: mobil optimiert (Touch, Lesbarkeit, kein Overflow).
 */

/* Basis: kein horizontaler Overflow durch Plugin-Inhalt */
.terminplaner-search,
.terminplaner-calendar-actions,
.terminplaner-next-days,
.termin-timeline,
.terminplaner-laufband {
	max-width: 100%;
	box-sizing: border-box;
}

.termin-timeline {
	position: relative;
	max-width: 900px;
	margin: 2em auto;
	padding: 0 1em;
}

/* Vertikale Linie in der Mitte */
.termin-timeline::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #ddd;
	transform: translateX(-50%);
}

/* Einzelner Termin-Block */
.timeline-item {
	position: relative;
	margin-bottom: 2em;
	width: 50%;
	padding: 0 2em;
	box-sizing: border-box;
}

/* Abwechselnd links und rechts */
.timeline-item:nth-child(odd) {
	margin-left: 0;
	padding-right: 2em;
	text-align: right;
}

.timeline-item:nth-child(even) {
	margin-left: 50%;
	padding-left: 2em;
	text-align: left;
}

/* Datum am Zeitstrahl: unterhalb des Punkts, zentriert auf der Linie, mit Hintergrund */
.timeline-axis-date {
	position: absolute;
	top: 2.25em;
	font-size: 0.8em;
	color: #333;
	white-space: nowrap;
	z-index: 1;
	padding: 0.25em 0.5em;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
	line-height: 1.2;
}
/* Ungerade Items (links): Linie am rechten Rand des Blocks → Datum dort zentrieren */
.timeline-item:nth-child(odd) .timeline-axis-date {
	left: 100%;
	transform: translateX(-50%);
}
/* Gerade Items (rechts): Linie am linken Rand des Blocks → Datum dort zentrieren */
.timeline-item:nth-child(even) .timeline-axis-date {
	left: 0%;
	transform: translateX(-50%);
}

/* Punkt auf der Timeline (::after) – ausgeblendet */
.timeline-item::after,
.timeline-item:nth-child(odd)::after,
.timeline-item:nth-child(even)::after {
	content: none;
	display: none;
}

/* Farben je nach Status (Punkte ausgeblendet, nur zur Referenz) */
.timeline-item.future::after { background: #4caf50; }
.timeline-item.current::after { background: #ffc107; }
.timeline-item.past::after { background: #ccc; }

/* Letzte Vergangene im Zeitstrahl: gedimmt (nicht mehr im Fokus) */
.timeline-item.past-recent {
	opacity: 0.72;
}

.timeline-item.past-recent .timeline-content {
	--terminplaner-preview-bg: #f5f5f5;
	background: #f5f5f5;
	border-color: #e5e5e5;
}

.timeline-item.past-recent.past-scrolled {
	opacity: 0.4;
}

/* Monats-Marker im Zeitstrahl – Hintergrund deckt den Strich ab */
.timeline-month-marker {
	position: relative;
	width: 100%;
	text-align: center;
	margin: 1.25em 0 0.75em;
	padding: 0.45em 1.25em;
	font-size: 0.9em;
	font-weight: 700;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	z-index: 1;
	background: #fff;
	box-shadow: 0 0 0 1px #eee, 0 1px 3px rgba(0, 0, 0, 0.06);
	border-radius: 4px;
	scroll-margin-top: 1.5em;
}

.timeline-month-marker:first-child {
	margin-top: 0;
}

/* Hervorgehobene Termine */
.timeline-item.highlighted .timeline-content {
	background: #fff8e1;
	border-color: #ffc107;
	box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.timeline-item.highlighted .timeline-title::before {
	content: '★ ';
	color: #f57c00;
}

@keyframes terminplaner-pulse {
	0%,
	100% {
		box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
	}
	50% {
		box-shadow: 0 0 0 8px rgba(255, 193, 7, 0);
	}
}

/* Inhalt der Termin-Karte (margin-top: Platz unter dem Achsen-Datum, keine Kollision) */
.timeline-content {
	--terminplaner-preview-bg: #f9f9f9;
	background: #f9f9f9;
	border: 1px solid #eee;
	border-radius: 6px;
	padding: 1em 1.25em;
	margin-top: 3.5em;
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* Desktop: Reihenfolge – Titel zuerst, dann Datum/Ort als Metazeile, dann Text */
@media (min-width: 1025px) {
	.timeline-title             { order: 1; margin-bottom: 0.2em; }
	.timeline-date-short        { order: 0; display: none; }
	.timeline-date              { order: 2; }
	.timeline-ort               { order: 3; }
	.timeline-body              { order: 4; margin-top: 0.6em; padding-top: 0.6em; border-top: 1px solid #ebebeb; }
	.timeline-expand-row        { order: 5; }
	.terminplaner-save-wrap     { order: 6; }
}

.timeline-item:nth-child(odd) .timeline-content {
	margin-left: auto;
}


/* Datum weiter nach rechts, damit es nicht von der JETZT-Markierung überdeckt wird */
.timeline-item:nth-child(odd) {
	padding-right: 3em;
}
.timeline-item:nth-child(even) {
	padding-left: 3em;
}
.timeline-item:nth-child(odd) .timeline-date,
.timeline-item:nth-child(odd) .timeline-ort {
	margin-right: 0.5em;
}
.timeline-item:nth-child(even) .timeline-date,
.timeline-item:nth-child(even) .timeline-ort {
	margin-left: 0.5em;
}

.timeline-title {
	margin: 0 0 0.2em;
	font-size: 1.1em;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1a1a;
}

.timeline-date,
.timeline-ort {
	display: block;
	font-size: 0.8em;
	color: #888;
	margin-bottom: 0.1em;
	line-height: 1.4;
}

/* Kurzes Datum nur mobil anzeigen (Desktop: ausgeblendet) */
.timeline-date-short {
	display: none;
}

/* Wrapper für Datum+Ort und Rechts-Inhalt: Desktop = normaler Fluss (contents) */
.timeline-left,
.timeline-right {
	display: contents;
}

/* Datum + Ort als eine Einheit: Adresse nah am Tag/Datum/Uhrzeit */
.timeline-date {
	margin-bottom: 0.5em;
}
.timeline-date:has(+ .timeline-ort) {
	margin-bottom: 0.15em;
}
.timeline-ort {
	margin-top: 0;
	margin-bottom: 0.5em;
}

/* Vorschau: nur 3–4 Zeilen, Rest per „Aufklappen“ im Pop-up; „…“ zeigt an, dass es weitergeht */
.timeline-body.timeline-body-preview {
	font-size: 0.95em;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	overflow: hidden;
	position: relative;
	padding-right: 1.25em;
}

.timeline-body.timeline-body-preview::after {
	content: none;
}

.timeline-expand-row {
	margin: 0.5em 0 0;
	font-size: 0.95em;
}

.terminplaner-open-modal {
	font-weight: 600;
	color: #1565c0;
	text-decoration: none;
}

.terminplaner-open-modal:hover {
	text-decoration: underline;
}

/* Termin speichern: Button + Pop-up mit Optionen */
.terminplaner-save-wrap {
	position: relative;
	margin-top: 0.75em;
}

.terminplaner-save-btn {
	display: inline-block;
	padding: 0.35em 0.75em;
	min-height: 36px;
	font-size: 0.9em;
	background: transparent;
	color: #1565c0;
	border: 1px solid #90caf9;
	border-radius: 6px;
	cursor: pointer;
	line-height: 1.3;
}

.terminplaner-save-btn:hover {
	background: rgba(21, 101, 192, 0.08);
	border-color: #1565c0;
	color: #0d47a1;
}

.terminplaner-save-popup {
	position: absolute;
	left: 0;
	top: 100%;
	margin-top: 0.5em;
	min-width: 280px;
	max-width: 90vw;
	background: #fff;
	background-color: #fff;
	border: 1px solid #ccc;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.18);
	z-index: 10000;
	overflow: hidden;
	opacity: 1;
}

/* Geöffnetes „Termin speichern“-Pop-up: ganze Karte über den folgenden Zeitstrahl-Elementen */
.timeline-item:has(.terminplaner-save-btn[aria-expanded="true"]) {
	z-index: 1000;
}

.terminplaner-save-popup[hidden] {
	display: none !important;
}

.terminplaner-save-popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
	padding: 0.65em 0.85em;
	background: #f5f5f5;
	background-color: #f5f5f5;
	border-bottom: 1px solid #e0e0e0;
}

.terminplaner-save-popup-title {
	font-weight: 700;
	font-size: 0.95em;
	color: #333;
}

.terminplaner-save-popup-close {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	background: transparent;
	color: #666;
	font-size: 1.5em;
	line-height: 1;
	cursor: pointer;
	border-radius: 4px;
}

.terminplaner-save-popup-close:hover {
	background: #e0e0e0;
	color: #333;
}

.terminplaner-save-popup-body {
	padding: 0.4em 0;
	background: #fff;
	background-color: #fff;
}

.terminplaner-save-option {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 0.65em 0.85em;
	min-height: 44px;
	box-sizing: border-box;
	font-size: 0.95em;
	color: #333;
	text-decoration: none;
	border: none;
	background: #fff;
	background-color: #fff;
	text-align: left;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s;
}

.terminplaner-save-option:hover {
	background: #f0f0f0;
}

.terminplaner-save-option + .terminplaner-save-option {
	border-top: 1px solid #eee;
}

.terminplaner-save-option-teilen {
	border-top: 1px solid #ddd !important;
	margin-top: 0.25em;
	padding-top: 0.75em;
}

.terminplaner-modal-calendar .terminplaner-save-wrap {
	margin-top: 1em;
	padding-top: 0;
}

/* Im Modal: Pop-up nach oben öffnen, damit es nicht abgeschnitten wird */
.terminplaner-modal .terminplaner-save-popup {
	top: auto;
	bottom: 100%;
	margin-top: 0;
	margin-bottom: 0.5em;
}

.timeline-body {
	font-size: 0.95em;
	line-height: 1.6;
}

.timeline-body p,
.timeline-body ul,
.timeline-body ol {
	margin-top: 0.4em;
	margin-bottom: 0.4em;
}

.timeline-body p:first-child,
.timeline-body ul:first-child,
.timeline-body ol:first-child {
	margin-top: 0;
}

.timeline-body p:last-child,
.timeline-body ul:last-child,
.timeline-body ol:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Termin-Suche (obere Box – an Timeline-Design angepasst)
   ========================================================================== */
.terminplaner-search {
	max-width: 900px;
	margin: 0 auto 1em;
	padding: 1.25em 1.5em;
	background: #f9f9f9;
	border: 1px solid #eee;
	border-radius: 8px;
	box-sizing: border-box;
}

.terminplaner-search-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	align-items: flex-start;
}

.terminplaner-search-input {
	flex: 1;
	min-width: 12em;
	height: 44px;
	line-height: 44px;
	padding: 0 0.9em;
	font-size: 1em;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fff;
	box-sizing: border-box;
	vertical-align: top;
	appearance: none;
	-webkit-appearance: none;
}
/* Min. 16px verhindert Zoom beim Fokus auf iOS */
@media (max-width: 767px) {
	.terminplaner-search-input {
		font-size: 16px;
		height: 44px;
	}
}

.terminplaner-search-submit {
	padding: 0 1.1em;
	font-size: 1em;
	height: 44px;
	line-height: 44px;
	background: #1565c0;
	color: #fff;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	vertical-align: top;
	box-sizing: border-box;
	touch-action: manipulation;
}

.terminplaner-search-submit:hover {
	background: #0d47a1;
}

.terminplaner-search-info {
	margin: 0.6em 0 0;
	font-size: 0.9em;
	color: #666;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* ==========================================================================
   Kalender-Export (obere Box – an Timeline-Design angepasst)
   ========================================================================== */
.terminplaner-calendar-actions {
	max-width: 900px;
	margin: 0 auto 1.5em;
	padding: 1em 1.5em;
	background: #f9f9f9;
	border: 1px solid #eee;
	border-radius: 8px;
	box-sizing: border-box;
}

.terminplaner-ics-all {
	display: inline-flex;
	align-items: center;
	padding: 0.55em 1em;
	min-height: 44px;
	line-height: 1.3;
	background: #2e7d32;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	font-size: 0.95em;
	touch-action: manipulation;
}

.terminplaner-ics-all:hover {
	background: #1b5e20;
	color: #fff;
}

.terminplaner-calendar-link {
	font-size: 0.85em;
	color: #1565c0;
}

.terminplaner-calendar-link:hover {
	text-decoration: underline;
}

.timeline-calendar-links {
	margin: 0.75em 0 0;
	padding-top: 0.5em;
	border-top: 1px solid #eee;
	font-size: 0.9em;
}

.timeline-calendar-links a {
	display: inline-block;
	padding: 0.25em 0;
	min-height: 2em;
}

.terminplaner-next-days-calendar {
	display: inline-block;
	margin-left: 0.5em;
	font-weight: normal;
	font-size: 0.85em;
}

.terminplaner-next-days-calendar .terminplaner-calendar-link {
	margin: 0 0.15em;
}

/* ==========================================================================
   Vorschau-Modus: kurzer Text + Klick öffnet Pop-up
   ========================================================================== */
.terminplaner-has-preview .timeline-content,
.terminplaner-next-days-item.terminplaner-preview-trigger {
	cursor: pointer;
}

.terminplaner-has-preview .timeline-content:hover,
.terminplaner-preview-trigger:hover {
	opacity: 0.95;
}

.timeline-body-preview {
	color: #555;
	font-size: 0.95em;
}

.terminplaner-more-link {
	display: inline-block;
	margin-top: 0.35em;
	font-weight: 600;
	color: #1565c0;
}

.terminplaner-more-link::after {
	content: ' →';
}

.terminplaner-preview-hint {
	font-weight: normal;
	color: #1565c0;
	font-size: 0.9em;
}

/* Versteckte Vollinhalte (für Modal) */
.terminplaner-full-contents {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* Modal / Pop-up – einheitliche Farbe, Hervorhebung nur durch Schatten/Rahmen */
.terminplaner-modal-overlay {
	position: fixed;
	inset: 0;
	background: transparent;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5em;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s, visibility 0.2s;
}

.terminplaner-modal-overlay.terminplaner-modal-visible {
	opacity: 1;
	visibility: visible;
}

.terminplaner-modal {
	position: relative;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	max-width: 560px;
	width: 100%;
	max-height: 85vh;
	overflow: auto;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.terminplaner-modal-close {
	position: absolute;
	top: 0.5em;
	right: 0.5em;
	width: 2.5em;
	height: 2.5em;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: none;
	background: transparent;
	font-size: 1.5em;
	line-height: 1;
	color: #666;
	cursor: pointer;
	border-radius: 4px;
	z-index: 1;
	touch-action: manipulation;
}

.terminplaner-modal-close:hover {
	background: #eee;
	color: #333;
}

.terminplaner-modal-inner {
	padding: 1.5em 2em 2em;
}

.terminplaner-modal-title {
	margin: 0 0 0.25em;
	font-size: 1.35em;
	padding-right: 2em;
}

.terminplaner-modal-date {
	display: block;
	font-size: 0.9em;
	color: #666;
	margin-bottom: 1em;
}

.terminplaner-modal-date:has(+ .terminplaner-modal-ort) {
	margin-bottom: 0.25em;
}

.terminplaner-modal-ort {
	display: block;
	font-size: 0.9em;
	color: #666;
	margin: 0 0 1em;
}

.terminplaner-modal-body {
	font-size: 1em;
	line-height: 1.6;
}

.terminplaner-modal-body p,
.terminplaner-modal-body ul,
.terminplaner-modal-body ol {
	margin-top: 0.6em;
	margin-bottom: 0.6em;
}

.terminplaner-modal-body p:first-child,
.terminplaner-modal-body ul:first-child,
.terminplaner-modal-body ol:first-child {
	margin-top: 0;
}

.terminplaner-modal-body p:last-child,
.terminplaner-modal-body ul:last-child,
.terminplaner-modal-body ol:last-child {
	margin-bottom: 0;
}

.terminplaner-modal-calendar {
	margin-top: 1.25em;
	padding-top: 1em;
	border-top: 1px solid #eee;
	font-size: 0.9em;
}

/* ==========================================================================
   Block "Nächste 7 Tage" (an Timeline-Design angepasst)
   ========================================================================== */
.terminplaner-next-days {
	background: #f9f9f9;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 1.25em 1.5em;
	margin-bottom: 2em;
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

.terminplaner-next-days-title {
	margin: 0 0 0.75em;
	font-size: 1.2em;
	color: #333;
	font-weight: 700;
	border-bottom: 1px solid #eee;
	padding-bottom: 0.5em;
}

.terminplaner-next-days-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.terminplaner-next-days-item {
	padding: 0.5em 0;
	border-bottom: 1px solid #eee;
	font-size: 1.05em;
}

.terminplaner-next-days-item:last-child {
	border-bottom: none;
}

.terminplaner-next-days-date {
	color: #1565c0;
	font-weight: 600;
	margin-right: 0.5em;
}

/* ==========================================================================
   JETZT-Marker (stark sichtbar: Heute / Jetzt)
   ========================================================================== */
.timeline-now-marker {
	position: relative;
	width: 100%;
	left: 0;
	right: 0;
	margin: 1.5em 0;
	padding: 0.6em 1em;
	text-align: center;
	box-sizing: border-box;
	z-index: 2;
}

.timeline-now-marker::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 4px;
	background: #1565c0;
	transform: translateX(-50%);
	border-radius: 2px;
}

.timeline-now-marker-label {
	display: inline-block;
	background: #1565c0;
	color: #fff;
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: 0.05em;
	padding: 0.35em 0.9em;
	border-radius: 4px;
	box-shadow: 0 2px 6px rgba(21, 101, 192, 0.4);
	margin-right: 0.5em;
}

.timeline-now-marker-date {
	color: #1565c0;
	font-size: 0.95em;
	font-weight: 600;
	margin-left: 1.25em;
}

/* ==========================================================================
   Laufband (Ticker für Header/Footer, gezielt einblendbar)
   ========================================================================== */
.terminplaner-laufband {
	display: flex;
	align-items: center;
	gap: 1em;
	background: #263238;
	color: #fff;
	padding: 0.6em 1em;
	overflow: hidden;
	border-radius: 0;
	font-size: 0.95em;
}

.terminplaner-laufband-title {
	flex-shrink: 0;
	font-weight: 700;
	color: #ffc107;
}

.terminplaner-laufband-track {
	flex: 1;
	overflow: hidden;
}

.terminplaner-laufband-inner {
	display: inline-flex;
	gap: 2em;
	animation: terminplaner-laufband-scroll 40s linear infinite;
	padding-right: 100%;
}

.terminplaner-laufband--slow .terminplaner-laufband-inner {
	animation-duration: 60s;
}

.terminplaner-laufband--fast .terminplaner-laufband-inner {
	animation-duration: 25s;
}

@keyframes terminplaner-laufband-scroll {
	0% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(-50%);
	}
}

.terminplaner-laufband-item {
	white-space: nowrap;
}

.terminplaner-laufband-item a {
	color: inherit;
	text-decoration: none;
}

.terminplaner-laufband-item a:hover {
	text-decoration: underline;
}

.terminplaner-laufband-title a {
	color: inherit;
	text-decoration: none;
}

.terminplaner-laufband-title a:hover {
	text-decoration: underline;
}

.terminplaner-laufband-date {
	color: #90a4ae;
	margin-right: 0.25em;
}

.terminplaner-laufband-sep {
	opacity: 0.7;
	margin: 0 0.25em;
}

.terminplaner-laufband-empty {
	margin: 0;
	padding: 0.5em 0;
	color: #666;
	font-size: 0.95em;
}

/* ==========================================================================
   Sektion "Vergangene Termine" (ausklappbar) – ganz oben
   ========================================================================== */
.terminplaner-past-section {
	max-width: 900px;
	margin: 0 auto 1.5em;
	padding: 0;
	border: 1px solid #eee;
	border-radius: 8px;
	background: #f9f9f9;
	box-sizing: border-box;
}

.terminplaner-past-section-summary {
	list-style: none;
	padding: 0.9em 1.25em;
	font-weight: 700;
	font-size: 1.05em;
	color: #333;
	cursor: pointer;
	user-select: none;
	appearance: none;
	background: transparent;
	border: none;
	border-radius: 8px;
	width: 100%;
	text-align: center;
	transition: background 0.2s;
	box-sizing: border-box;
}

.terminplaner-past-section-summary:hover {
	background: rgba(0, 0, 0, 0.04);
}

.terminplaner-past-section-summary::-webkit-details-marker {
	display: none;
}

.terminplaner-past-section-summary::before {
	content: 'Vergangene Termine anzeigen ';
	display: inline;
}

.terminplaner-past-section[open] .terminplaner-past-section-summary::before {
	content: 'Vergangene Termine ausblenden ';
}

.terminplaner-past-count {
	font-weight: normal;
	color: #666;
	font-size: 0.9em;
}

.terminplaner-past-section-inner {
	padding: 0 1.25em 1.25em;
	border-top: 1px solid #eee;
}

.terminplaner-past-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.terminplaner-past-list-item {
	padding: 0.6em 0;
	border-bottom: 1px solid #eee;
	font-size: 0.98em;
}

.terminplaner-past-list-item:last-child {
	border-bottom: none;
}

.terminplaner-past-list-item.terminplaner-preview-trigger {
	cursor: pointer;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
}

.terminplaner-past-list-date {
	color: #666;
	margin-right: 0.5em;
}

.terminplaner-past-list-calendar {
	display: inline-block;
	margin-left: 0.5em;
	font-size: 0.85em;
}

.terminplaner-past-list-calendar .terminplaner-calendar-link {
	margin: 0 0.2em 0 0;
}

/* Monats-Navigation unter der Suche */
.terminplaner-month-nav {
	max-width: 900px;
	margin: 0 auto 1.25em;
	padding: 0.6em 1em;
	background: #f9f9f9;
	border: 1px solid #eee;
	border-radius: 8px;
}

.terminplaner-month-nav-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5em 1em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.terminplaner-month-nav-link {
	font-size: 0.9em;
	color: #1565c0;
	text-decoration: none;
}

.terminplaner-month-nav-link:hover {
	text-decoration: underline;
}

/* Leere Meldung */
.terminplaner-empty {
	text-align: center;
	color: #666;
	padding: 2em;
}

/* Footer Copyright */
.terminplaner-footer-copyright {
	max-width: 900px;
	margin: 2em auto 1em;
	padding: 0 1em;
	text-align: center;
	font-size: 0.8em;
	color: #888;
}

.terminplaner-footer-copyright a {
	color: inherit;
	text-decoration: none;
}

.terminplaner-footer-copyright a:hover {
	color: inherit;
	text-decoration: none;
}

/* ==========================================================================
   Responsive: Handy/Tablet – unter 1024px
   ========================================================================== */
@media (max-width: 1024px) {

	/* ── Wrapper: kein horizontaler Scroll ── */
	.terminplaner-month-nav,
	.terminplaner-search,
	.terminplaner-past-section,
	.terminplaner-next-days {
		margin-left: 0.75em;
		margin-right: 0.75em;
		max-width: calc(100% - 1.5em);
		box-sizing: border-box;
	}

	/* ── Timeline: schmale Linie links ── */
	.termin-timeline {
		padding: 0 0.75em;
		margin: 0.75em 0.5em 1.5em;
		max-width: 100%;
		overflow-x: hidden;
		box-sizing: border-box;
	}

	.termin-timeline::before {
		left: 1.1em;
		width: 2px;
		background: #e0e0e0;
		transform: translateX(-50%);
	}

	/* ── JETZT-Marker ── */
	.timeline-now-marker {
		padding: 0.45em 0.75em;
		margin: 0.75em 0;
		font-size: 0.85em;
		border-radius: 6px;
	}

	.timeline-now-marker::before {
		left: 1.1em;
		transform: translateX(-50%);
	}

	.timeline-now-marker-label,
	.timeline-now-marker-date {
		font-size: 0.9em;
	}

	/* ── Alle Items: Desktop-Layout vollständig zurücksetzen ── */
	.timeline-item,
	.timeline-item:nth-child(odd),
	.timeline-item:nth-child(even) {
		width: 100% !important;
		margin-left: 0 !important;
		padding-left: 3.25em !important;
		padding-right: 0.25em !important;
		padding-bottom: 1.25em;
		text-align: left !important;
		margin-bottom: 0;
		box-sizing: border-box;
	}

	.timeline-item:nth-child(odd) .timeline-content,
	.timeline-item:nth-child(even) .timeline-content {
		margin-left: 0 !important;
		text-align: left !important;
	}

	/* ── Status-Punkt ausgeblendet ── */
	.timeline-item::after,
	.timeline-item:nth-child(odd)::after,
	.timeline-item:nth-child(even)::after {
		content: none !important;
		display: none !important;
	}

	/* ── Achsen-Datum: oben am Termin (unter dem Punkt), damit es dem richtigen Termin zugeordnet ist ── */
	.timeline-axis-date,
	.timeline-item:nth-child(odd) .timeline-axis-date,
	.timeline-item:nth-child(even) .timeline-axis-date {
		left: 1.1em !important;
		transform: translateX(-50%) !important;
		top: 1.75em !important;
		bottom: auto !important;
		font-size: 0.68em;
		padding: 0.15em 0.35em;
		white-space: nowrap;
		max-width: 5em;
		line-height: 1.15;
		text-align: center;
		overflow: hidden;
		text-overflow: ellipsis;
		background: #f0f0f0;
		color: #777;
		border-radius: 3px;
		box-shadow: none;
	}

	/* ── Karte: weißer Hintergrund, farbige linke Border je Status ── */
	.termin-timeline .timeline-content {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: flex-start;
		gap: 0;
		padding: 0.7em 0.65em 0.7em 0.55em;
		margin-top: 0.35em;
		border-radius: 8px;
		background: #fff;
		border: 1px solid #eee;
		border-left: 3px solid #ccc;
		box-shadow: 0 1px 4px rgba(0,0,0,0.06);
		-webkit-tap-highlight-color: rgba(21, 101, 192, 0.07);
		box-sizing: border-box;
		max-width: 100%;
		text-align: left !important;
	}

	.termin-timeline .timeline-item.future .timeline-content  { border-left-color: #4caf50; }
	.termin-timeline .timeline-item.current .timeline-content { border-left-color: #ffc107; }
	.termin-timeline .timeline-item.past .timeline-content    { border-left-color: #ccc; }

	/* ── Linke Spalte: Datum + Ort ── */
	.termin-timeline .timeline-left {
		display: flex !important;
		flex-direction: column;
		flex: 0 0 3.5em;
		min-width: 0;
		gap: 0.1em;
		padding-top: 0.05em;
		padding-right: 0.4em;
		border-right: 1px solid #f0f0f0;
		margin-right: 0.55em;
	}

	.termin-timeline .timeline-date-short {
		display: block !important;
		font-size: 0.72em;
		font-weight: 600;
		color: #444;
		line-height: 1.3;
		word-break: break-word;
	}

	.termin-timeline .timeline-left .timeline-date {
		display: none !important;
	}

	.termin-timeline .timeline-left .timeline-ort {
		font-size: 0.65em;
		color: #888;
		margin: 0;
		line-height: 1.2;
		word-break: break-word;
	}

	/* ── Rechte Spalte: Titel + Text + Aktionen ── */
	.termin-timeline .timeline-right {
		display: flex;
		flex-direction: column;
		flex: 1 1 0;
		min-width: 0;
		gap: 0.25em;
	}

	.termin-timeline .timeline-title {
		font-size: 0.95em !important;
		font-weight: 700 !important;
		line-height: 1.3 !important;
		margin: 0 !important;
		text-align: left !important;
		word-wrap: break-word;
		overflow-wrap: break-word;
		color: #222;
	}

	.termin-timeline .timeline-body {
		font-size: 0.88em;
		line-height: 1.45;
		color: #444;
		min-width: 0;
		text-align: left !important;
	}

	.termin-timeline .terminplaner-weiterlesen-row,
	.termin-timeline .timeline-expand-row {
		margin-top: 0.15em;
		font-size: 0.85em;
	}

	.termin-timeline .terminplaner-save-wrap {
		margin-top: 0.35em;
	}

	.termin-timeline .terminplaner-save-btn {
		font-size: 0.82em;
		padding: 0.35em 0.65em;
		min-height: 36px;
	}

	.timeline-date,
	.timeline-ort {
		font-size: 0.8em;
		margin-bottom: 0.25em;
	}

	/* ── Vergangene Termine: gedimmt ── */
	.termin-timeline .timeline-item.past-recent .timeline-content {
		background: #f8f8f8;
		border-left-color: #ddd;
	}

	/* ── Monats-Marker ── */
	.timeline-month-marker {
		font-size: 0.8em;
		margin: 1em 0 0.5em;
		padding: 0.35em 0.85em;
		border-radius: 4px;
		letter-spacing: 0.03em;
	}

	/* ── Monats-Navigation: Chips ── */
	.terminplaner-month-nav {
		padding: 0.65em 0.75em;
		margin: 0 0.75em 0.85em;
		border-radius: 10px;
		background: #f5f5f5;
		border-color: #e8e8e8;
	}

	.terminplaner-month-nav-list {
		gap: 0.4em 0.5em;
	}

	.terminplaner-month-nav-link {
		display: inline-flex;
		align-items: center;
		padding: 0.3em 0.7em;
		min-height: 36px;
		background: #fff;
		border: 1px solid #d0d0d0;
		border-radius: 20px;
		font-size: 0.82em;
		color: #333;
		line-height: 1.3;
		box-sizing: border-box;
		text-decoration: none;
		-webkit-tap-highlight-color: rgba(21, 101, 192, 0.08);
	}

	.terminplaner-month-nav-link:hover,
	.terminplaner-month-nav-link:active {
		background: #1565c0;
		border-color: #1565c0;
		color: #fff;
		text-decoration: none;
	}

	/* ── Suche ── */
	.terminplaner-search {
		padding: 0.85em 0.9em;
		margin: 0 0.75em 0.85em;
		border-radius: 10px;
	}

	.terminplaner-calendar-actions {
		padding: 0.85em 0.9em;
		margin: 0 0.75em 0.85em;
	}

	.terminplaner-search-form {
		flex-direction: column;
		align-items: stretch;
		gap: 0.6em;
	}

	.terminplaner-search-input {
		width: 100%;
		min-width: 0;
		height: 44px;
		line-height: 44px;
		padding: 0 0.9em;
		font-size: 1em;
		box-sizing: border-box;
		border-radius: 8px;
	}

	.terminplaner-search-submit {
		width: 100%;
		height: 44px;
		line-height: 44px;
		padding: 0 1em;
		box-sizing: border-box;
		border-radius: 8px;
	}

	.terminplaner-ics-all {
		width: 100%;
		justify-content: center;
		padding: 0.7em 1em;
		min-height: 44px;
	}

	/* ── Nächste Tage ── */
	.terminplaner-next-days {
		margin: 0 0.75em 1.25em;
		padding: 0.9em 0.9em;
	}

	.terminplaner-next-days-item {
		padding: 0.7em 0;
		min-height: 48px;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.3em;
	}

	.terminplaner-next-days-item.terminplaner-preview-trigger {
		cursor: pointer;
		-webkit-tap-highlight-color: rgba(21, 101, 192, 0.1);
	}

	.terminplaner-next-days-date {
		flex: 0 0 auto;
	}

	.terminplaner-next-days-calendar .terminplaner-calendar-link {
		padding: 0.3em 0;
		min-height: 2em;
		display: inline-flex;
		align-items: center;
	}

	/* ── Modal: Vollbild ── */
	.terminplaner-modal-overlay {
		padding: 0.5em;
		align-items: flex-end;
	}

	.terminplaner-modal {
		max-width: none;
		max-height: 90vh;
		width: 100%;
		margin: 0;
		border-radius: 16px 16px 0 0;
		-webkit-overflow-scrolling: touch;
		box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
	}

	.terminplaner-modal-close {
		top: 0.5em;
		right: 0.5em;
		width: 44px;
		height: 44px;
		font-size: 1.5em;
		background: #f0f0f0;
		border-radius: 50%;
	}

	.terminplaner-modal-inner {
		padding: 1.25em 1.1em 2em;
		padding-right: 3.5em;
	}

	.terminplaner-modal-title {
		font-size: 1.15em;
		line-height: 1.3;
		padding-right: 2em;
		word-wrap: break-word;
	}

	.terminplaner-modal-body {
		font-size: 0.95em;
		word-wrap: break-word;
		overflow-wrap: break-word;
	}

	.terminplaner-modal-calendar a {
		display: inline-block;
		padding: 0.5em 0.75em;
		min-height: 2.5em;
		box-sizing: border-box;
	}

	.terminplaner-save-option {
		min-height: 48px;
		padding: 0.75em 0.85em;
	}

	.terminplaner-save-popup {
		min-width: 240px;
		max-width: calc(100vw - 2em);
	}

	/* ── Vergangene Termine: Abschnitt ── */
	.terminplaner-past-section {
		margin: 0 0.75em 1em;
		border-radius: 10px;
	}

	.terminplaner-past-section-summary {
		min-height: 48px;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0.85em 1em;
		border-radius: 10px;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
	}

	.terminplaner-past-section-inner {
		padding: 0 0.85em 0.85em;
	}

	.terminplaner-past-list-item {
		min-height: 48px;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.25em 0.5em;
		padding: 0.55em 0;
		font-size: 0.93em;
	}

	.terminplaner-past-list-date {
		flex: 0 0 auto;
		color: #666;
		font-size: 0.9em;
	}

	/* ── Laufband ── */
	.terminplaner-laufband {
		flex-wrap: wrap;
		padding: 0.5em 0.75em;
		gap: 0.5em;
		font-size: 0.9em;
	}

	.terminplaner-laufband-title {
		flex: 1 1 100%;
		font-size: 0.95em;
	}

	.terminplaner-laufband-track {
		flex: 1 1 100%;
		min-width: 0;
	}

	/* ── Footer ── */
	.terminplaner-footer-copyright {
		padding: 0 0.75em 1.5em;
		margin-top: 1.25em;
		font-size: 0.82em;
	}
}

/* Sehr kleine Displays (≤ 380px) */
@media (max-width: 380px) {
	.termin-timeline {
		padding: 0 0.5em;
		margin: 0.5em 0.25em 1.25em;
	}

	.timeline-item,
	.timeline-item:nth-child(odd),
	.timeline-item:nth-child(even) {
		padding-left: 3em !important;
		padding-right: 0.2em !important;
	}

	.termin-timeline .timeline-left {
		flex: 0 0 3em;
	}

	.termin-timeline .timeline-content {
		padding: 0.55em 0.5em 0.55em 0.45em;
	}

	.terminplaner-month-nav,
	.terminplaner-search,
	.terminplaner-past-section,
	.terminplaner-next-days {
		margin-left: 0.35em;
		margin-right: 0.35em;
		max-width: calc(100% - 0.7em);
	}

	.terminplaner-month-nav-link {
		font-size: 0.78em;
		padding: 0.25em 0.55em;
		min-height: 34px;
	}

	.terminplaner-modal {
		border-radius: 12px 12px 0 0;
	}

	.terminplaner-modal-inner {
		padding: 1em 0.9em 1.75em;
		padding-right: 3em;
	}
}

/* Safe Area für Geräte mit Notch / abgerundeten Ecken */
@supports (padding: env(safe-area-inset-top)) {
	.terminplaner-modal-overlay {
		padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
	}

	@media (max-width: 1024px) {
		.terminplaner-laufband {
			padding-left: max(0.75em, env(safe-area-inset-left));
			padding-right: max(0.75em, env(safe-area-inset-right));
		}

		.termin-timeline {
			padding-left: max(1em, env(safe-area-inset-left));
			padding-right: max(1em, env(safe-area-inset-right));
		}

		.terminplaner-month-nav,
		.terminplaner-search,
		.terminplaner-past-section,
		.terminplaner-next-days {
			margin-left: max(0.5em, env(safe-area-inset-left));
			margin-right: max(0.5em, env(safe-area-inset-right));
		}

		.terminplaner-footer-copyright {
			padding-bottom: max(1.5em, env(safe-area-inset-bottom));
		}
	}
}
