/*
 * Saarland Vereint – Schnellzugriff und Wegweiser
 *
 * Alle Klassen beginnen mit svh-, alle Farben hängen an Variablen.
 */

:root {
	--svh-primary: #dc006a;
	--svh-dunkel: #2b2330;
	--svh-weiss: #ffffff;
	--svh-hell: #f6f8f7;
	--svh-linie: #e3e7ea;
	--svh-text: #2b2330;
	--svh-grau: #5c6670;
	--svh-radius: 14px;
	--svh-schatten: 0 10px 30px rgba(43, 35, 48, .18);
	--svh-rail-breite: 54px;
	--svh-bar-hoehe: 62px;
}

.svh-icon {
	width: 22px;
	height: 22px;
	display: block;
}

/* ------------------------------------------------------------------ *
 * Schutz gegen Theme-Resets
 *
 * Viele Themes gestalten `[type="button"]`, `[type="submit"]`, `[type="text"]`.
 * Ein Attributselektor ist genauso stark wie eine Klasse – bei Gleichstand
 * gewinnt, wer später geladen wird, und das ist immer das Theme. Deshalb
 * tragen alle Regeln für Bedien-Elemente unten ihren Block als Elternteil
 * (`.svh-chat .svh-chat__blase`), und hier wird vorab weggeräumt, was ein
 * fremder Reset sonst mitbringt.
 *
 * Die Ausnahme für Häkchen steht in `:where()`, weil `:not([type="checkbox"])`
 * die Stärke des Attributselektors erbt – dieser Block wäre damit stärker
 * geworden als die eigenen Regeln darunter und hätte ihnen den Rahmen
 * weggenommen.
 * ------------------------------------------------------------------ */

.svh-rail button,
.svh-rail a,
.svh-chat button,
.svh-chat input:where(:not([type="checkbox"]):not([type="radio"])),
.svh-chat textarea {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	min-width: 0;
	min-height: 0;
	border: 0;
	margin: 0;
	padding: 0;
	box-shadow: none;
}

/* ------------------------------------------------------------------ *
 * Schnellzugriffsleiste
 * ------------------------------------------------------------------ */

.svh-rail {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 9990;
}

.svh-rail--links {
	left: 0;
}

.svh-rail--rechts {
	right: 0;
}

.svh-rail__liste {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}

.svh-rail--rechts .svh-rail__liste {
	align-items: flex-end;
}

.svh-rail__punkt {
	margin: 0;
	padding: 0;
	list-style: none;
}

.svh-rail__punkt::before,
.svh-rail__punkt::marker {
	content: none;
}

.svh-rail .svh-rail__link {
	display: flex;
	align-items: center;
	gap: 0;
	width: var(--svh-rail-breite);
	min-height: var(--svh-rail-breite);
	padding: 0;
	border: 0;
	margin: 0;
	box-sizing: border-box;
	background: var(--svh-dunkel);
	box-shadow: var(--svh-schatten);
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	overflow: hidden;
	white-space: nowrap;
	transition: width .22s ease, background-color .18s ease;
}

.svh-rail--links .svh-rail__link {
	border-radius: 0 12px 12px 0;
}

.svh-rail--rechts .svh-rail__link {
	flex-direction: row-reverse;
	border-radius: 12px 0 0 12px;
}

.svh-rail .svh-rail__zeichen {
	flex: 0 0 var(--svh-rail-breite);
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--svh-rail-breite);
}

.svh-rail .svh-rail__text {
	flex: 0 0 auto;
	opacity: 0;
	padding-right: 18px;
	transition: opacity .18s ease .04s;
	font-weight: 600;
}

.svh-rail--rechts .svh-rail__text {
	padding-right: 0;
	padding-left: 18px;
}

.svh-rail .svh-rail__link:hover,
.svh-rail .svh-rail__link:focus-visible {
	width: auto;
	min-width: 188px;
	background: var(--svh-primary);
	color: #fff;
	outline: none;
}

