/* Klarluft Kundenportal: layout and look, on top of tokens.css. It copies the WPF client's KAB selection: the shell
   from Themes/Klarluft.Shell.xaml (48px top bar, 40px tab strip, 24px mono status bar), the sidebar, result table and
   state blocks from the KAB redesign (Views/AuslegungKueche), the sheets after the client's sign-in card (a little
   larger, see Sheets). Sizes are the client's device-independent pixels unless a comment gives the reason.
   One deliberate difference: filled buttons use --brand-700 (#0078B4), which keeps WCAG AA contrast for white text;
   the client's --brand-500 does not. Icons drawn by CSS are data: SVGs (the CSP allows img-src data:). */

/* ---- Fonts (self-hosted, SIL OFL 1.1: /fonts/OFL.txt) ------------------------------------------------ */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
/* Mono 500 (the facts' and the Betriebspunkt's values) and 600 (the Kennung): without their own faces the browser
   draws 500 as Regular and fakes 600 by smearing the Regular glyphs. */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
}

:root {
  /* The client's soft ring around a focused field, whose border turns brand. Buttons and links get a --brand-700
     ring behind a 2px gap instead of the client's soft --focus-ring, which is too faint on white (WCAG 3:1). */
  --fokus-feld: 0 0 0 3px rgba(0, 160, 224, 0.16);
  --fokus-knopf: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand-700);
  /* The KAB renders' studio backdrop: their edges are exactly this grey, so the space around a contained picture
     on the viewer's stage, and the view tiles behind their previews, read as one surface with the picture. */
  --buehne: #d5d5d5;
  --err-text: #7a1e16;
  --warn-text: #7a4d02;
  --warn-050: #fdf7e8;
  --ok-text: #155a33;
}

/* ---- Page frame: top bar, work area, status bar ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  color: var(--fg);
  font: 400 13px/1.4 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--brand-200); }
a { color: var(--brand-700); text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--fokus-knopf); }
svg { flex: none; }
.nur-vorlesen { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Top bar (signed in only): the logo, a 1×16 divider, the breadcrumb, the avatar button at the right. The logo is
   20 px tall, its capitals about 15 px, a step above the breadcrumb's 15 px type. */
.kopfzeile {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 12px 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}
.kopfzeile img { display: block; }
.kopfzeile a.portalname {
  flex: none;
  display: flex;
  align-items: center;
  height: 32px;
  margin-left: -6px;
  padding: 0 6px;
  border-radius: var(--r-2);
}
.kopfzeile a.portalname:hover { background: var(--bg-muted); }
.pfad {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0 0 0 10px;
  font: 600 15px/30px var(--font-sans);
  color: var(--fg);
  white-space: nowrap;
}
.pfad::before {
  content: "";
  width: 1px;
  height: 16px;
  margin-right: 8px;
  background: var(--border);
}
.pfad > span:first-child { padding: 0 6px; }
.pfadteil { display: flex; align-items: center; padding-right: 6px; font-weight: 500; color: var(--fg-strong); }
.pfadteil:empty { display: none; }
.pfadteil::before {
  content: "";
  width: 14px;
  height: 14px;
  margin: 0 7px 0 1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA1A8' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9,18 L15,12 L9,6'/%3E%3C/svg%3E") no-repeat center / 14px 14px;
}
/* A second part (the Technik page's „Technische Daten“) sits inside the first, so the first's padding-right comes
   after it; its chevron takes the 7 px the first one gets from the part before it. */
.pfadteil .pfadteil::before { margin-left: 7px; }

/* Account menu: the client's avatar button and its 260px menu; a <details> disclosure, so no script. */
.konto { position: relative; margin-left: auto; }
.konto summary {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 4px 0 2px;
  border-radius: 16px;
  color: var(--fg-muted);
  cursor: pointer;
  list-style: none;
}
.konto summary::-webkit-details-marker { display: none; }
.konto summary:hover, .konto[open] summary { background: var(--bg-muted); }
.initialen {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  font: 600 11px/1 var(--font-sans);
}
.kontomenue {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 260px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: 0 2px 12px rgba(20, 24, 27, 0.14);
}
.identitaet {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 8px 10px 9px 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.identitaet .initialen { width: 32px; height: 32px; font-size: 12px; }
.identitaet div { min-width: 0; }
.identitaet p {
  margin: 4px 0 0;
  font: 400 12px/1.25 var(--font-sans);
  color: var(--fg-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.identitaet p.kontoname { margin: 0; font: 600 13px/1.25 var(--font-sans); color: var(--fg-strong); }
.kontomenue form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border-subtle); }
.kontomenue a, .kontomenue button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  font: 400 13px/1 var(--font-sans);
  color: var(--fg);
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: var(--r-2);
  cursor: pointer;
}
.kontomenue svg { color: var(--fg-subtle); }
.kontomenue a:hover, .kontomenue button:hover { background: var(--bg-muted); }
/* Inset, so the ring stays inside its 30px row. */
.kontomenue a:focus-visible, .kontomenue button:focus-visible { background: var(--bg-muted); box-shadow: inset 0 0 0 2px var(--brand-700); }
.kontomenue a:active, .kontomenue button:active { background: var(--bg-inset); }

/* Status bar: who is signed in at the left, the legal links at the right, in the client's 11px mono. */
.fusszeile {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 16px;
  min-height: 24px;
  padding: 0 10px 0 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font: 400 11px/22px var(--font-mono);
  color: var(--fg-muted);
}
.fusszeile p { margin: 0; overflow-wrap: anywhere; }
.fusszeile nav { display: flex; flex-wrap: wrap; margin-left: auto; }
.fusszeile a { color: var(--fg-subtle); text-decoration: none; }
.fusszeile a + a::before { content: "·"; display: inline-block; margin: 0 6px; }
.fusszeile a:hover { color: var(--fg); text-decoration: underline; }

