/**
 * Textzähler – Stylesheet
 *
 * Wichtige Regeln:
 * - Jede einzelne Regel ist unter dem Container ".tz-plugin" verschachtelt.
 * - Es gibt keine globalen Element-Selektoren (body, h1, p, button, input, ...).
 * - Es wird keine eigene Schriftart geladen; font-family wird vom Theme geerbt.
 * - Alle Farben/Abstände sind über CSS-Custom-Properties zentral definiert,
 *   die selbst nur innerhalb von .tz-plugin gültig sind (kein Leck nach außen).
 */

.tz-plugin {
	--tz-color-primary: #3452ff;
	--tz-color-bg: #ffffff;
	--tz-color-bg-subtle: #f8fafc;
	--tz-color-border: #e2e8f0;
	--tz-color-text-secondary: #64748b;
	--tz-radius: 6px;
	--tz-space-1: 4px;
	--tz-space-2: 8px;
	--tz-space-3: 12px;
	--tz-space-4: 16px;
	--tz-space-5: 24px;

	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--tz-space-5);
	max-width: 100%;
	color: inherit;
	font-family: inherit;
	line-height: 1.5;
}

.tz-plugin *,
.tz-plugin *::before,
.tz-plugin *::after {
	box-sizing: inherit;
}

@media (min-width: 800px) {
	.tz-plugin {
		flex-direction: row;
		align-items: flex-start;
	}

	.tz-plugin .tz-input-area {
		flex: 1 1 45%;
		position: sticky;
		top: var(--tz-space-4);
		min-width: 0;
	}

	.tz-plugin .tz-results {
		flex: 1 1 55%;
		min-width: 0;
		margin-top: 30px; /* Neu hinzugefügt */
	}
}

.tz-plugin .tz-input-area {
	display: flex;
	flex-direction: column;
	gap: var(--tz-space-2);
	min-width: 0;
}

.tz-plugin .tz-label {
	font-weight: 600;
	font-size: 0.95em;
}

.tz-plugin .tz-input {
	width: 100%;
	min-height: 220px;
	resize: vertical;
	padding: var(--tz-space-3);
	border: 1px solid var(--tz-color-border);
	border-radius: var(--tz-radius);
	background-color: var(--tz-color-bg);
	color: inherit;
	font: inherit;
	line-height: 1.6;
}

.tz-plugin .tz-input:focus-visible {
	outline: 2px solid var(--tz-color-primary);
	outline-offset: 2px;
	border-color: var(--tz-color-primary);
}

.tz-plugin .tz-hint {
	margin: 0;
	font-size: 0.85em;
	color: var(--tz-color-text-secondary);
}

.tz-plugin .tz-results {
	display: flex;
	flex-direction: column;
	gap: var(--tz-space-5);
	min-width: 0;
}

.tz-plugin .tz-highlight-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--tz-space-3);
}

@media (min-width: 480px) {
	.tz-plugin .tz-highlight-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.tz-plugin .tz-stat--highlight {
	display: flex;
	flex-direction: column;
	gap: var(--tz-space-1);
	padding: var(--tz-space-4);
	background-color: var(--tz-color-bg-subtle);
	border: 1px solid var(--tz-color-border);
	border-radius: var(--tz-radius);
	min-width: 0;
}

.tz-plugin .tz-stat-value {
	font-size: 1.6em;
	font-weight: 700;
	line-height: 1.15;
	color: var(--tz-color-primary);
	overflow-wrap: anywhere;
}

.tz-plugin .tz-stat-label {
	font-size: 0.8em;
	color: var(--tz-color-text-secondary);
}

.tz-plugin .tz-section {
	border-top: 1px solid var(--tz-color-border);
	padding-top: var(--tz-space-4);
}

.tz-plugin .tz-section-title {
	margin: 0 0 var(--tz-space-3) 0;
	font-size: 0.85em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--tz-color-text-secondary);
}

.tz-plugin .tz-stat-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--tz-space-1);
}

.tz-plugin .tz-stat-list li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--tz-space-3);
	padding: var(--tz-space-2) 0;
	border-bottom: 1px solid var(--tz-color-border);
	font-size: 0.95em;
}

.tz-plugin .tz-stat-list li:last-child {
	border-bottom: none;
}

.tz-plugin .tz-li-label {
	color: var(--tz-color-text-secondary);
}

.tz-plugin .tz-li-value {
	font-weight: 600;
	text-align: right;
	max-width: 60%;
	overflow-wrap: anywhere;
}

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

@media (max-width: 479px) {
	.tz-plugin .tz-stat-list li {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--tz-space-1);
	}

	.tz-plugin .tz-li-value {
		text-align: left;
		max-width: 100%;
	}
}
