/*
 * CI- und Barrierefreiheits-Feinschliff über allen Referenzebenen.
 * Lädt zuletzt in jedem Kontext (öffentliche Seiten, Startseite, Händlerseiten, Portal, Konfigurator).
 *
 * Markenblau #009ddf bleibt Akzentfarbe (Linien, Flächen, große Typografie). Bedienelemente mit Schrift
 * verwenden das Aktionsblau, damit weiße Schrift WCAG AA (≥ 4,5 : 1) erreicht. Dafür werden nur die
 * Farbvariablen im jeweiligen Element umgesetzt – Hover- und Aktivzustände der Komponenten bleiben erhalten.
 */

:is(
	.btn--blue, .btn--primary, .btn--accent, .badge, .sitemap-group__overview,
	.dealer-locator__submit, .qc__cta, .pp-code button, .sb-card__actions a:first-child,
	.gb-btn--primary, .hc-primary, .pt-nav__badge
) {
	--blue: #0072ad;
	--blue-dark: #005d8f;
	--c-brand: #0072ad;
	--c-brand-strong: #005d8f;
	--hc-brand: #0072ad;
	--hc-brand-2: #005d8f;
	--hd-blue: #0072ad;
}

:is(.enterprise-search__submit, .enterprise-footer__cta-actions a:first-child, .mobile-drawer__quick a:first-child) {
	--shell-blue: #0072ad;
	--shell-blue-dark: #005d8f;
}