.svh-rail .svh-rail__link:hover .svh-rail__text,
.svh-rail .svh-rail__link:focus-visible .svh-rail__text {
	opacity: 1;
}

.svh-rail .svh-rail__link:focus-visible {
	box-shadow: inset 0 0 0 2px #fff;
}

/* Die aktuelle Seite wird aufgehellt – als Ebene ÜBER der Grundfarbe, nicht
   statt ihr. Ein `background: rgba(255,255,255,.12)` würde die Kurzschreibweise
   der Grundregel ersetzen: Der Knopf wäre dann fast durchsichtig und das weiße
   Zeichen stünde auf dem weißen Seitenhintergrund. */
.svh-rail .svh-rail__link.is-hier {
	background-image: linear-gradient(rgba(255, 255, 255, .16), rgba(255, 255, 255, .16));
}

.svh-rail .svh-rail__oben[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.svh-rail .svh-rail__link,
	.svh-rail .svh-rail__text {
		transition: none;
	}
}

/* Handy: aus der Seitenleiste wird eine Leiste am unteren Rand. Eine
   senkrechte Leiste würde dort ein Drittel des Bildes verdecken. */
@media (max-width: 860px) {
	.svh-rail {
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		transform: none;
	}

	.svh-rail__liste,
	.svh-rail--rechts .svh-rail__liste {
		flex-direction: row;
		align-items: stretch;
		border-radius: 0;
		gap: 0;
		justify-content: space-around;
		background: var(--svh-dunkel);
		box-shadow: var(--svh-schatten);
		padding-bottom: env(safe-area-inset-bottom, 0);
	}

	.svh-rail__punkt {
		flex: 1 1 0;
		min-width: 0;
	}

	.svh-rail .svh-rail__link,
	.svh-rail--links .svh-rail__link,
	.svh-rail--rechts .svh-rail__link {
		width: 100%;
		height: var(--svh-bar-hoehe);
		min-height: 0;
		flex-direction: column;
		justify-content: center;
		gap: 3px;
		padding: 6px 2px;
		border-radius: 0;
		box-shadow: none;
	}

	.svh-rail .svh-rail__zeichen {
		flex: 0 0 auto;
		height: auto;
	}

	.svh-rail .svh-rail__text,
	.svh-rail--rechts .svh-rail__text {
		opacity: 1;
		padding: 0 2px;
		font-size: 10px;
		font-weight: 600;
		letter-spacing: .01em;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 100%;
	}

	.svh-rail .svh-rail__link:hover,
	.svh-rail .svh-rail__link:focus-visible {
		width: 100%;
		min-width: 0;
	}

	/* Der Knopf „Nach oben“ hat auf der schmalen Leiste keinen Platz –
	   dort blättert man ohnehin mit dem Daumen. */
	.svh-rail__punkt--oben {
		display: none;
	}

	body.svh-hat-bar {
		padding-bottom: var(--svh-bar-hoehe);
	}
}

/* ------------------------------------------------------------------ *
 * Wegweiser
 * ------------------------------------------------------------------ */

.svh-chat {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9995;
	font-size: 15px;
	line-height: 1.5;
	color: var(--svh-text);
}