/* ---- KAB workspace: tab strip, Betriebspunkt sidebar, result card ----------------------------------------- */
.reiterleiste {
  flex: none;
  display: flex;
  height: 40px;
  padding: 0 12px 0 2px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
/* The active tab; its 2px underline covers the strip's hairline. (nav.reiter is the Technik page's link tabs.) */
div.reiter {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  padding: 0 14px 1px;
  color: var(--fg-strong);
}
div.reiter::after, nav.reiter a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  border-radius: 1px;
  background: var(--brand-500);
}
div.reiter h1 { margin: 0; font: 500 13px/1 var(--font-sans); color: inherit; white-space: nowrap; }
.zaehler {
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--bg-inset);
  color: var(--grey-700);
  font: 600 11px/16px var(--font-sans);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.arbeitsbereich {
  flex: 1;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

/* With a viewer: the result card takes its table's own width and the viewer the rest, at least 300 px. From 1280 px on
   the table (about 600 px without Spannung, see below) and that viewer fit side by side; a narrower window stacks them
   (below). The minimum binds only near 1280 px: at 1366 px the viewer is about 395 px, at 1745 px (every column shown) about 650 px. */
.arbeitsbereich.mit-viewer { grid-template-columns: 304px minmax(0, max-content) minmax(300px, 1fr); }

.karte {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}
/* A 36px card header; it grows only when the result summary wraps on a narrow screen. */
.kartenkopf {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 10px;
  min-height: 36px;
  padding: 4px 8px 4px 12px;
  border-bottom: 1px solid var(--border);
}
.kartenkopf h2 { margin: 0; font: 600 13px/1.3 var(--font-sans); color: var(--fg-strong); white-space: nowrap; }
.kartenkopf p { min-width: 0; margin: 0; font: 500 12px/1.3 var(--font-sans); color: var(--fg-subtle); }
.kartenkopf a {
  margin-left: auto;
  padding: 0 2px;
  border-radius: var(--r-1);
  font: 500 13px/1.3 var(--font-sans);
  color: var(--brand-700);
  text-decoration: none;
}
.kartenkopf a:hover { color: var(--brand-600); }

/* Betriebspunkt: each label above its field, a 20px line under each field for its range, „Suchen“ in the foot right
   under the fields, as in the client: the card's spare height stays below the button, so the button sits next to the
   fields it sends. A window too short for the fields scrolls them (below), and the foot stays in view.
   form.betriebspunkt, because the fan chart's operating-point path has the class too. */
form.betriebspunkt { flex: 1; display: flex; flex-direction: column; margin: 0; }
.felder { flex: 0 1 auto; padding: 12px; }
.felder > label, .felder legend {
  display: block;
  margin: 8px 0 4px;
  font: 500 12px/16px var(--font-sans);
  color: var(--fg-muted);
}
.felder > label:first-of-type { margin-top: 0; }
.felder .hinweis {
  display: flex;
  align-items: flex-end;
  height: 20px;
  margin: 0;
  font: 400 12px/16px var(--font-sans);
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}

/* A number field with a 40px unit box at the right; the focused field lies above the box, so its ring stays whole. */
.mit-einheit { display: flex; }
.mit-einheit input:not([type]), .mit-einheit input[type="text"] {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 0 12px 0 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mit-einheit input:not([type]):focus, .mit-einheit input[type="text"]:focus { z-index: 1; }
.mit-einheit span {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 28px;
  margin-left: -4px;
  background: var(--bg-muted);
  border: 1px solid var(--border-strong);
  border-radius: 0 var(--r-2) var(--r-2) 0;
  font: 400 11.5px/1 var(--font-sans);
  color: var(--fg-muted);
}

/* Ausblasrichtung: the client's segmented control, two radios. */
.felder fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.felder legend { float: left; width: 100%; padding: 0; }
.segmente {
  position: relative;
  clear: both;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 30px;
  padding: 2px 1px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}
.segmente input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.segmente label {
  display: grid;
  place-items: center;
  height: 24px;
  margin: 0 1px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  font: 600 12px/1 var(--font-sans);
  color: var(--fg-muted);
  cursor: pointer;
}
.segmente label:hover { color: var(--fg); }
.segmente input:checked + label {
  background: var(--bg);
  border-color: var(--brand-300);
  color: var(--brand-700);
  box-shadow: 0 1px 2px rgba(20, 24, 27, 0.08);
}
.segmente input:focus-visible + label { box-shadow: var(--fokus-knopf); }

/* The card foot. While a search runs, the client's busy line sweeps along its top hairline. */
.kartenfuss { position: relative; flex: none; padding: 12px; border-top: 1px solid var(--border); }
.kartenfuss button { width: 100%; }
form.betriebspunkt:has(button:disabled) .kartenfuss::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 30%;
  height: 2px;
  background: var(--brand-500);
  animation: suche-laeuft 1.1s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}
@keyframes suche-laeuft {
  from { transform: translateX(-100%); }
  to { transform: translateX(333.33%); }
}

/* Result table: a 40px grey header row and 32px rows with hairlines between them, no zebra. The article column
   fills the width; the others keep their content's width. The headers are the client's short ones („Aufnahme“,
   „Schall“), so the table fits beside the viewer; the viewer's facts keep the long labels. */
/* Positioned so the cells' visually hidden texts stay inside the scroll box; otherwise they escape its clip and
   stretch the page below the window. */
.tabelle { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font: 400 13px/1.3 var(--font-sans); color: var(--fg); }
th, td {
  height: 32px;
  padding: 0 0 0 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-subtle);
}
th:first-child, td:first-child { padding-left: 12px; }
/* The header row's line is a shadow: a collapsed border stays behind when the sticky row scrolls. */
thead th {
  padding: 0 10px 1px;
  background: var(--bg-muted);
  color: var(--fg-muted);
  font: 600 12px/1.3 var(--font-sans);
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--border);
}
/* The result table's header row is 40px: each name on the first line and its unit, if any, on a second, smaller one,
   so a column is as wide as its name, not name and unit. */
.tabelle thead th { height: 40px; padding-top: 6px; padding-bottom: 5px; vertical-align: top; line-height: 16px; }
thead th.artikel { width: 100%; }
thead th.zahl { padding-left: 4px; text-align: right; }
thead th.zahl:first-child { padding-left: 12px; }
td.zahl { padding-right: 10px; text-align: right; font-variant-numeric: tabular-nums; }
/* The article cell is a row header (WCAG 2.4.4) in the client's mono. The column takes no spare width while the table
   is as wide as its content, so its own 12 px at the right keep the Kennung clear of the next column's value. */
tbody th { font: 400 11.5px/1.3 var(--font-mono); color: var(--fg); }
.tabelle .artikel { padding-right: 12px; }
tbody tr:hover > * { background: var(--bg-subtle); }
.kopftext { display: flex; flex-direction: column; }
th.zahl .kopftext { align-items: flex-end; }
/* --fg-muted, not the client's --fg-subtle, which misses AA on the header's --grey-050. */
.einheit { font: 500 11px/13px var(--font-sans); color: var(--fg-muted); }
/* A row without a list price reads after the priced ones. */
.anfrage { color: var(--fg-muted); }
/* The score badge in the client's tiers (≥ 85, ≥ 70, ≥ 50, > 0); an unscored row's „—“ keeps the neutral badge, in
   --fg-muted rather than the client's --fg-subtle, which misses AA on --grey-050. */
.score {
  display: inline-block;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-2);
  vertical-align: middle;
  background: var(--grey-050);
  color: var(--fg-muted);
  font: 600 11px/20px var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.score-gut { background: var(--ok-100); color: var(--ok-text); }
.score-mittel { background: var(--grey-100); color: var(--grey-700); }
.score-maessig { background: var(--warn-100); color: var(--warn-text); }
.score-schwach { background: var(--err-100); color: var(--err-text); }

