/* Brambor-Kostenrechner – nutzt die Farben und Schriften des Themes (Ollie/brambor), mit Rückfallwerten */
.bkr {
	--bkr-primary: var(--wp--preset--color--primary, #1a2d6b);
	--bkr-akzent: var(--wp--preset--color--primary-alt, #2ba6de);
	--bkr-text: var(--wp--preset--color--main, #2c393f);
	--bkr-leise: var(--wp--preset--color--secondary, #56676d);
	--bkr-rand: var(--wp--preset--color--border-light, #e1e6ef);
	--bkr-flaeche: var(--wp--preset--color--tertiary, #f4f6fa);
	--bkr-hell: var(--wp--preset--color--primary-accent, #e8ecf6);
	--bkr-weiss: var(--wp--preset--color--base, #fff);
	--bkr-pd: var(--wp--preset--color--bereich-haeusliche-pflege, #29b34a);
	--bkr-tp: var(--wp--preset--color--bereich-tagespflege, #1fb8d4);
	--bkr-kzp: var(--wp--preset--color--bereich-kurzzeitpflege, #3cc48a);
	--bkr-gruen: #1f7a45;
	color: var(--bkr-text);
	font-size: var(--wp--preset--font-size--base, 1.2rem);
	line-height: 1.5;
}
.bkr *, .bkr *::before, .bkr *::after { box-sizing: border-box; }
.bkr-form { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) {
	.bkr-form { grid-template-columns: minmax(0, 1fr) 380px; gap: 2.5rem; }
	.bkr-ergebnis { position: sticky; top: 1.5rem; }
}
.bkr-eingabe { display: grid; gap: 1.75rem; min-width: 0; container-type: inline-size; }
.bkr fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.bkr legend, .bkr h3, .bkr .bkr-teil-titel { font-weight: 700; font-size: var(--wp--preset--font-size--medium, 1.6rem); line-height: 1.25; color: var(--bkr-primary); margin: 0 0 .75rem; padding: 0; }
.bkr h3, .bkr .bkr-teil-titel { font-size: 1.35rem; }
.bkr-nr { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--bkr-primary); color: var(--bkr-weiss); font-size: 1rem; margin-right: .6rem; vertical-align: .15em; }
.bkr-leise { color: var(--bkr-leise); font-weight: 400; }
legend .bkr-leise { font-size: 1rem; }
.bkr-klein { font-size: var(--wp--preset--font-size--small, 1.05rem); margin: .5rem 0 0; }
.bkr-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fokus gut sichtbar */
.bkr :focus-visible { outline: 3px solid var(--bkr-akzent); outline-offset: 2px; }

/* 1 · Pflegegrad: fünf große Knöpfe */
.bkr-pg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; max-width: 30rem; }
.bkr-pg-kein { grid-column: 1 / -1; }
@media (min-width: 480px) { .bkr-pg { grid-template-columns: 1.6fr repeat(5, minmax(0, 1fr)); } .bkr-pg-kein { grid-column: auto; } }
.bkr-pg label { position: relative; }
.bkr-pg input, .bkr-angebot input, .bkr-haeuser input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.bkr-pg span { display: grid; place-items: center; height: 3.5rem; border: 2px solid var(--bkr-rand); border-radius: 10px; background: var(--bkr-weiss); font-size: 1.5rem; font-weight: 700; color: var(--bkr-primary); }
.bkr-pg .bkr-pg-kein span { font-size: 1.1rem; white-space: nowrap; padding: 0 .5rem; }
.bkr-pg input:checked + span { background: var(--bkr-primary); border-color: var(--bkr-primary); color: var(--bkr-weiss); }
.bkr-pg input:focus-visible + span { outline: 3px solid var(--bkr-akzent); outline-offset: 2px; }

/* 2 · Angebote als Karten mit Bereichsfarbe */
.bkr-angebote { display: grid; gap: .75rem; }
/* Drei Spalten nach Breite der Eingabespalte, nicht des Fensters: auf dem iPad steht die Schätzung daneben (27.10.2026) */
@container (min-width: 720px) { .bkr-angebote { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bkr-angebot { position: relative; display: block; }
.bkr-angebot span { display: grid; gap: .2rem; height: 100%; padding: 1rem 1rem 1rem 3.1rem; border: 2px solid var(--bkr-rand); border-left: 6px solid var(--bkr-farbe); border-radius: 10px; background: var(--bkr-weiss); font-size: 1rem; color: var(--bkr-leise); }
.bkr-angebot strong { font-size: 1.2rem; color: var(--bkr-primary); }
.bkr-angebot strong, .bkr-haeuser strong { overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.bkr-angebot span::before { content: ""; position: absolute; left: 1.1rem; top: 1.2rem; width: 1.3rem; height: 1.3rem; border: 2px solid var(--bkr-leise); border-radius: 4px; background: var(--bkr-weiss); }
.bkr-angebot input:checked + span { border-color: var(--bkr-farbe); background: color-mix(in srgb, var(--bkr-farbe) 8%, var(--bkr-weiss)); }
.bkr-angebot input:checked + span::before { background: var(--bkr-farbe) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat; border-color: var(--bkr-farbe); }
.bkr-angebot input:focus-visible + span { outline: 3px solid var(--bkr-akzent); outline-offset: 2px; }
.bkr-pd { --bkr-farbe: var(--bkr-pd); }
.bkr-tp { --bkr-farbe: var(--bkr-tp); }
.bkr-kzp { --bkr-farbe: var(--bkr-kzp); }

/* Abschnitte je Angebot */
.bkr-teil { border-left: 6px solid var(--bkr-farbe); background: var(--bkr-flaeche); border-radius: 10px; padding: 1.25rem 1.25rem 1.5rem; display: grid; gap: .75rem; }
.bkr-teil[hidden] { display: none; }
.bkr-teil > * { margin: 0; }
.bkr-gruppe { background: var(--bkr-weiss); border: 1px solid var(--bkr-rand); border-radius: 10px; }
.bkr-gruppe > summary { cursor: pointer; padding: .9rem 1rem; font-weight: 700; color: var(--bkr-primary); display: flex; gap: .75rem; align-items: center; min-height: 3rem; }
.bkr-zaehler { margin-left: auto; font-size: .95rem; font-weight: 600; color: var(--bkr-gruen); }
.bkr-liste { list-style: none; margin: 0; padding: 0 1rem .5rem; }
.bkr-liste > li { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; padding: .85rem 0; border-top: 1px solid var(--bkr-rand); margin: 0; }
.bkr-lk { min-width: 0; display: grid; gap: .1rem; font-size: 1.05rem; }
.bkr-lk label { font-weight: 600; }
.bkr-preis { font-size: .95rem; color: var(--bkr-leise); }
.bkr-umfasst summary { cursor: pointer; font-size: .95rem; color: var(--wp--preset--color--primary-alt-accent, #13224f); text-decoration: underline; width: max-content; }
.bkr-umfasst ul { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .95rem; color: var(--bkr-leise); }

/* Zahl mit Plus/Minus – große Flächen zum Tippen */
.bkr-zahl { display: flex; align-items: stretch; flex: none; border: 2px solid var(--bkr-rand); border-radius: 10px; background: var(--bkr-weiss); overflow: hidden; height: 3rem; }
.bkr-zahl button { width: 2.9rem; border: 0; background: var(--bkr-hell); color: var(--bkr-primary); font-size: 1.5rem; font-weight: 700; cursor: pointer; padding: 0; line-height: 1; }
.bkr-zahl button:hover { background: var(--bkr-primary); color: var(--bkr-weiss); }
.bkr-zahl input { width: 3.2rem; border: 0; text-align: center; font: inherit; font-weight: 700; color: var(--bkr-primary); background: transparent; -moz-appearance: textfield; appearance: textfield; }
.bkr-zahl input::-webkit-outer-spin-button, .bkr-zahl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bkr-zeile { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--bkr-weiss); border: 1px solid var(--bkr-rand); border-radius: 10px; padding: .75rem 1rem; }
.bkr-zeile label { font-weight: 600; }

/* Tagespflege-Häuser */
.bkr-haeuser { display: grid; gap: .6rem; }
@container (min-width: 720px) { .bkr-haeuser { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bkr-haeuser label { position: relative; display: block; }
.bkr-haeuser span { display: grid; gap: .15rem; height: 100%; padding: .8rem 1rem; border: 2px solid var(--bkr-rand); border-radius: 10px; background: var(--bkr-weiss); font-size: .95rem; color: var(--bkr-leise); }
.bkr-haeuser strong { color: var(--bkr-primary); font-size: 1.05rem; }
.bkr-haeuser input:checked + span { border-color: var(--bkr-tp); box-shadow: inset 0 0 0 1px var(--bkr-tp); background: color-mix(in srgb, var(--bkr-tp) 8%, var(--bkr-weiss)); }
.bkr-haeuser input:focus-visible + span { outline: 3px solid var(--bkr-akzent); outline-offset: 2px; }

/* Entlastungsbetrag */
.bkr-entlastung label { display: flex; gap: .75rem; align-items: flex-start; font-size: 1.05rem; cursor: pointer; }
.bkr-entlastung input { width: 1.4rem; height: 1.4rem; margin-top: .15rem; accent-color: var(--bkr-primary); flex: none; }

/* Ergebnis */
.bkr-ergebnis { background: var(--bkr-weiss); border: 2px solid var(--bkr-primary); border-radius: 14px; padding: 1.5rem; display: grid; gap: 1rem; scroll-margin-top: 1rem; }
.bkr-ergebnis h2 { margin: 0; font-size: 1.6rem; color: var(--bkr-primary); }
.bkr-ausgabe { display: grid; gap: 1rem; }
.bkr-ausgabe > * { margin: 0; }
.bkr-pg-anzeige { font-weight: 700; color: var(--bkr-leise); font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; margin: -.5rem 0 0 !important; }
.bkr-leer { color: var(--bkr-leise); font-size: 1.05rem; }
.bkr-tabelle { width: 100%; border-collapse: collapse; font-size: 1rem; font-variant-numeric: tabular-nums; }
.bkr-tabelle caption { text-align: left; font-weight: 700; color: var(--bkr-primary); font-size: 1.1rem; padding-bottom: .3rem; }
.bkr-tabelle caption span { font-weight: 400; color: var(--bkr-leise); font-size: .95rem; }
.bkr-tabelle th, .bkr-tabelle td { padding: .35rem 0; border-top: 1px solid var(--bkr-rand); text-align: left; font-weight: 400; vertical-align: top; }
.bkr-tabelle td { text-align: right; white-space: nowrap; padding-left: .75rem; }
.bkr-tabelle .bkr-kasse td { color: var(--bkr-gruen); font-weight: 600; }
.bkr-tabelle .bkr-summe th, .bkr-tabelle .bkr-summe td { font-weight: 700; border-top: 2px solid var(--bkr-text); }
.bkr-gesamt { background: var(--bkr-hell); border-radius: 10px; padding: 1rem; display: grid; gap: .5rem; }
.bkr-gesamt p { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-variant-numeric: tabular-nums; }
.bkr-entl span:last-child { color: var(--bkr-gruen); font-weight: 600; }
.bkr-gross span { font-weight: 700; color: var(--bkr-primary); }
.bkr-gross strong { font-size: 2rem; color: var(--bkr-primary); line-height: 1.1; }
.bkr-geld strong { font-size: 1.3rem; color: var(--bkr-gruen); }
.bkr-einzeln summary { cursor: pointer; font-weight: 600; color: var(--bkr-primary); }
.bkr-posten { margin-top: .5rem; font-size: .9rem; }
.bkr-posten thead th { font-weight: 600; color: var(--bkr-leise); border-top: 0; }
.bkr-posten thead th:not(:first-child) { text-align: right; }
.bkr-posten small { color: var(--bkr-leise); }
.bkr-vorlaeufig { color: #8a5a00; }
.bkr-hinweis { font-size: .95rem; color: var(--bkr-leise); margin: 0; border-top: 1px solid var(--bkr-rand); padding-top: .75rem; }
.bkr-knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; }
.bkr-knoepfe > * { flex: 1 1 auto; text-align: center; padding: .75rem 1rem; border-radius: 999px; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 3rem; }
.bkr-drucken { background: var(--bkr-weiss); color: var(--bkr-primary); border: 2px solid var(--bkr-primary); }
.bkr-beratung { background: var(--bkr-primary); color: var(--bkr-weiss) !important; border: 2px solid var(--bkr-primary); }
.bkr-druckkopf, .bkr-druckfuss { display: none; }

/* Leiste unten auf schmalen Bildschirmen */
.bkr-leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: .75rem; align-items: center; justify-content: center; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); background: var(--bkr-primary); color: var(--bkr-weiss) !important; text-decoration: none; font-size: 1rem; box-shadow: 0 -4px 16px rgba(0, 0, 0, .15); }
.bkr-leiste[hidden] { display: none; }
.bkr-leiste strong { font-size: 1.3rem; }

.bkr-druckblatt { display: none; }
/* Druck: nur das Ergebnis, mit Logo und Brambor-Blau */
@media print {
	@page { margin: 14mm 15mm; }
	html.bkr-druck body > *:not(.bkr-druckblatt) { display: none !important; }
	html.bkr-druck body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
	html.bkr-druck .bkr-druckblatt { display: block !important; }
	html.bkr-druck .bkr-ergebnis { position: static; width: 100%; border: 0; padding: 0; gap: 10pt; font-size: 10.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	html.bkr-druck .bkr-knoepfe, html.bkr-druck .bkr-einzeln > summary { display: none !important; }
	html.bkr-druck .bkr-druckkopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 12pt; border-bottom: 3pt solid #1a2d6b; padding-bottom: 8pt; margin-bottom: 4pt; }
	html.bkr-druck .bkr-druckkopf img { width: 62mm; height: auto; display: block; }
	html.bkr-druck .bkr-druckkopf > span { text-align: right; color: #1a2d6b !important; font-size: 10pt; line-height: 1.35; }
	html.bkr-druck .bkr-druckkopf > span::first-line { font-weight: 700; font-size: 13pt; }
	html.bkr-druck .bkr-ergebnis h2 { color: #1a2d6b !important; font-size: 18pt; }
	html.bkr-druck .bkr-pg-anzeige { color: #2ba6de !important; }
	html.bkr-druck .bkr-tabelle caption, html.bkr-druck .bkr-gross span, html.bkr-druck .bkr-gross strong, html.bkr-druck .bkr-einzeln summary { color: #1a2d6b !important; }
	html.bkr-druck .bkr-tabelle th, html.bkr-druck .bkr-tabelle td { border-top-color: #d5dbe8 !important; padding: 3pt 0; }
	html.bkr-druck .bkr-tabelle .bkr-summe th, html.bkr-druck .bkr-tabelle .bkr-summe td { border-top: 1.5pt solid #1a2d6b !important; color: #1a2d6b !important; }
	html.bkr-druck .bkr-tabelle .bkr-kasse td, html.bkr-druck .bkr-entl span:last-child, html.bkr-druck .bkr-geld strong { color: #1f7a45 !important; }
	html.bkr-druck .bkr-gesamt { background: #e8ecf6 !important; border-left: 4pt solid #1a2d6b; border-radius: 6pt; break-inside: avoid; }
	html.bkr-druck .bkr-gross strong { font-size: 20pt; }
	html.bkr-druck .bkr-posten thead th { border-bottom: 1pt solid #1a2d6b; }
	html.bkr-druck .bkr-tabelle { break-inside: auto; }
	html.bkr-druck .bkr-tabelle tr { break-inside: avoid; }
	html.bkr-druck .bkr-hinweis a { color: inherit !important; text-decoration: none; }
	html.bkr-druck .bkr-druckfuss { display: block; margin: 0; padding-top: 6pt; border-top: 1pt solid #1a2d6b; color: #1a2d6b !important; font-size: 9pt; }
}
@media (prefers-reduced-motion: no-preference) {
	.bkr-pg span, .bkr-angebot span, .bkr-haeuser span, .bkr-zahl button { transition: background-color .15s, border-color .15s, color .15s; }
}