.svh-chat .svh-chat__blase {
	position: relative;
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: var(--svh-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: var(--svh-schatten);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .18s ease, background-color .18s ease;
}

.svh-chat .svh-chat__blase:hover {
	transform: scale(1.05);
}

.svh-chat .svh-chat__blase:focus-visible {
	outline: 3px solid var(--svh-dunkel);
	outline-offset: 3px;
}

.svh-chat .svh-chat__blase .svh-icon {
	width: 27px;
	height: 27px;
}

.svh-chat .svh-chat__blase-zeichen {
	position: absolute;
	display: flex;
	transition: opacity .16s ease, transform .16s ease;
}

.svh-chat .svh-chat__blase-zeichen--zu {
	opacity: 0;
	transform: rotate(-45deg);
}

.svh-chat.is-offen .svh-chat__blase-zeichen[data-svh-zeichen="chat"] {
	opacity: 0;
	transform: rotate(45deg);
}

.svh-chat.is-offen .svh-chat__blase-zeichen--zu {
	opacity: 1;
	transform: none;
}

.svh-chat__panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: 370px;
	max-width: calc(100vw - 32px);
	max-height: min(70vh, 560px);
	background: var(--svh-weiss);
	border-radius: var(--svh-radius);
	box-shadow: var(--svh-schatten);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.svh-chat__panel[hidden] {
	display: none;
}

.svh-chat__kopf {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 16px 14px 18px;
	background: var(--svh-dunkel);
	color: #fff;
}

.svh-chat__titel {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
}

.svh-chat__unter {
	margin: 2px 0 0;
	font-size: 12.5px;
	color: rgba(255, 255, 255, .72);
}

.svh-chat .svh-chat__zu {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.svh-chat .svh-chat__zu:hover {
	background: rgba(255, 255, 255, .24);
}

.svh-chat .svh-chat__zu .svh-icon {
	width: 16px;
	height: 16px;
}

.svh-chat__lauf {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	background: var(--svh-hell);
	display: flex;
	flex-direction: column;
	gap: 10px;
	overscroll-behavior: contain;
}

.svh-blase {
	max-width: 86%;
	padding: 11px 14px;
	border-radius: 14px;
	font-size: 14.5px;
}

.svh-blase p {
	margin: 0 0 8px;
}

.svh-blase p:last-child {
	margin-bottom: 0;
}

.svh-blase ul,
.svh-blase ol {
	margin: 0 0 8px;
	padding-left: 20px;
}

.svh-blase li {
	margin: 0 0 3px;
}

.svh-blase a {
	color: var(--svh-primary);
}

.svh-blase--wir {
	align-self: flex-start;
	background: var(--svh-weiss);
	border: 1px solid var(--svh-linie);
	border-bottom-left-radius: 4px;
	color: var(--svh-text);
}

.svh-blase--du {
	align-self: flex-end;
	background: var(--svh-primary);
	border-bottom-right-radius: 4px;
	color: #fff;
}

.svh-blase--du p {
	color: #fff;
}

.svh-chat .svh-blase__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--svh-primary);
	color: #fff !important;
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 600;
}

.svh-chat .svh-blase__link:hover {
	background: var(--svh-dunkel);
}

.svh-chat .svh-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-self: flex-start;
	max-width: 96%;
}

.svh-chat .svh-chip {
	border: 1px solid var(--svh-primary);
	background: var(--svh-weiss);
	color: var(--svh-primary);
	border-radius: 999px;
	padding: 7px 13px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	transition: background-color .15s ease, color .15s ease;
}

.svh-chat .svh-chip:hover,
.svh-chat .svh-chip:focus-visible {
	background: var(--svh-primary);
	color: #fff;
	outline: none;
}

.svh-chat .svh-chip--leise {
	border-color: var(--svh-linie);
	color: var(--svh-grau);
}

.svh-chat .svh-chip--leise:hover,
.svh-chat .svh-chip--leise:focus-visible {
	background: var(--svh-dunkel);
	border-color: var(--svh-dunkel);
	color: #fff;
}

.svh-denkt {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 13px 15px;
	background: var(--svh-weiss);
	border: 1px solid var(--svh-linie);
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.svh-denkt span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--svh-grau);
	animation: svh-huepf 1.1s infinite ease-in-out;
}

.svh-denkt span:nth-child(2) {
	animation-delay: .15s;
}

.svh-denkt span:nth-child(3) {
	animation-delay: .3s;
}