/* A sortable header is a link; its arrow, beside the name's line, shows on hover, the sorted column's always and in
   brand blue. */
thead th a {
  display: inline-flex;
  align-items: flex-start;
  margin: -2px -4px;
  padding: 2px 4px;
  border-radius: var(--r-2);
  color: inherit;
  text-decoration: none;
}
thead th a:hover { background: var(--bg-inset); color: var(--fg); }
thead th .pfeil { margin: 2px 2px 0; color: var(--grey-400); opacity: 0; }
thead th a:hover .pfeil { opacity: 1; }
thead th[aria-sort] a { color: var(--fg-strong); }
thead th[aria-sort] .pfeil { color: var(--brand-700); opacity: 1; }

/* The datasheet link: the client's link button, a document icon and „PDF“. */
td a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  border-radius: var(--r-1);
  font: 500 13px/1.3 var(--font-sans);
  color: var(--brand-700);
  text-decoration: none;
}
td a:hover { color: var(--brand-600); text-decoration: underline; }

/* The selected row, as in the client: a brand wash and a 2px bar at the left. The article is a link to its row. */
tbody tr.wahl > * { background: var(--brand-100); }
tbody tr.wahl > :first-child { box-shadow: inset 2px 0 0 var(--brand-500); }
tbody th a { color: inherit; text-decoration: none; }
tbody th a:hover { color: var(--brand-700); text-decoration: underline; }

/* The tab strip's „Technische Daten“, right-aligned like the client's button. */
.reiteraktion {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  background: var(--bg);
  font: 500 13px/1 var(--font-sans);
  color: var(--fg-strong);
  text-decoration: none;
}
.reiteraktion:hover { background: var(--bg-subtle); }

/* ---- Viewer beside the result card: header, stage, view tiles, key facts, stepper ----------------------------- */
/* The panel is a size container: its layout follows its own width, which comes from a grid track, never from its
   content. Beside the table everything stacks at any width; stacked under the table and from 880 px wide, the facts
   and the tiles move into a 300 px column beside the stage (below). The id is the target of the viewer links' #viewer,
   so on a stacked page a click lands on the panel, not at the top. */
.viewer { min-width: 0; container: viewer / inline-size; }
.viewerkopf {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
}
.ring {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--brand-500);
  border-radius: 50%;
  font: 700 11px/1 var(--font-sans);
  color: var(--brand-700);
}
/* The Kennung keeps one line and ends in „…“ where it does not fit (also in the Technik page's title). */
.kennung {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 13px/1.3 var(--font-mono);
  color: var(--fg-strong);
}
.viewerkopf .kennung { flex: 1; }

/* The middle: stage, tiles and facts. The stage takes the free height, so a taller window shows a bigger picture;
   the tiles and the facts never shrink. A window too short for the stage's 200 px and the facts scrolls this part,
   never the page, and the header and the stepper stay in view. */
.viewerinhalt { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }

/* The stage on the renders' own backdrop. The picture is contained edge to edge, without script; the box is the
   picture itself (centred by margin: auto), so site.js zooms and pans the picture around transform-origin 0 0 and
   the mask moves with it. The mask fades the picture's top and bottom 6 %: the renders have a lighter band through
   the centre, which then melts into the backdrop when the stage is taller than the picture. Their left and right
   edges are the backdrop's grey already. */
.buehne {
  position: relative;
  flex: 1 1 0;
  min-height: 200px;
  overflow: hidden;
  background: var(--buehne);
}
.buehne img {
  -webkit-user-drag: none;
  position: absolute;
  inset: 0;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  transform-origin: 0 0;
  user-select: none;
  -webkit-mask-image: linear-gradient(transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(transparent, #000 6%, #000 94%, transparent);
}
.modell { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }
/* A view without a picture: a plain stage, not the studio grey. */
.buehne:has(> .leer) { display: grid; place-items: center; background: var(--bg-subtle); }
.leer { margin: 0; padding: 16px; text-align: center; font: 400 13px/1.4 var(--font-sans); color: var(--fg-subtle); }
.zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity 120ms;
}
.zoom[hidden] { display: none; }
.buehne:hover .zoom, .buehne:focus-within .zoom { opacity: 1; }
.zoom button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  background: var(--bg);
  box-shadow: var(--shadow-2);
  font: 500 13px/1 var(--font-sans);
  color: var(--fg-muted);
  cursor: pointer;
}
.zoom button:hover { background: var(--bg-subtle); color: var(--fg-strong); }
@media (hover: none) { .zoom { opacity: 1; } }

/* View tiles: equal columns, each a preview on the backdrop over its name; the 3D tile shows a cube. The current
   tile has a 2 px ring in --brand-700 (--brand-500 misses 3:1 against the backdrop) and a darker name. The ring and
   the hover line are an ::after over the preview, so they are never hidden under the picture. */
.kacheln {
  flex: none;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 6px;
  padding: 8px 10px;
}
.kacheln a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px;
  border-radius: var(--r-2);
  font: 600 11px/14px var(--font-sans);
  color: var(--fg-muted);
  text-align: center;
  text-decoration: none;
}
.vorschau {
  position: relative;
  display: grid;
  place-items: center;
  height: 48px;
  overflow: hidden;
  border-radius: var(--r-2);
  background: var(--buehne);
  color: var(--grey-700);
}
/* Out of flow, so the picture's own height never stretches the tile. */
.vorschau img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* A view without a picture gets the empty stage's plain grey, not the studio backdrop, which would read as a broken
   image. (Not :empty, which would hang on the markup's whitespace.) */
.vorschau:not(:has(img, svg)) { background: var(--bg-subtle); }
.vorschau::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(20, 24, 27, 0.08);
}
.kacheln a:hover { color: var(--fg); }
.kacheln a:hover .vorschau::after { box-shadow: inset 0 0 0 1px var(--grey-500); }
.kacheln a[aria-current] { color: var(--fg-strong); }
.kacheln a[aria-current] .vorschau::after { box-shadow: inset 0 0 0 2px var(--brand-700); }

/* The selected row's key facts: the Technik page's .betriebsdaten rows, a little tighter, under the list price in
   600 18 px. The price's „netto zzgl. MwSt.“ sits under it; a row without one says „auf Anfrage“ in --fg-muted. */
.betriebsdaten.fakten { flex: none; padding: 0 12px 4px; border-top: 1px solid var(--border); }
.betriebsdaten.fakten div { padding: 6px 0; }
.fakten dt, .fakten dd { white-space: nowrap; }
/* Two lines either way, so stepping between a priced and an unpriced row does not move the stage. */
.betriebsdaten.fakten .preis { min-height: 57px; padding: 10px 0 8px; }
.fakten .preis dd {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font: 600 18px/24px var(--font-sans);
  font-variant-numeric: tabular-nums;
}
/* The colour repeats .anfrage's on purpose: .betriebsdaten dd outranks that class. */
.fakten .preis dd.anfrage { font-size: 15px; font-weight: 500; color: var(--fg-muted); }
.fakten .preis dd span { font: 400 11px/14px var(--font-sans); color: var(--fg-subtle); }
/* A low window (a 1366 × 768 laptop) packs the rows and the tiles tighter, so the facts fit under the 200 px stage
   unscrolled. */