.hc-quotebox__btn { border-radius: 0; border-color: #0072ad; background: #0072ad; }
.hc-quotebox__btn:hover { border-color: #005d8f; background: #005d8f; }

/* Händlerkarte: ruhige Fläche außerhalb der Kartenkacheln (basemap.at deckt nur Österreich ab). */
.dealer-map.leaflet-container { background: #eceff1; }

/* Signal-Orange (z. B. „Fastmover“) mit weißer Schrift lesbar. */
.badge--accent { --c-accent: #c24a00; }

/* ------------------------------------------------------------------------------------------------
 * Legacy-Reset: hapert.css (12-Spalten-System, abgerundete Kacheln, 360-px-Felder, 680-px-Tabellen,
 * gerahmte FAQ-Boxen) darf die Raster und Komponenten der Referenzebene nicht zerlegen.
 * ------------------------------------------------------------------------------------------------ */
.reference-platform :is(.list__item > a, .artikel__body, .entscheid__grid, .serie, .rechner__grid, .masszeichnung, .article__grid, .form-grid) > * { grid-column: auto; }
.reference-platform .field { max-width: none; }
.reference-platform .tile > a { border: 0; border-radius: 0; box-shadow: none; transform: none; }
.reference-platform .card__actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
.reference-platform .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reference-platform .chip.is-current,
.reference-platform .chip[aria-current] { border-color: var(--night); background: var(--night); color: #fff; }
.reference-platform .chip.is-current span { border: 0; background: transparent; color: inherit; }
.crumbs ol { align-items: center; }

/* Inhaltsverzeichnis in der schmalen Seitenspalte einspaltig. */
@media (min-width: 1181px) {
	.reference-platform .article__grid--toc .toc-box ol { grid-template-columns: minmax(0, 1fr); }
}

/* Schritte (z. B. Danke-Seite) im Referenzstil statt runder Badges auf 60ch. */
.reference-platform .schritte { max-width: none; }
.reference-platform .schritte li { border-left: 0; }

/* Dunkle „Wege“-Karte: Fließtext und Outline-Button lesbar. */
.reference-platform .way:nth-child(2) > p:not(.way__num) { color: #b8c5cd; }
.reference-platform .way:nth-child(2) .way__num { color: #4fc3f2; }
.reference-platform .way:nth-child(2) .btn--outline { border-color: rgba(255,255,255,.5); color: #fff; }
.reference-platform .way:nth-child(2) .btn--outline:hover { border-color: #fff; background: #fff; color: var(--night); }

/* FAQ überall im Referenzstil (Zeilen statt gerahmter Boxen) – nicht nur auf Inhaltsrouten. */
.reference-platform .faq__list { gap: 0; max-width: none; border-top: 1px solid var(--line); }
.reference-platform .faq__item { border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.reference-platform .faq__item summary {
	position: relative;
	display: flex;
	min-height: 64px;
	align-items: center;
	padding: 18px 48px 18px 0;
	color: var(--ink);
	font-size: 15px;
	font-weight: 730;
	line-height: 1.4;
}
.reference-platform .faq__item summary::after {
	position: absolute;
	top: 50%;
	right: 4px;
	color: var(--blue-dark);
	font-size: 20px;
	content: "+";
	transform: translateY(-50%);
}
.reference-platform .faq__item[open] summary::after { content: "−"; }
.reference-platform .faq__answer { max-width: 800px; padding: 0 48px 22px 0; color: var(--ink-2); font-size: 14px; line-height: 1.62; }

/* Tabellen: nur breite Datentabellen scrollen; alle anderen passen sich der Spalte an. */
.reference-platform .table:not(.table--models):not(.table--matrix) { min-width: 0; }
.reference-platform .table-scroll .table:not(.table--models):not(.table--matrix) { min-width: 0; }
.reference-platform .table-scroll::after { content: none; }
@media (max-width: 768px) {
	.reference-platform .table-scroll:has(.table--models, .table--matrix)::before {
		position: sticky;
		left: 0;
		display: block;
		padding: 8px 12px;
		border-bottom: 1px solid var(--line);
		background: var(--stage);
		color: var(--muted);
		font-size: 12px;
		font-weight: 700;
		content: "← Tabelle seitlich wischen →";
	}
	.reference-platform :is(.table--matrix, .table--models) :is(tbody th:first-child, tbody td:first-child) {
		position: sticky;
		left: 0;
		z-index: 1;
		background: #fff;
		box-shadow: 1px 0 0 var(--line);
	}
	.reference-platform :is(.table--matrix, .table--models) thead th:first-child { left: 0; z-index: 2; }
	.reference-platform .tile > a { min-height: 0; }
}

/* Abstand zwischen H1 und Lead auch im Hero (nicht nur bei .section:first-child). */
.reference-platform :is(.phero, .section--tight) :is(h1, .h1) + .lead { margin-top: 18px; }

/* Kartenraster mit 1-px-Fugen: Linien sitzen an den Karten, leere Restzellen bleiben Fläche statt grauem Block. */
:is(
	.reference-platform :is(.cards, .tiles, .artikel-grid, .dealers, .sitemap-grid, .highlights__grid, .ways, .schritte, .glossar, .dl, .zub, .empf, .masse),
	.reference-route-wissen .einsatz, .hd-range-grid, .hd-cars--page, .hc-modelgrid
) {
	border-color: transparent;
	background: transparent;
}
:is(
	.reference-platform :is(.cards, .tiles, .artikel-grid, .dealers, .sitemap-grid, .highlights__grid, .ways, .schritte, .glossar, .dl, .zub, .empf, .masse),
	.reference-route-wissen .einsatz, .hd-range-grid, .hd-cars--page, .hc-modelgrid
) > * { box-shadow: 0 0 0 1px var(--line, #d7dde1); }

/* Seitenspezifisches CTA-Band: Aktionen in derselben Zeile; es ersetzt das generische Footer-CTA,
   damit nicht zwei dunkle Abschlussbänder mit vier Buttons aufeinander folgen. */
.reference-platform .cta-band__row > * { grid-column: auto; }
.reference-platform .cta-band__row { align-items: center; }
body:has(main .cta-band) .enterprise-footer__cta { display: none; }

.nowrap { white-space: nowrap; hyphens: manual; }

/* Headlines nicht in kurzen Wörtern trennen („Händ-ler“); lange Komposita dürfen weiter umbrechen. */
:is(.reference-platform, .hd-page) :is(h1, h2, h3) {
	hyphenate-limit-chars: 10 4 4;
	-webkit-hyphenate-limit-before: 4;
	-webkit-hyphenate-limit-after: 4;
}
:is(.reference-platform, .hd-page) h1 {
	hyphenate-limit-chars: 14 6 6;
	-webkit-hyphenate-limit-before: 6;
	-webkit-hyphenate-limit-after: 6;
}

/* Lange, beschreibende H1 (Ratgeber, Einsatz, Projekte) eine Stufe kleiner statt fünfzeilig. */
.reference-platform .h1.h1--lang { max-width: 22ch; font-size: clamp(36px, 3.7vw, 58px); line-height: 1.02; }
@media (max-width: 640px) {
	.reference-platform .h1.h1--lang { font-size: clamp(30px, 8.6vw, 40px); }
}

/* Anfrageformular: Felder, die nicht zum gewählten Anliegen passen, ausblenden; Restfeld nimmt die Zeile ein. */
[data-typ-feld][hidden] { display: none !important; }
.reference-platform .form__row:has(> [data-typ-feld][hidden]) { grid-template-columns: minmax(0, 1fr); }
.reference-platform .form__legend { margin: 0 0 4px; }

/* Kontaktseite: die drei direkten Wege als große Tippflächen direkt unter dem Hero. */
.reference-platform .kontakt-direkt { padding-top: 0; }
.reference-platform .kontakt-direkt__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 0; list-style: none; }
.reference-platform .kontakt-direkt__grid > li { box-shadow: 0 0 0 1px var(--line); background: #fff; }
.reference-platform .kontakt-direkt__grid a { display: grid; gap: 6px; min-height: 100%; padding: 22px 24px; color: var(--night); text-decoration: none; transition: background-color .2s ease; }
.reference-platform .kontakt-direkt__grid a:hover { background: var(--stage); }
.reference-platform .kontakt-direkt__grid .eyebrow { margin: 0; }
.reference-platform .kontakt-direkt__grid strong { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.2; overflow-wrap: anywhere; }
@media (max-width: 768px) {
	.reference-platform .kontakt-direkt__grid { grid-template-columns: minmax(0, 1fr); }
	.reference-platform .kontakt-direkt__grid a { padding: 16px 18px; }
}

.reference-platform .pl-note { color: var(--night); font-weight: 700; }

/* Datenleiste mit 7–8 Werten: zwei volle Viererreihen statt 6 + 2. */
@media (min-width: 1181px) {
	.reference-platform .kennzahlen__grid:has(> :nth-child(7)):not(:has(> :nth-child(9))) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.reference-platform .kennzahlen__grid:has(> :nth-child(7)):not(:has(> :nth-child(9))) > div:nth-child(4n+1) { padding-left: 0; border-left: 0; }
}

/* Vier Kennzahlen (Ausführung) ohne verwaiste vierte Zelle. */
.reference-platform .kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) {
	.reference-platform .kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Modell „Für wen“: Alternativen über volle Breite statt neben einer leeren Zelle; sichtbare Aufzählungszeichen. */
.reference-platform .entscheid__cols > .entscheid__col:nth-child(3) { grid-column: 1 / -1; }
.reference-platform .entscheid__col ul { list-style: square; }
.reference-platform .entscheid__col li::marker { color: var(--blue); }
@media (max-width: 640px) {
	.reference-platform .entscheid__cols { grid-template-columns: minmax(0, 1fr); }
}

/* Mobil: Produktbild direkt nach Titel und Kurztext, Kennzahlen und Aktionen danach. */
@media (max-width: 768px) {
	.reference-platform .phero--modell .phero__grid { display: flex; flex-direction: column; gap: 0; }
	.reference-platform .phero--modell .phero__text { display: contents; }
	.reference-platform .phero--modell .phero__text > * { order: 1; }
	.reference-platform .phero--modell .phero__media { order: 2; margin: 22px 0 4px; }
	.reference-platform .phero--modell .phero__text > :is(.kpis, .phero__actions, .muted.small, .pager) { order: 3; }
}

/* Mobil: Kennzahlen zweispaltig statt untereinander; Innenmaß-Kacheln als kompakte Zeilen mit Grundriss links. */
@media (max-width: 640px) {
	.reference-platform .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
	.reference-platform .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
	.reference-platform .mass a { flex-direction: row; align-items: center; }
	.reference-platform .mass__flaeche { flex: 0 0 108px; margin-left: 14px; padding: 8px; border-bottom: 0; }
	.reference-platform .mass__flaeche em { display: none; }
	.reference-platform .mass__body { flex: 1 1 auto; gap: 4px; min-width: 0; padding: 14px 16px; }
	.reference-platform .mass__name { font-size: 16px; }
	.reference-platform .mass__price { margin-top: 4px; }
}

/* Code-Einlösen: auf dem Handy steht das Eingabefeld nach H1 und Lead, ohne Erklärliste davor. */
@media (max-width: 768px) {
	.reference-platform .form-intro--kompakt > :is(.serie__list, .small.muted) { display: none; }
}

/* Zubehör: Sofortsuche, Rubrik-Chips mobil als wischbare Zeile, kompakte Optionszeilen. */
.reference-platform .zub-filter { display: grid; gap: 6px; max-width: 560px; margin: 26px 0 18px; }
.reference-platform .zub-filter label { font-size: 12px; font-weight: 760; }
.reference-platform .zub-filter input { min-height: 50px; padding: 0 16px; border: 1px solid var(--line-strong, #aeb9c1); border-radius: 0; background: #fff; font: inherit; font-size: 16px; }
.reference-platform .zub-filter input:focus-visible { outline: 3px solid rgba(0, 157, 223, .35); outline-offset: 1px; border-color: var(--blue-dark); }
.reference-platform .zub-filter p:empty { display: none; }
:is(.reference-platform .zub__item, .reference-platform [data-zub-rubrik], .reference-platform .toc a, .reference-platform [data-zub-leer])[hidden] { display: none !important; }
@media (max-width: 768px) {
	.reference-platform .toc--scroll { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 10px; scroll-padding-inline: 16px; scroll-snap-type: x proximity; scrollbar-width: none; }
	.reference-platform .toc--scroll::-webkit-scrollbar { display: none; }
	.reference-platform .toc--scroll > a { flex: none; scroll-snap-align: start; }
	.reference-platform .zub__item a { min-height: 0; gap: 4px; padding: 14px 16px; }
	.reference-platform .zub__name { font-size: 16px; }
	.reference-platform .zub__meta { padding-top: 6px; }
}

.reference-platform .section__sub { max-width: 62ch; margin: 12px 0 0; font-size: 15px; line-height: 1.55; }

/* Wissen: übrige Ratgeber als kompakte Titelliste unter den sechs Bildkarten. */
.reference-platform .ratgeber-rest__title { margin: clamp(40px, 5vw, 64px) 0 16px; }
.reference-platform .ratgeber-rest .list__item > a { padding-block: 14px; }

/* Fließtext auf Lesebreite; H2-Linie im Artikel immer gleich lang statt textbreit. */
.reference-platform .article__grid > .prose { max-width: 72ch; }
.reference-platform .prose--article h2 { display: block; padding-top: 16px; border-top: 0; background: linear-gradient(var(--blue), var(--blue)) left top / 42px 3px no-repeat; }

/* Rechner: nächster Schritt direkt am Ergebnis. */
.reference-platform .rechner__next { justify-self: start; margin-top: 18px; }

/* Rechner: Optionszeilen als 44-px-Tippziele; mobil läuft das Hauptergebnis am Formularende mit. */
.reference-platform .rechner__opts .check { align-items: center; min-height: 44px; }
.reference-platform .rechner__opts .check input { margin: 0; }
.reference-platform .rechner__opts { gap: 0; }
.tool-live { display: none; }
@media (max-width: 900px) {
	.reference-platform .tool-live:not([hidden]) {
		position: sticky;
		bottom: 0;
		z-index: 5;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin: 0;
		padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
		background: var(--night);
		color: #fff;
		font-size: 13px;
		font-weight: 700;
		text-decoration: none;
	}
	.reference-platform .tool-live strong { color: #4fc3f2; font-size: 20px; line-height: 1.1; text-align: right; }
	.reference-platform .tool-live strong.is-neg { color: #ff8a65; }
}
@media (max-width: 640px) {
	.reference-platform .tool-live:not([hidden]) { margin: 0 -16px -22px; }
}

/* Konfigurator: erledigte Schritte in Nachtblau statt Grün (Grün bleibt Prüf-/Erfolgsmeldungen vorbehalten). */
.hc-app.hc-app .hc-progress li.is-done button span { border-color: #061a2d; background: #061a2d; color: #fff; }

/* Konfigurator: Versal-Mikrolabels nicht unter 10,5 px. */
:is(.hc-codeentry > span, .hc-resume span, .hc-modelcard__series, .hc-stage__selection-title, .hc-option__tag, .hc-media-label, .hc-inlineoffer__eyebrow, .hc-summarysection li.is-conflict em, .hc-dealerbox__contact span) { font-size: 10.5px; }

/* Suche: Typ-Filter unter dem Feld, Suchbegriff im Treffer markiert. */
.reference-platform .suche-filter { margin-top: 18px; }
.reference-platform .suche-treffer mark { padding: 0 1px; background: rgba(0, 157, 223, .18); color: inherit; }

/* 404: Suche direkt im Hero. */
.reference-platform .error-search { max-width: 640px; margin-top: 26px; }

/* Studio-Freisteller als Themenbild: ganz zeigen statt anschneiden. */
.reference-platform .produktbild--freisteller { object-fit: contain; padding: 4%; background: #fff; }

/* Häkchen statt chevronartiger Winkel; Spezifikationen mit CI-Strich statt abgerundeter Punkte. */
.reference-platform .serie__list--icons li::before { width: .42rem; height: .78rem; border: 0; border-right: 2.5px solid var(--blue); border-bottom: 2.5px solid var(--blue); background: none; transform: rotate(45deg); }
.reference-platform .card__specs li::before { top: .72em; width: 8px; height: 2px; border-radius: 0; }

/* Projektfotos füllen die Kachel (Produktfreisteller bleiben „contain“); Hochformate im Detail nicht riesig. */
.reference-platform .card--project .card__media img { object-fit: cover; }
.reference-platform .projekt__bild img { width: 100%; height: auto; max-height: min(72vh, 640px); object-fit: contain; background: var(--stage); }

/* Code-Felder: Platzhalter nicht in Versalien-Sperrschrift („Z. B. ARMGSPEH“). */
.reference-platform .field--code input::placeholder { text-transform: none; letter-spacing: .02em; }
.reference-platform .form-intro > .serie__list + .muted.small { margin-top: 16px; }

/* Händlerliste: Verweis aufs Verzeichnis füllt die letzte Zelle. */
.reference-platform .dealer-card--mehr { padding: 0; background: var(--stage); }
.reference-platform .dealer-card--mehr > a { display: grid; align-content: space-between; gap: 14px; height: 100%; padding: 26px; color: var(--night); text-decoration: none; }
.reference-platform .dealer-card--mehr strong { font-size: 19px; line-height: 1.25; }
.reference-platform .dealer-card--mehr > a:hover { background: #e6eaec; }

/* Konfigurator Schritt 1: Seitentitel bleibt als H1 für Screenreader erhalten, nur visuell ausgeblendet. */
.hc-app[data-current-step=modell] .hc-apphead__title {
	position: absolute;
	display: block;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Mobile Tippziele ≥ 44 px Höhe für wiederkehrende Navigationslinks. */
@media (max-width: 768px) {
	.reference-platform .asidebox__list a,
	.reference-platform .pager a,
	.reference-platform .entscheid__col li > a,
	.reference-platform .dealer-locator a[href="#haendler-nach-land"],
	.hd-breadcrumb a,
	.hd-foot__legal a { display: inline-flex; align-items: center; min-height: 44px; }
	.crumbs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
	.reference-platform :is(th, td) > a:not(.btn),
	.reference-platform .link--arrow,
	.reference-platform .glossar dt a,
	.reference-platform .serie__list a,
	.reference-platform .pl-title a { display: inline-flex; align-items: center; min-height: 44px; }
	.reference-platform .subnav__row > a:not(.btn) { padding-inline: 8px; }
}
