/* schlank schlafen: Rechner. Farben aus dem Theme (Variablen), mit Rückfallwerten. */
.lwm-rechner {
	--r-tinte: var(--lwm-tinte, #1c2340);
	--r-grau: var(--lwm-grau, #5a6178);
	--r-linie: var(--lwm-linie, #e4e7f0);
	--r-grund: var(--lwm-grund, #f6f7fb);
	--r-akzent: var(--lwm-akzent, #2f7d6b);
	--r-akzent-dunkel: var(--lwm-akzent-dunkel, #1f5e4f);
	--r-nacht: var(--lwm-nacht, #1f2a4d);
	--r-mond: var(--lwm-mond, #f2c66d);
	background: #fff;
	border: 1px solid var(--r-linie);
	border-radius: 24px;
	box-sizing: border-box;
	color: var(--r-tinte);
	margin: 0 0 32px;
	padding: clamp(20px, 4vw, 32px);
}

.lwm-rechner *,
.lwm-rechner *::before,
.lwm-rechner *::after { box-sizing: border-box; }

.lwm-rechner__gruppe { border: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; }
.lwm-rechner__gruppe legend { font-size: 15px; font-weight: 700; margin-bottom: 10px; padding: 0; width: 100%; }

.lwm-rechner__wahl {
	align-items: center;
	background: var(--r-grund);
	border: 2px solid var(--r-linie);
	border-radius: 12px;
	cursor: pointer;
	display: inline-flex;
	font-size: 15px;
	gap: 8px;
	min-height: 48px;
	padding: 8px 14px;
}

.lwm-rechner__wahl:has(input:checked) { background: #e3f1ec; border-color: var(--r-akzent); }
.lwm-rechner__wahl input { accent-color: var(--r-akzent); height: 18px; margin: 0; width: 18px; }

.lwm-rechner__felder { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.lwm-rechner__feld { display: flex; flex: 1 1 160px; flex-direction: column; gap: 6px; margin: 0; }
.lwm-rechner__feld--breit { margin-bottom: 20px; }
.lwm-rechner__feld label { font-size: 15px; font-weight: 700; }

.lwm-rechner input[type="number"],
.lwm-rechner input[type="time"],
.lwm-rechner select {
	background: #f9fafc;
	border: 2px solid #d5dae6;
	border-radius: 12px;
	color: var(--r-tinte);
	font: inherit;
	font-size: 17px;
	min-height: 52px;
	padding: 0 14px;
	width: 100%;
}

.lwm-rechner input:focus,
.lwm-rechner select:focus { border-color: var(--r-akzent); outline: 3px solid var(--r-mond); outline-offset: 1px; }

.lwm-rechner__ergebnis { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 12px; }

.lwm-rechner__kachel {
	background: var(--r-grund);
	border-radius: 16px;
	display: flex;
	flex: 1 1 200px;
	flex-direction: column;
	gap: 2px;
	padding: 16px 20px;
}

.lwm-rechner__kachel--haupt { background: var(--r-nacht); color: #fff; }
.lwm-rechner__label { color: var(--r-grau); font-size: 14px; font-weight: 700; margin: 0; }
.lwm-rechner__kachel--haupt .lwm-rechner__label { color: var(--r-mond); }
.lwm-rechner__wert { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.lwm-rechner__einheit { font-size: 15px; }
.lwm-rechner__kachel--haupt .lwm-rechner__einheit { color: #c9d0e6; }

.lwm-rechner__ergebnis--liste { display: block; }
.lwm-rechner__zeiten { display: grid; gap: 10px; list-style: none; margin: 10px 0 0; padding: 0; }

.lwm-rechner__zeiten li {
	align-items: baseline;
	background: var(--r-grund);
	border-radius: 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin: 0;
	padding: 14px 18px;
}

.lwm-rechner__zeiten strong { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; min-width: 6.5ch; }
.lwm-rechner__zeiten span { color: var(--r-grau); font-size: 15px; }

.lwm-rechner__zeiten em {
	border-radius: 999px;
	font-size: 13px;
	font-style: normal;
	font-weight: 700;
	margin-left: auto;
	padding: 3px 10px;
}

.lwm-rechner__zeiten em.ist-gut { background: #e3f1ec; color: var(--r-akzent-dunkel); }
.lwm-rechner__zeiten em.ist-knapp { background: #fbe9dc; color: #8a4519; }

/* Skala WHtR: 0,3 bis 0,8; Grenzen bei 0,4 / 0,5 / 0,6 = 20 / 40 / 60 %. */
.lwm-rechner__skala {
	background: linear-gradient(90deg, #9db7e8 0 20%, #8fcdb8 20% 40%, #f2c66d 40% 60%, #e89b7a 60% 100%);
	border-radius: 999px;
	height: 12px;
	margin-top: 8px;
	position: relative;
}

.lwm-rechner__marke {
	background: var(--r-tinte);
	border-radius: 3px;
	height: 24px;
	left: 0;
	margin-left: -3px;
	position: absolute;
	top: -6px;
	transition: left 0.2s ease;
	width: 6px;
}

.lwm-rechner__legende { color: var(--r-grau); display: grid; font-size: 13px; grid-template-columns: 20fr 20fr 20fr 40fr; margin-top: 10px; }
.lwm-rechner__legende span { padding-right: 4px; }

.lwm-rechner__hinweis { font-size: 15px; font-weight: 600; margin: 14px 0 0; min-height: 1px; }
.lwm-rechner__hinweis:empty { display: none; }
.lwm-rechner__fuss { color: var(--r-grau); font-size: 14px; margin: 16px 0 0; }

@media (prefers-reduced-motion: reduce) {
	.lwm-rechner__marke { transition: none; }
}

.lwm-rechner__wahl--zeile { display: flex; margin: -4px 0 16px; }

/* Sichtbarer Fokus für Auswahlfelder (Kontrast ≥ 3:1). */
.lwm-rechner__wahl:has(input:focus-visible) { outline: 3px solid var(--r-akzent-dunkel); outline-offset: 2px; }
.lwm-rechner input[aria-invalid="true"] { border-color: #b3261e; }