@media (height <= 760px) {
  .betriebsdaten.fakten { padding-bottom: 0; }
  .betriebsdaten.fakten div { padding: 4px 0; }
  .betriebsdaten.fakten .preis { min-height: 50px; padding: 6px 0 4px; }
  .kacheln { padding-block: 6px; }
  .vorschau { height: 40px; }
}
/* Beside the table the panel is as tall as the window and every pixel the facts give up goes to the stage: the facts
   take two columns and the price one line (at 1745 × 828 the picture grows from about 335 × 234 to 485 × 340 px).
   The pairs read across: Leistungsaufnahme and LwA, Größe and Baugröße, Ausblas and Spannung. The last row's left
   cell drops its line like the last cell. A panel under 480 px (1280–1500 px windows) has no room for label and value
   side by side in a column, so there each label sits over its value. Stacked under the table the facts keep one
   column of their own (below). */
@media (width >= 1280px) {
  .betriebsdaten.fakten { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; }
  .betriebsdaten.fakten .preis { grid-column: 1 / -1; min-height: 0; }
  .fakten .preis dd { flex-direction: row; align-items: baseline; gap: 6px; }
  .betriebsdaten.fakten div:nth-child(even):nth-last-child(2) { border-bottom: 0; }
  @container viewer (width < 480px) {
    .betriebsdaten.fakten { column-gap: 16px; }
    .betriebsdaten.fakten div:not(.preis) { flex-direction: column; align-items: flex-start; gap: 0; }
    .betriebsdaten.fakten div:not(.preis) dd { text-align: left; }
  }
}

.schritt {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 10px;
  border-top: 1px solid var(--border);
  font: 400 12px/1 var(--font-sans);
  color: var(--fg-subtle);
}
.schritt a, .schritt > span[aria-hidden] { padding: 0 8px; font-size: 18px; line-height: 1; }
.schritt a { border-radius: var(--r-1); color: var(--brand-700); text-decoration: none; }
.schritt a:hover { background: var(--bg-inset); }
.schritt > span[aria-hidden] { color: var(--grey-300); }

/* The note wraps to the table's width: its containment keeps the long line out of the card's own width, which the
   viewer grid reads (max-content). */
.fussnote {
  contain: inline-size;
  margin: auto 0 0;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font: 400 12px/1.4 var(--font-sans);
  color: var(--fg-subtle);
}

/* The result card without a table: an icon tile, a title and one line, anchored near the top as in the client. */
.zustand {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  margin: 104px auto 32px;
  padding: 0 24px;
  text-align: center;
}
.kachel {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: var(--r-3);
  background: var(--bg-muted);
  color: var(--fg-subtle);
}
.zustand h3 { margin: 0; font: 600 15px/1.4 var(--font-sans); color: var(--fg-strong); }
.zustand p { max-width: 460px; margin: 6px 0 0; font: 400 13px/1.5 var(--font-sans); color: var(--fg-muted); }
.zustand p.weiter { margin-top: 16px; }

/* ---- Technische Daten page: back link, title and link tabs in the strip, one card per tab ------------------- */
/* Back to the result page, with the row, sort and view the page came from. The back link and the tabs never shrink;
   only the title gives way, its Kennung ending in „…“. At ≤ 840 px the back link shows only its chevron. */
.zurueck {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 12px;
  font: 500 13px/1 var(--font-sans);
  color: var(--brand-700);
  text-decoration: none;
  white-space: nowrap;
}
.zurueck:hover span { text-decoration: underline; }
.zurueck::after { content: ""; width: 1px; height: 16px; margin-left: 6px; background: var(--border); }
.technikname {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  padding: 0 4px 0 12px;
  font: 600 13px/1 var(--font-sans);
  color: var(--fg-strong);
  white-space: nowrap;
}
.technikname .kennung { font-size: 12px; font-weight: 500; line-height: 16px; color: var(--fg-muted); }
.technikname::after { content: ""; flex: none; width: 1px; height: 16px; margin-left: 8px; background: var(--border); }
nav.reiter { flex: none; display: flex; margin-bottom: -1px; }
nav.reiter a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px 1px;
  font: 500 13px/1 var(--font-sans);
  color: var(--fg-muted);
  text-decoration: none;
  white-space: nowrap;
}
nav.reiter a:hover { color: var(--fg-strong); }
nav.reiter a[aria-current="page"] { color: var(--fg-strong); }

/* The tab's cards span the window's width; on a wide window they also fill its height (see the media query below). */
.technik {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  width: 100%;
  padding: 16px;
}
/* The compact Kennfeld sidebar is 280px rather than 300px to leave more room for the chart. */
.technik.kennfeld { grid-template-columns: minmax(0, 1fr) 280px; }
/* A chart card's header: title and subtitle at the left, the key figures or the air density at the right. */
.diagrammkopf {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.diagrammkopf h2 { margin: 0; font: 600 15px/1.4 var(--font-sans); color: var(--fg-strong); }
.diagrammkopf h2.versal { font-size: 13px; letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.diagrammkopf p { margin: 2px 0 0; font: 500 12px/1.4 var(--font-sans); color: var(--fg-subtle); }
.diagrammkopf p.luftdichte { margin: 0; font: 400 12px/1.4 var(--font-mono); }
.pegel { display: flex; gap: 24px; margin: 0; }
.pegel dt { font: 500 11px/1.3 var(--font-sans); color: var(--fg-subtle); }
.pegel dd { margin: 2px 0 0; font: 500 18px/1.3 var(--font-mono); color: var(--fg-strong); font-variant-numeric: tabular-nums; }
.pegel dd.haupt { color: var(--brand-700); }

/* Sound side links use the same compact segmented control as the search, with room for all three names. */
nav.schallauswahl {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 440px);
  height: auto;
  min-height: 34px;
  margin: 12px 16px 0;
  padding: 3px;
  gap: 2px;
  align-self: flex-start;
}
.schallauswahl a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: var(--r-1);
  font: 500 12px/16px var(--font-sans);
  color: var(--fg-muted);
  text-align: center;
  text-decoration: none;
}
.schallauswahl a:hover { color: var(--fg-strong); background: var(--bg); }
.schallauswahl a[aria-current="true"] {
  color: var(--brand-700);
  background: var(--bg);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border);
}
.schallauswahl a:focus-visible { position: relative; z-index: 1; box-shadow: var(--fokus-knopf); }

