/* A&B Assistent: neutrale Basis, Barrierefreiheit unabhängig vom Theme. */
.abas {
	--abas-text: var(--ab-text, #1d2327);
	--abas-muted: var(--ab-text-muted, #50575e);
	--abas-surface: var(--ab-surface, #fff);
	--abas-soft: #f6f7f7;
	--abas-line: var(--ab-line, #8c8f94);
	--abas-action: var(--ab-action, #2271b1);
	--abas-action-hover: var(--ab-action-hover, #135e96);
	--abas-focus: var(--ab-focus, #005fcc);
	--abas-error: #9d2020;
	--abas-error-bg: #fff2f2;
	--abas-pet-groesse: 64;
	color: var(--abas-text);
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 1rem;
	line-height: 1.5;
}
.abas,
.abas * {
	box-sizing: border-box;
}
.abas [hidden] {
	display: none !important;
}
.abas-sr,
.abas-falle {
	border: 0;
	clip: rect(0 0 0 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* Knopf unten rechts */
.abas-knopf {
	align-items: center;
	background: var(--abas-surface);
	border: 1px solid var(--abas-line);
	border-radius: 4px;
	bottom: 16px;
	color: var(--abas-text);
	cursor: pointer;
	display: flex;
	font: inherit;
	gap: 8px;
	min-height: 44px;
	padding: 6px 14px 6px 8px;
	position: fixed;
	right: 16px;
	z-index: 99990;
}
.abas-knopf:hover {
	border-color: var(--abas-action);
}
.abas-pet {
	display: inline-block;
	flex: none;
	height: 64px;
	min-width: 32px;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
	width: 64px;
}
.abas-pet-kopf {
	height: 64px;
	width: 64px;
}

/* Fenster */
.abas-fenster {
	background: var(--abas-surface);
	border: 1px solid var(--abas-line);
	border-radius: 4px;
	bottom: 16px;
	display: flex;
	flex-direction: column;
	max-height: min(640px, calc(100vh - 32px));
	overflow: hidden;
	position: fixed;
	right: 16px;
	width: min(400px, calc(100vw - 32px));
	z-index: 99991;
}
.abas-eingebettet .abas-fenster {
	max-height: none;
	min-height: 520px;
	position: static;
	width: min(560px, 100%);
}
.abas-eingebettet .abas-verlauf {
	max-height: 60vh;
}
.abas-kopf {
	align-items: center;
	border-bottom: 1px solid var(--abas-line);
	display: flex;
	gap: 10px;
	padding: 10px 12px;
}
.abas-kopf-text {
	flex: 1;
	min-width: 0;
}
.abas-titel {
	font-size: 1.1rem;
	line-height: 1.3;
	margin: 0;
}
.abas-ki-hinweis {
	color: var(--abas-muted);
	font-size: 0.85rem;
	margin: 2px 0 0;
}
.abas-zu {
	background: transparent;
	border: 1px solid transparent;
	border-radius: 3px;
	color: var(--abas-text);
	cursor: pointer;
	font-size: 1.6rem;
	line-height: 1;
	min-height: 44px;
	min-width: 44px;
}
.abas-zu:hover {
	border-color: var(--abas-line);
}
.abas-einwilligung,
.abas-einstieg,
.abas-eingabe {
	padding: 12px;
}
.abas-einwilligung p {
	margin: 0 0 10px;
}
.abas-knoepfe,
.abas-einstieg {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.abas-einstieg {
	border-top: 1px solid #dcdcde;
}
.abas-einwilligung {
	overflow-y: auto;
}
/* Feste Teile schrumpfen nie; nur der Verlauf scrollt (sonst wurde die Statuszeile abgeschnitten, bis 1.6). */
.abas-kopf,
.abas-eingabe,
.abas-einstieg,
.abas-status {
	flex: none;
}
.abas-verlauf {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 12px;
}
.abas-nachricht {
	border-radius: 4px;
	margin: 0 0 10px;
	max-width: 92%;
	overflow-wrap: anywhere;
	padding: 8px 12px;
}
.abas-nachricht p,
.abas-nachricht ul {
	margin: 0 0 8px;
}
.abas-nachricht > :last-child,
.abas-nachricht p:last-child {
	margin-bottom: 0;
}
.abas-von-assistent {
	background: var(--abas-soft);
	border: 1px solid #dcdcde;
}
.abas-von-person {
	background: #e6f0f8;
	border: 1px solid #a7c4dd;
	margin-left: auto;
}
.abas-hinweis-fehler {
	background: var(--abas-error-bg);
	border-color: var(--abas-error);
	color: var(--abas-error);
}
.abas-nachricht a {
	color: var(--abas-action);
	text-decoration: underline;
}
.abas-eingabe {
	align-items: flex-end;
	border-top: 1px solid var(--abas-line);
	display: flex;
	gap: 8px;
}
.abas-eingabe textarea {
	border: 1px solid var(--abas-line);
	border-radius: 3px;
	color: var(--abas-text);
	flex: 1;
	font: inherit;
	min-height: 44px;
	padding: 8px;
	resize: vertical;
}
.abas-status {
	color: var(--abas-muted);
	font-size: 0.9rem;
	margin: 0;
	min-height: 0;
	padding: 0 12px 8px;
}
.abas-status:empty {
	padding: 0;
}

/* Bedienflächen */
.abas-button,
.abas-link {
	align-items: center;
	background: var(--abas-action);
	border: 1px solid var(--abas-action);
	border-radius: 3px;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	justify-content: center;
	min-height: 44px;
	padding: 6px 14px;
	text-decoration: none;
}
.abas-button:hover,
.abas-link:hover {
	background: var(--abas-action-hover);
	border-color: var(--abas-action-hover);
	color: #fff;
}
.abas-button-zweit {
	background: var(--abas-surface);
	color: var(--abas-action);
}
.abas-button-zweit:hover {
	background: #f0f6fc;
	color: var(--abas-action-hover);
}
.abas-button:disabled {
	cursor: wait;
	opacity: 0.7;
}
.abas .abas-link {
	color: #fff;
	margin: 4px 6px 0 0;
	text-decoration: none;
}

/* Allgemeine Auskunft und Bewertung (seit 1.3) */
.abas-allgemein {
	border-left: 3px solid var(--abas-line);
	color: var(--abas-muted);
	font-size: 0.85rem;
	margin: 8px 0 0;
	padding-left: 8px;
}
.abas-bewertung {
	display: flex;
	gap: 2px;
	justify-content: flex-end;
	margin: 4px -6px -6px 0;
}
/* Dezent: nur ein Daumen, 44 × 44 Pixel Bedienfläche, Text für Vorleser in .abas-sr. */
.abas-bewerten {
	align-items: center;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 3px;
	color: var(--abas-muted);
	cursor: pointer;
	display: inline-flex;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
	padding: 0;
}
.abas-bewerten:hover {
	border-color: var(--abas-line);
	color: var(--abas-text);
}
.abas-bewerten[aria-pressed="true"] {
	background: var(--abas-surface);
	border-color: var(--abas-action);
	color: var(--abas-action);
}
.abas-daumen {
	display: block;
}
/* Darstellung „Daumen mit Text“ (Einstellung abas_bewertung_stil = text). */
.abas-bewertung-text {
	gap: 6px;
	justify-content: flex-start;
	margin: 8px 0 0;
}
.abas-bewertung-text .abas-bewerten {
	border-color: var(--abas-line);
	color: var(--abas-text);
	font: inherit;
	font-size: 0.85rem;
	gap: 6px;
	padding: 4px 10px;
}
.abas-bewertung-text .abas-bewerten[aria-pressed="true"] {
	background: var(--abas-action);
	border-color: var(--abas-action);
	color: #fff;
	font-weight: 600;
}

/* Karten */
.abas-karte {
	background: var(--abas-surface);
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	margin-top: 8px;
	padding: 10px;
}
.abas-karte-titel,
.abas-produkt-name {
	font-weight: 600;
	margin: 0 0 6px;
}
.abas-produkte,
.abas-posten {
	list-style: none;
	margin: 0;
	padding: 0;
}
.abas-produkt + .abas-produkt {
	border-top: 1px solid #dcdcde;
	margin-top: 8px;
	padding-top: 8px;
}
.abas-preis {
	font-weight: 600;
}
.abas-hinweis {
	color: var(--abas-muted);
	font-size: 0.85rem;
}
.abas-feld {
	margin: 0 0 10px;
}
.abas-feld label {
	display: block;
	font-weight: 600;
	margin-bottom: 2px;
}
.abas-feld-haken label {
	display: inline;
	font-weight: 400;
}
.abas-feld input:not([type=checkbox]),
.abas-feld select,
.abas-feld textarea {
	border: 1px solid var(--abas-line);
	border-radius: 3px;
	color: var(--abas-text);
	font: inherit;
	min-height: 44px;
	padding: 6px 8px;
	width: 100%;
}
.abas-feld input[type=checkbox] {
	height: 24px;
	vertical-align: middle;
	width: 24px;
}
.abas-pflicht {
	color: var(--abas-muted);
	font-weight: 400;
}
.abas-feldfehler {
	color: var(--abas-error);
	display: block;
	font-size: 0.9rem;
}
[aria-invalid="true"] {
	border-color: var(--abas-error) !important;
	border-width: 2px !important;
}
.abas-fehlerliste {
	background: var(--abas-error-bg);
	border: 2px solid var(--abas-error);
	border-radius: 3px;
	color: var(--abas-error);
	padding: 8px;
}
.abas-fehlerliste a {
	color: var(--abas-error);
	display: block;
}

/* Fokus nach Familienstandard */
.abas :is(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 3px solid var(--abas-focus);
	outline-offset: 2px;
}
@supports not selector(:focus-visible) {
	.abas :is(a, button, input, select, textarea, [tabindex]):focus {
		outline: 3px solid var(--abas-focus);
		outline-offset: 2px;
	}
}

@media (max-width: 480px) {
	.abas-fenster:not(.abas-eingebettet .abas-fenster) {
		border-radius: 0;
		bottom: 0;
		max-height: 100vh;
		max-height: 100dvh;
		right: 0;
		width: 100vw;
	}
	.admin-bar .abas-fenster:not(.abas-eingebettet .abas-fenster) {
		max-height: calc(100vh - 46px);
		max-height: calc(100dvh - 46px);
	}
	.abas-knopf-text {
		display: none;
	}
}
@media (forced-colors: active) {
	.abas-knopf,
	.abas-fenster,
	.abas-nachricht,
	.abas-karte,
	.abas-button,
	.abas-link {
		border: 1px solid CanvasText;
	}
	.abas :is(a, button, input, select, textarea, [tabindex]):focus-visible {
		outline-color: Highlight;
	}
	.abas-bewerten[aria-pressed="true"] {
		border: 2px solid Highlight;
	}
}
@media (prefers-reduced-motion: reduce) {
	.abas * {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
@media print {
	.abas {
		display: none;
	}
}