@keyframes svh-huepf {
	0%, 60%, 100% { transform: translateY(0); opacity: .45; }
	30%           { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.svh-denkt span {
		animation: none;
	}
}

.svh-chat__fuss {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	padding: 12px;
	background: var(--svh-weiss);
	border-top: 1px solid var(--svh-linie);
}

.svh-chat .svh-chat__eingabe {
	flex: 1 1 auto;
	min-width: 0;
	border: 1px solid var(--svh-linie);
	border-radius: 999px;
	padding: 10px 16px;
	font: inherit;
	font-size: 14.5px;
	color: var(--svh-text);
	background: var(--svh-weiss);
}

.svh-chat .svh-chat__eingabe:focus {
	outline: none;
	border-color: var(--svh-primary);
	box-shadow: 0 0 0 3px rgba(220, 0, 106, .14);
}

.svh-chat .svh-chat__senden {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: var(--svh-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.svh-chat .svh-chat__senden:hover {
	background: var(--svh-dunkel);
}

.svh-chat .svh-chat__senden .svh-icon {
	width: 19px;
	height: 19px;
}

/* Das Mailformular im Gesprächsverlauf */

.svh-mail {
	align-self: stretch;
	background: var(--svh-weiss);
	border: 1px solid var(--svh-linie);
	border-radius: 14px;
	padding: 14px;
}

.svh-mail__titel {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 700;
	color: var(--svh-dunkel);
}

.svh-chat .svh-mail__feld {
	display: block;
	margin: 0 0 9px;
}

.svh-chat .svh-mail__feld > span {
	display: block;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--svh-grau);
	margin-bottom: 3px;
}

.svh-chat .svh-mail__feld em {
	font-weight: 400;
	font-style: normal;
	opacity: .8;
}

.svh-chat .svh-mail__feld input,
.svh-chat .svh-mail__feld textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--svh-linie);
	border-radius: 9px;
	padding: 8px 11px;
	font: inherit;
	font-size: 14px;
	color: var(--svh-text);
	background: var(--svh-weiss);
	resize: vertical;
}

.svh-chat .svh-mail__feld input:focus,
.svh-chat .svh-mail__feld textarea:focus {
	outline: none;
	border-color: var(--svh-primary);
	box-shadow: 0 0 0 3px rgba(220, 0, 106, .14);
}

.svh-chat .svh-mail__einwilligung {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-size: 12.5px;
	color: var(--svh-grau);
	margin: 0 0 10px;
}

.svh-chat .svh-mail__einwilligung input {
	margin-top: 2px;
	flex: 0 0 auto;
}

.svh-mail__falle {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.svh-chat .svh-mail__senden {
	width: 100%;
	border: 0;
	border-radius: 999px;
	background: var(--svh-primary);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	padding: 11px 16px;
	cursor: pointer;
}

.svh-chat .svh-mail__senden:hover {
	background: var(--svh-dunkel);
}

.svh-chat .svh-mail__senden[disabled] {
	opacity: .55;
	cursor: default;
}

.svh-mail__meldung {
	margin: 9px 0 0;
	font-size: 13px;
	color: var(--svh-grau);
}

.svh-mail__meldung.is-fehler {
	color: #b32d2e;
	font-weight: 600;
}

/* Handy: das Fenster nimmt die Breite ein und weicht der unteren Leiste aus. */
@media (max-width: 860px) {
	.svh-chat {
		right: 14px;
		bottom: calc(var(--svh-bar-hoehe) + 12px + env(safe-area-inset-bottom, 0px));
	}

	body:not(.svh-hat-bar) .svh-chat {
		bottom: 16px;
	}

	.svh-chat__panel {
		position: fixed;
		right: 10px;
		left: 10px;
		bottom: calc(var(--svh-bar-hoehe) + 82px + env(safe-area-inset-bottom, 0px));
		width: auto;
		max-width: none;
		max-height: min(64vh, 480px);
	}

	body:not(.svh-hat-bar) .svh-chat__panel {
		bottom: 86px;
	}

	.svh-chat .svh-chat__blase {
		width: 54px;
		height: 54px;
	}
}

/* Wird gelesen, aber nicht gesehen – falls das Theme die Klasse nicht kennt. */
.svh-chat .screen-reader-text,
.svh-rail .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media print {
	.svh-rail,
	.svh-chat {
		display: none !important;
	}
}