/* The charts fill any box, with no script and no style attribute (the CSP allows neither). A grid: the y axis title,
   the y tick labels and the plot cell, over the x tick labels and the x axis title. The plot is an SVG stretched over
   its cell (viewBox 0 0 1000 1000, preserveAspectRatio none) whose strokes do not scale, so line widths and dashes stay
   in screen pixels; a dot is a zero-length path whose round cap stays a circle. Labels, titles and the legend are HTML,
   so the text keeps its 11 px at any size. Skala's ticks are evenly spaced from Min to Max, so flexbox spreads the
   labels onto the gridlines: the 14 px y labels with space-between in a column that reaches 7 px past the plot at each
   end, the x labels as zero-width boxes (Kennfeld) or eight equal columns under the band centres (Schall). The legend
   is a grid item of its own: in the plot's top-right corner, and on a narrow window in a row under the x axis title.
   Below the wide breakpoint the chart is 320 px tall; above it, it takes the card's free height (media query below). */
.diagramm {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  height: 320px;
  padding: 12px 20px 8px 8px;
  font: 400 11px/14px var(--font-sans);
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}
.achsentitel-y, .achsentitel-x { font-weight: 500; color: var(--fg-muted); white-space: nowrap; }
.achsentitel-y { grid-area: 1 / 1; align-self: center; margin-right: 4px; writing-mode: vertical-rl; transform: rotate(180deg); }
.achsentitel-x { grid-area: 3 / 3; padding-top: 2px; text-align: center; }
.striche-y {
  grid-area: 1 / 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: -7px 0;
  padding-right: 6px;
  text-align: right;
}
.striche-y span { flex: none; height: 14px; }
.striche-x { grid-area: 2 / 3; display: flex; justify-content: space-between; padding-top: 4px; }
.striche-x span { display: flex; justify-content: center; width: 0; white-space: nowrap; }
.striche-x.oktaven { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.striche-x.oktaven span { display: block; width: auto; text-align: center; }
/* The plot cell clips the plot, with a margin so the strokes and dots on its edges stay whole. Safari has no
   overflow-clip-margin, so its clip would fall on the plot's edges and halve the axes, the outer gridlines and the dots
   there; it gets no clip instead (the axes fit every point, so only an out-of-range one such as a negative pressure
   could stray outside). */
.diagramm > .feld { grid-area: 1 / 3; position: relative; min-height: 0; overflow: clip; overflow-clip-margin: 8px; }
@supports not (overflow-clip-margin: 8px) {
  .diagramm > .feld { overflow: visible; }
}
svg.flaeche { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.diagramm .flaeche * { vector-effect: non-scaling-stroke; }
.diagramm .gitter { stroke: var(--border-subtle); stroke-width: 1; shape-rendering: crispEdges; }
.diagramm .achse { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.diagramm .kurve-roh, .diagramm .kurve-gedaempft, .diagramm .kurve-max, .diagramm .kurve-betrieb, .diagramm .kurve-system {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.diagramm .kurve-roh { stroke: var(--grey-600); }
.diagramm .kurve-gedaempft { stroke: var(--brand-700); }
.diagramm .kurve-max { stroke: var(--grey-400); }
.diagramm .kurve-betrieb { stroke: var(--brand-500); }
.diagramm .kurve-system { stroke: var(--grey-600); stroke-width: 1.5; stroke-dasharray: 5 4; }
/* Dots: the stroke width is the diameter. A hollow band dot is a grey 8 px dot under a 5 px one in the background
   colour; the operating point is a 10 px brand dot on a 14 px white one. */
.diagramm .punkt-roh, .diagramm .punkt-roh-innen, .diagramm .betriebspunkt, .diagramm .betriebspunkt-rand { fill: none; stroke-linecap: round; }
.diagramm .punkt-roh { stroke: var(--grey-600); stroke-width: 8; }
.diagramm .punkt-roh-innen { stroke: var(--bg); stroke-width: 5; }
.diagramm .betriebspunkt-rand { stroke: var(--bg); stroke-width: 14; }
.diagramm .betriebspunkt { stroke: var(--brand-700); stroke-width: 10; }
/* The legend shares the plot's cell, 8 px from its top-right corner and above the plot (a grid item's z-index needs no
   position); each entry's 20 × 10 swatch reuses the curve or dot classes. A narrow window moves it under the plot. */
.diagramm > .legende {
  grid-area: 1 / 3;
  align-self: start;
  justify-self: end;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--fg-muted);
}
.diagramm .legende span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.diagramm .legende svg { overflow: visible; }
.kennfelddiagramm .legende > span { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.kennfelddiagramm .legende svg { flex: none; }

/* Single-side sound values use native-size HTML aligned with the eight octave centres.
   Percentage SVG spacers align label anchors with the plotted y coordinates without inline styles. */
.schallwerte { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); pointer-events: none; }
.schallwertplatz { height: 100%; min-width: 0; }
.wertabstand { display: block; width: 1px; }
.schallwert {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 1px 3px;
  transform: translateY(calc(-100% - 8px));
  border-radius: var(--r-1);
  background: var(--bg);
  color: var(--brand-700);
  font: 500 11px/14px var(--font-sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.diagramm.mit-schallwerten { grid-template-rows: minmax(0, 1fr) auto auto auto; }
.diagramm.mit-schallwerten > .legende {
  grid-area: 4 / 3;
  justify-self: stretch;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  background: none;
}

/* The neutral solid envelope is native context. Each duty point has a stable identity colour; only an interpolated
   RPM curve is dashed. The selected point is stronger and its independent calculated duct demand is dotted.
   All legend entries stay outside the plot. These rules leave the sound chart's own grammar unchanged. */
.diagramm.kennfelddiagramm {
  grid-template-rows: minmax(0, 1fr) auto auto auto;
  height: 360px;
  padding: 24px 28px 0 16px;
}
.kennfelddiagramm .gitter { stroke: color-mix(in srgb, var(--border-subtle) 75%, var(--bg)); }
.kennfelddiagramm .achse { stroke: var(--grey-400); }
.kennfelddiagramm .punkt-1, .kennfeld-punkte .punkt-1 { --punktfarbe: var(--brand-700); }
.kennfelddiagramm .punkt-2, .kennfeld-punkte .punkt-2 { --punktfarbe: #00776e; }
.kennfelddiagramm .punkt-3, .kennfeld-punkte .punkt-3 { --punktfarbe: #a35411; }
.kennfelddiagramm .punkt-4, .kennfeld-punkte .punkt-4 { --punktfarbe: #7756aa; }
.kennfelddiagramm .kurve-max { stroke: var(--grey-600); stroke-width: 2; stroke-dasharray: none; }
.kennfelddiagramm .kennfeld-punkt .kurve-betrieb { stroke: var(--punktfarbe); stroke-width: 1.8; opacity: 0.78; }
.kennfelddiagramm .kennfeld-punkt.aktiv .kurve-betrieb { stroke-width: 2.8; opacity: 1; }
.kennfelddiagramm .kennfeld-punkt .kurve-betrieb.abgeleitet { stroke-dasharray: 7 4; }
.kennfelddiagramm .kurve-system { stroke: var(--grey-800); stroke-width: 1.5; stroke-dasharray: 1 4; }
.kennfelddiagramm .betriebspunkt-hilfe { stroke: var(--grey-400); stroke-width: 1; stroke-dasharray: 3 5; }
.kennfelddiagramm .kennfeld-punkt .betriebspunkt { stroke: var(--punktfarbe); stroke-width: 8; }
.kennfelddiagramm .kennfeld-punkt .betriebspunkt-rand { stroke-width: 12; }
.kennfelddiagramm .kennfeld-punkt.aktiv .betriebspunkt { stroke-width: 10; }
.kennfelddiagramm .kennfeld-punkt.aktiv .betriebspunkt-rand { stroke-width: 16; }
.kennfelddiagramm > .legende {
  grid-area: 4 / 1 / 5 / -1;
  align-self: stretch;
  justify-self: stretch;
  z-index: auto;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 18px -28px 0 -16px;
  padding: 12px 20px;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  background: var(--bg-subtle);
  font-size: 12px;
  line-height: 16px;
}
.kennfelddiagramm .achsentitel-x { padding-top: 5px; }
.kennfelddiagramm .legende .herkunft {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  color: var(--fg-muted);
  font-size: 10px;
  line-height: 14px;
}
.kennfeld-karte .diagrammkopf { padding: 16px 20px; border-bottom-color: var(--border-subtle); }
/* The compact sidebar uses 12px form insets and smaller text, retaining the client's 28px controls.
   It scrolls independently beside the chart. Mobile uses the normal stacked card. */
.technik.kennfeld > .betriebspunkt-karte { align-self: stretch; }
.kennfeld-punkte .kartenkopf { min-height: 32px; }
.kennfeld-punkte .kartenkopf h2 { font-size: 12px; }
.kennfeld-punkte .punkteinhalt { min-height: 0; overflow-y: auto; }
.kennfeld-punkte .punktliste { display: grid; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border-subtle); }
.kennfeld-punkte .punktkarte {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 8px;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--r-2);
}
.kennfeld-punkte .punktkarte:hover { background: var(--bg-muted); }
.kennfeld-punkte .punktkarte[aria-current="true"] {
  border-color: var(--border);
  background: var(--bg-subtle);
  box-shadow: inset 3px 0 0 var(--punktfarbe);
}
.kennfeld-punkte .punktkarte:focus-visible { outline: 2px solid var(--brand-700); outline-offset: 1px; }
.kennfeld-punkte .punktnummer {
  flex: none;
  min-width: 33px;
  padding: 3px 4px;
  color: var(--punktfarbe);
  border: 1px solid currentColor;
  border-radius: var(--r-1);
  text-align: center;
  font: 600 11px/14px var(--font-mono);
}
.kennfeld-punkte .punktkarte > span:last-child { display: grid; gap: 2px; min-width: 0; }
.kennfeld-punkte .punktkarte strong { font: 500 11.5px/16px var(--font-mono); }
.kennfeld-punkte .punktkarte small { color: var(--fg-muted); font: 400 11px/14px var(--font-sans); }
.kennfeld-punkte .punktkarte strong { overflow-wrap: anywhere; }
.kennfeld-punkte .punktkarte.ausgeblendet .punktnummer { border-style: dashed; color: var(--fg-muted); }
.kennfeld-punkte .punkteinhalt > .punktanzeige {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.kennfeld-punkte .punktanzeige > label { color: var(--fg-muted); font: 500 12px/16px var(--font-sans); }
.kennfeld-punkte .punktanzeige-eingaben { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kennfeld-punkte .punktanzeige-eingaben > div { display: grid; min-width: 0; gap: 4px; }
.kennfeld-punkte .punktanzeige-eingaben label { color: var(--fg-muted); font: 500 12px/16px var(--font-sans); }
.kennfeld-punkte input:not([type]), .kennfeld-punkte input[type="text"], .kennfeld-punkte button { font-size: 12px; }
.kennfeld-punkte .punktanzeige .sichtbarkeitswahl { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.kennfeld-punkte .punktanzeige input[type="checkbox"] { margin: 0; width: 15px; height: 15px; accent-color: var(--brand-700); }
.kennfeld-punkte .punktanzeige button { justify-self: end; }
.kennfeld-punkte .einstellungshinweis { color: var(--fg-muted); font: 400 12px/16px var(--font-sans); }
.kennfeld-punkte .punkteinhalt > .einstellungshinweis { margin: 0 12px 10px; }
.kennfeld-punkte .punkteinhalt > form:not(.punktformular):not(.punktanzeige) { padding: 0 12px 12px; }
.kennfeld-punkte button.sekundaer { color: var(--fg-muted); background: var(--bg); border: 1px solid var(--border-strong); }
.kennfeld-punkte button.sekundaer:hover { color: var(--fg-strong); background: var(--bg-muted); }
.kennfeld-punkte .punktformular { display: grid; gap: 6px; padding: 12px; border-top: 1px solid var(--border-subtle); }
.kennfeld-punkte .punktformular h3 { margin: 0; color: var(--fg-strong); font: 600 12px/16px var(--font-sans); }
.kennfeld-punkte .punktformular label { margin-top: 2px; color: var(--fg-muted); font: 500 12px/16px var(--font-sans); }
.kennfeld-punkte .punktformular button { justify-self: end; margin-top: 2px; }
.kennfeld-punkte .punktformular .einstellungshinweis { margin: 0; }
.kennfeld-punkte .betriebsdaten { padding: 4px 12px 8px; }
.kennfeld-punkte .betriebsdaten div { padding-block: 6px; gap: 8px; }
.kennfeld-punkte .betriebsdaten dt, .kennfeld-punkte .betriebsdaten dd { font-size: 12px; }
.kennfeld-punkte .betriebsdaten div:nth-child(-n + 2) { padding-block: 8px; }
.kennfeld-punkte .betriebsdaten div:nth-child(-n + 2) dd { color: var(--brand-700); font-size: 14px; }

/* The band table: label column, eight bands and the A-weighted total, values right-aligned. It never shrinks (its
   sideways scroll would otherwise let the chart squeeze it), so it stays whole at the card's foot. */
.baenderrahmen { flex: none; overflow-x: auto; border-top: 1px solid var(--border); }
.baender th, .baender td { padding: 0 10px 0 4px; }
.baender th:first-child, .baender td:first-child { padding-left: 16px; }
.baender .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.baender tbody th { font: 500 12px/1.3 var(--font-sans); color: var(--fg-muted); }
.baender .lwa { padding-right: 16px; font-weight: 600; color: var(--fg-strong); box-shadow: inset 1px 0 0 var(--border); }
.baender thead th.lwa { box-shadow: inset 1px 0 0 var(--border), inset 0 -1px 0 var(--border); }
.baender tr.ergebnis > * { font-weight: 600; color: var(--fg-strong); }
.baender tbody tr:last-child > * { border-bottom: 0; }

.betriebsdaten { margin: 0; padding: 4px 16px 8px; }
.betriebsdaten div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.betriebsdaten div:last-child { border-bottom: 0; }
.betriebsdaten dt { font: 400 13px/1.3 var(--font-sans); color: var(--fg-muted); }
.betriebsdaten dd { margin: 0; font: 500 13px/1.3 var(--font-mono); color: var(--fg-strong); text-align: right; font-variant-numeric: tabular-nums; }

/* The 3D model fills its card on a wide window (media query below). Below the wide breakpoint the card has no set
   height, so the stage takes the window's height under the strip, at least 420 px; flex: 1 belongs to the wide rule
   only, because its 0 % basis would override this height in a card of indefinite height. */
.modellbuehne { position: relative; height: calc(100vh - 170px); min-height: 420px; background: var(--bg-subtle); }

/* ---- Controls --------------------------------------------------------------------------------------------- */
input:not([type]), input[type="text"], input[type="password"] {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  font: 400 13px/1 var(--font-sans);
  color: var(--fg);
  caret-color: var(--brand-600);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
}
input:not([type]):hover, input[type="text"]:hover, input[type="password"]:hover { border-color: var(--grey-400); }
input:not([type]):focus, input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--fokus-feld);
}
input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--brand-500); }

/* The primary command: 28px, semibold, white on --brand-700. The busy state stays readable. */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  font: 600 13px/1 var(--font-sans);
  white-space: nowrap;
  color: var(--fg-on-brand);
  background: var(--brand-700);
  border: 1px solid var(--brand-700);
  border-radius: var(--r-2);
  cursor: pointer;
}
button:hover { background: color-mix(in srgb, var(--brand-700) 88%, var(--grey-900)); }
button:active { background: color-mix(in srgb, var(--brand-700) 76%, var(--grey-900)); }
/* The portal's own busy button on the sheets: grey with --fg-muted text, legible where the client would fade it.
   In the KAB card foot it reads as the client's plain busy text under the busy line instead. */
button:disabled { color: var(--fg-muted); background: var(--bg-inset); border-color: var(--border); cursor: progress; }
.kartenfuss button:disabled { justify-content: flex-start; padding: 0; background: none; border-color: transparent; font: 500 12px/1 var(--font-sans); }

/* ---- Sheets: sign-in, account, legal and error pages after the client's flat sign-in card -------------------
   The flat card, its hairline and 9 px radius are the client's. Its sizes are deliberately a little larger than the
   client's (380 px wide, padding 28/24/28/28, a 15 px title), because in a browser window the sheet stands alone in a
   lot of space, where the client's card sits in its own small window: 400 px wide (the legal pages 640 px), padding
   28/32/32 px, an 18/24 px title, 12 px above each field label, all on the 4 px grid. Fields and buttons keep the
   client's 28 px. */
main:has(> .blatt) { padding: 24px 16px; }
/* Signed out, the full logo (240 px, a link to /kab) stands above the sheet, the portal's own mark of the company in
   place of the client's shell header; its auto top margin and the sheet's auto bottom margin centre the two together
   in the window. */
.markenlogo { align-self: center; margin: auto 0 24px; padding: 4px; border-radius: var(--r-2); }
.markenlogo img { display: block; }
.markenlogo + .blatt { margin: 0 auto auto; }
.blatt {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 28px 32px 32px;
  background: var(--bg);
  border: 1px solid rgba(20, 24, 27, 0.14);
  border-radius: 9px;
}
/* The legal pages: about 90 characters a line. */
.blatt.breit { max-width: 640px; }
.blatt h1 { margin: 0 0 16px; font: 600 18px/24px var(--font-sans); color: var(--fg-strong); }
.blatt p { margin: 0 0 12px; font: 400 12.5px/1.45 var(--font-sans); color: var(--fg-muted); }
.blatt > p:last-child { margin-bottom: 0; }
.blatt.breit p { font-size: 13px; line-height: 20px; color: var(--fg); }
.blatt p a { font-weight: 500; }
/* One column; a checkbox sits next to its label, the terms link under the label. */
.blatt form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 6px;
  margin: 0 0 16px;
}
.blatt form:last-child { margin-bottom: 0; }
.blatt form > * { grid-column: 1 / -1; margin: 0; }
.blatt form > label { margin: 12px 0 4px; font: 400 12px/16px var(--font-sans); color: var(--fg-muted); }
.blatt form > label:first-of-type { margin-top: 0; }
.blatt form > p { margin: 4px 0 0; font-size: 12px; color: var(--fg-subtle); }
.blatt form > input[type="checkbox"] { grid-column: 1; align-self: center; margin-top: 12px; }
.blatt form > input[type="checkbox"] + label {
  grid-column: 2;
  margin: 12px 0 0;
  font: 400 13px/1.3 var(--font-sans);
  color: var(--fg-muted);
  cursor: pointer;
}
.blatt form > input[type="checkbox"] + label + a { grid-column: 2; margin-top: 2px; font: 500 12.5px/1.4 var(--font-sans); }
.blatt form > button { width: 100%; margin-top: 16px; }
/* „Zur Produktauswahl“ on the error pages: the client's secondary command. */
.weiter a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  font: 500 13px/1 var(--font-sans);
  color: var(--fg);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
}
.weiter a:hover { background: var(--bg-subtle); border-color: var(--grey-400); }
.weiter a:active { background: var(--bg-muted); }

/* ---- Messages: an error (role="alert"), a notice or confirmation (role="status"), the draft banner ---------- */
p[role="alert"], p[role="status"].ok {
  margin: 0 0 12px;
  padding-left: 20px;
  background: no-repeat 0 1px / 14px 14px;
  font: 400 12.5px/1.35 var(--font-sans);
}
p[role="alert"] {
  color: var(--err-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C2362B' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM12 8v4M12 16h.01'/%3E%3C/svg%3E");
}
p[role="status"] { margin: 0 0 12px; font: 400 12.5px/1.4 var(--font-sans); color: var(--fg-muted); }
p[role="status"].ok {
  color: var(--ok-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F9D55' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.blatt p.entwurf {
  width: fit-content;
  margin: 0 0 14px;
  padding: 5px 10px;
  font: 500 12.5px/1.4 var(--font-sans);
  color: var(--warn-text);
  background: var(--warn-050);
  border: 1px solid var(--warn-100);
  border-radius: var(--r-2);
}

/* ---- Wide screens: the workspace fills the window as in the client ----------------------------------------
   The page itself does not scroll: the table scrolls inside its card under a sticky header row, the fields scroll
   inside the sidebar, and „Suchen“ stays in view in the card foot.
   The Technik page fills the window the same way: its cards stretch to the height under the strip. A chart takes
   its card's free height (Schall: between the header and the band table, which stays whole at the foot); the 3D stage
   and an empty or unavailable state fill their card. Only a window too short for a 200 px plot as well (below
   about 595 px for Schall with damping) scrolls the card itself. */
@media (width > 840px) and (height >= 480px) {
  body:has(.arbeitsbereich), body:has(.technik) { height: 100vh; min-height: 0; }
  main:has(> .arbeitsbereich), .arbeitsbereich, form.betriebspunkt, main:has(> .technik), .technik { min-height: 0; }
  .arbeitsbereich { grid-template-rows: minmax(0, 1fr); }
  .felder { overflow-y: auto; }
  .tabelle { flex: 1; min-height: 0; overflow: auto; }
  thead th { position: sticky; top: 0; z-index: 1; }
  .technik { flex: 1; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .technik > .karte { overflow-y: auto; }
  .technik .diagramm { flex: 1 1 0; height: auto; grid-template-rows: minmax(200px, 1fr) auto auto; }
  .technik .kennfelddiagramm { grid-template-rows: minmax(200px, 1fr) auto auto auto; }
  .technik .diagramm.mit-schallwerten { grid-template-rows: minmax(200px, 1fr) auto auto auto; }
  .modellbuehne { flex: 1; height: auto; min-height: 0; }
}

/* ---- Below 1280px the viewer drops under the table; the page scrolls --------------------------------------
   The table (about 600 px) and a 300 px viewer need 1280 px beside the sidebar. Narrower, the table takes the width
   beside the sidebar and the panel spans the window under both, as tall as its content; the sidebar keeps its own
   height, so „Suchen“ stays near the top. */
@media (width < 1280px) {
  .arbeitsbereich.mit-viewer { grid-template-columns: 304px minmax(0, 1fr); grid-template-rows: auto; }
  .mit-viewer .seitenleiste { align-self: start; }
  .viewer { grid-column: 1 / -1; }
  body:has(.mit-viewer) { height: auto; min-height: 100vh; }
  /* A narrow, stacked panel has no height to share out: the stage keeps the renders' proportions. */
  @container viewer (width < 880px) {
    .buehne { flex: none; aspect-ratio: 10 / 7; min-height: 0; }
  }
  /* A wide one is low for its width: the stage at the left, the facts and under them the tiles as a 300 px column at
     the right, the stepper across the foot. The stage is as tall as that column, at least 360 px, so no part of the
     panel stays empty; the tiles sit at the column's foot. Beside the table the panel is as tall as the window, so
     there it stays one column at any width: the stage is then as wide as the panel and the picture bigger (at
     1920 × 1080 about 770 × 540 px). */
  @container viewer (width >= 880px) {
    .viewerinhalt { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto 1fr; }
    .buehne { grid-area: 1 / 1 / 3 / 2; min-height: 360px; border-right: 1px solid var(--border); }
    .betriebsdaten.fakten { grid-area: 1 / 2; padding: 4px 16px; border-top: 0; }
    .kacheln { grid-area: 2 / 2; align-self: end; padding: 8px 16px 10px; border-top: 1px solid var(--border-subtle); }
  }
}

/* ---- Beside the sidebar on a mid-size window, Spannung gives way --------------------------------------------
   Without it, and with 8 px instead of 10 px beside each cell, the table (about 600 px) fits beside a 300 px viewer
   from 1280 px on, scroll bar included, and fits above a stacked viewer from about 960 px (narrower, it scrolls
   sideways a little); the viewer's facts show the selected row's Spannung. Größe stays: its header is the only way
   to sort by size. From 1601 px all columns fit beside a viewer of about 500 px and more. Below 841 px the table has
   the full width again and keeps every column. */
@media (840px < width <= 1600px) {
  .mit-viewer .nebenspalte { display: none; }
  .mit-viewer .tabelle :is(th, td):not(:first-child) { padding-left: 8px; }
  .mit-viewer .tabelle :is(thead th, td.zahl) { padding-right: 8px; }
  .mit-viewer .tabelle thead th.zahl:not(:first-child) { padding-left: 4px; }
}

/* ---- Narrow screens: the sidebar sits above the results ------------------------------------------------- */
@media (max-width: 840px) {
  .arbeitsbereich, .arbeitsbereich.mit-viewer { grid-template-columns: minmax(0, 1fr); align-content: start; padding: 12px; }
  .zustand { margin-top: 40px; }
  /* The Technik page: the Betriebspunkt card drops under the chart. The header Kennung stays (cut with „…“ where the
     strip is tight), so every tab (Schall, Kennfeld, 3D-View and the empty or unavailable states) keeps naming the
     box. The back link keeps only its chevron, so the title fits beside the tabs; its text stays the link's name. */
  .technik, .technik.kennfeld { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .zurueck span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); }
  /* The chart legend leaves the plot for a row of its own under the x axis title: in the narrow plot its corner box
     could hide the operating point or a dot. */
  .diagramm { grid-template-rows: minmax(0, 1fr) auto auto auto; }
  .diagramm:not(.kennfelddiagramm) > .legende {
    grid-area: 4 / 3;
    justify-self: stretch;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 16px;
    margin: 6px 0 0;
    padding: 0;
    background: none;
    border: 0;
  }
  nav.schallauswahl { width: auto; align-self: stretch; }
}
@media (max-width: 520px) {
  .kennfelddiagramm > .legende { column-gap: 16px; padding-inline: 16px; }
  .pfad { display: none; }
  /* The tab strip: the hit count gives way (the result card's header has it too) and the tab draws in, so
     „Technische Daten“ keeps one line beside the title on a 375 px phone. */
  div.reiter { padding: 0 8px 1px; }
  div.reiter::after { left: 4px; right: 4px; }
  .reiterleiste .zaehler { display: none; }
  .reiteraktion { white-space: nowrap; }
  .blatt { padding: 20px; }
  /* Only the back link's chevron and the tabs fit; the page title stays for screen readers. */
  .technikname { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  form.betriebspunkt:has(button:disabled) .kartenfuss::before { width: 100%; animation: none; }
  .zoom { transition: none; }
}

/* Optional search settings use native disclosures and keep all fields in the search form. */
.einstellungen { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.einstellungen summary { cursor: pointer; font: 500 12px/20px var(--font-sans); color: var(--fg-strong); }
.einstellungen .einstellungshinweis { margin: 6px 0; font: 400 12px/16px var(--font-sans); color: var(--fg-muted); }
.einstellungen label { display: block; min-width: 0; margin-top: 8px; font: 500 12px/16px var(--font-sans); color: var(--fg-muted); }
.einstellungen input { display: block; width: 100%; min-width: 0; margin-top: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.massfelder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; }
