/* PIM Agent web app - its own components (PIM-104, docs/plans/2026-10-04-pim-104-visual-language.md §2.2). Values come from
   the tokens of grundwerte.css; the components shared with the supplier portal (notice, card, pill, empty state, button) are in
   bausteine.css. Every look has ONE class; markup carries no styling (StilTests). Desktop is the target (Kai). */

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: var(--t-14)/1.4 var(--schrift); color: var(--text); background: var(--grund); }
a { color: var(--blau); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Kai: whatever can be clicked shows the hand */
a[href], button, summary, select, label:has(> input[type=checkbox]), input[type=checkbox], tr[data-href] { cursor: pointer; }
button { font: inherit; }
h1, h2, h3 { overflow-wrap: anywhere; }
b, strong { font-weight: 600; }
code { font: var(--t-12) var(--mono); }
.klein { font-size: var(--t-12); color: var(--text-3); }
.klein.gut { color: var(--gruen-text); }
.klein.schlecht { color: var(--rot-text); }
.nw { white-space: nowrap; }

/* ---------- frame: app bar, navigation, the one scroller ---------- */
/* --rinne: the classic scrollbar of main (Edge/Chrome on Windows: always visible, 15 px, measured in the browser at 100 % zoom). main reserves
   it always (scrollbar-gutter: stable) so the width a page has does not jump when its length crosses the screen's; PIM-136's width
   thresholds count it (a media query cannot take a custom property: the sums are written at each threshold and a test holds them). */
.rahmen { --rinne: 15px; display: grid; grid-template-columns: 196px minmax(0, 1fr); grid-template-rows: var(--kopf) minmax(0, 1fr); height: 100vh; }
header { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--a-16); padding: 0 var(--a-16); height: var(--kopf); background: var(--navy); color: #fff; }
.marke { font-size: var(--t-18); font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.stand, header .nutzer, header .version { font-size: var(--t-12); color: var(--marke-hell); white-space: nowrap; }
header .version { margin-left: calc(-1 * var(--a-8)); }
/* PIM-269 (Toni 19.10.2026): the environment badge beside the title - a coloured separator in the gap, then a pill. ONE rule gives every kind its size
   and shape, so PROD and TEST stand in the same place at the same size; a kind sets only its colours. White on --gruen-text is 4.9:1, on --rot 5.6:1;
   UNKNOWN is --text on --amber (4.8:1). The separator is drawn in the middle of the header's gap: --rot itself is only 2.6:1 on the navy, --rot-kopf 5.2:1 */
header .umgebung { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
                   border: 1px solid rgba(255, 255, 255, .35); color: var(--weiss); font-size: var(--t-12); font-weight: 700; letter-spacing: .6px; line-height: 1; white-space: nowrap; }
header .umgebung::before { content: ""; position: absolute; left: calc(-1 * var(--a-8) - 2px); top: 2px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--trenner); }
header .umgebung svg { flex: none; }
/* a kind is scoped as header .umgebung[…] - the bare attribute selector lost to header .umgebung's colour, and UNKNOWN's text came out white (3.4:1) */
header .umgebung[data-umgebung=prod] { background: var(--gruen-text); --trenner: var(--gruen); }
header .umgebung[data-umgebung=dev] { background: var(--rot); --trenner: var(--rot-kopf); }
header .umgebung[data-umgebung=test] { background: var(--rot); --trenner: var(--rot-kopf); }   /* PIM-470: the test copy, red like DEV - its label says TEST */
header .umgebung[data-umgebung=unknown] { background: var(--amber); color: var(--text); --trenner: var(--amber); }
header .nutzer { margin-left: var(--a-12); }
/* PIM-378: the sign-out beside the person - the header's small light text, a link only by its underline on hover */
header .abmelden { font-size: var(--t-12); color: var(--marke-hell); white-space: nowrap; text-decoration: none; }
header .abmelden:hover { color: #fff; text-decoration: underline; }
header .suche { margin-left: auto; width: 320px; max-width: 40vw; }
header input { width: 100%; height: var(--feld); border: 0; border-radius: var(--r-4); padding: 0 10px; font: inherit; font-size: var(--t-13); }

nav { background: var(--flaeche); border-right: 1px solid var(--linie); padding: var(--a-12) var(--a-8); overflow-y: auto; }
nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: var(--r-4); color: var(--text); font-weight: 600; font-size: var(--t-13); }
nav a small { color: var(--text-3); font-weight: 400; font-size: var(--t-12); }
nav a:hover { background: var(--grund); text-decoration: none; }
nav a.aktiv { background: var(--blau-hell); color: var(--blau); }
nav .trenner { font-size: var(--t-12); text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); padding: 14px 10px 4px; }
nav .legendenzeile { display: flex; gap: 6px; align-items: center; padding: 2px 10px; }
/* PIM-184 P1a: a section heading (a link to the section's full list, or plain text) in the style of .trenner; the steps under it are indented
   and carry the to-do counter */
nav .abschnitt { margin-top: var(--a-8); font-size: var(--t-12); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); }
nav div.abschnitt { padding: 7px 10px; }
nav a.abschnitt:hover { color: var(--text); }
nav a.abschnitt.aktiv { color: var(--blau); }
nav a.schritt { padding-left: 22px; }
nav a.schritt small, nav a.abschnitt small { flex: none; margin-left: var(--a-8); }

main { overflow: auto; scrollbar-gutter: stable; padding: var(--a-16); min-width: 0; display: flex; flex-direction: column; gap: var(--a-12); }
/* main is the page's one scroller (Kai: no nested scrolling); its sections stack 12 apart and carry no margins of their own */
main > * { margin-top: 0; margin-bottom: 0; flex: none; }

/* ---------- page header ---------- */
.kopf { display: flex; align-items: baseline; gap: var(--a-12); flex-wrap: wrap; }
.kopf h1 { font-size: var(--t-18); margin: 0; }
.untertitel, .pfad { font-size: var(--t-12); color: var(--text-3); }
.pfad a { color: var(--text-2); }
.kopf .knopf { align-self: center; }

/* ---------- card extras (the card itself: bausteine.css) ---------- */
.karte.breit { grid-column: 1 / -1; }
h3 { font-size: var(--t-13); margin: 0 0 var(--a-4); }
* + h3 { margin-top: var(--a-12); }
.karte ul { margin: 0; padding-left: var(--a-16); }
.gruppe { font-size: var(--t-14); margin: var(--a-4) 0 0; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: var(--a-12); }
.raster.weit { grid-template-columns: repeat(auto-fit, minmax(620px, 1fr)); }
.zweispaltig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--a-12); align-items: start; }
.spalte { display: flex; flex-direction: column; gap: var(--a-12); min-width: 0; }
.vorschauspalte { display: flex; flex-direction: column; gap: var(--a-8); min-width: 0; }
/* the hand-over package's right column: links, buttons, file hash, notes - 8 apart like a card's body */
.paketrechts > * { margin-top: 0; margin-bottom: 0; }
.paketrechts > * + * { margin-top: var(--a-8); }
.paketrechts > * + h3 { margin-top: var(--a-12); }

/* ---------- key/value ---------- */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px var(--a-16); font-size: var(--t-13); }
.meta > div { overflow-wrap: anywhere; }
.meta > div > span:first-child { display: block; font-size: var(--t-12); color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.meta .voll { grid-column: 1 / -1; }
.meta small { font-size: var(--t-12); color: var(--text-3); }
.normzeile { display: flex; flex-wrap: wrap; gap: var(--a-4) var(--a-12); align-items: baseline; }
/* PIM-131 P9: the standards a pairing closes / leaves open - one line per norm group, the group in bold */
.normliste { display: flex; flex-direction: column; gap: var(--a-2); font-size: var(--t-12); }
.normgruppe b { color: var(--text-2); }
td[data-deckt="1"] .normgruppe b { color: var(--gruen-text); }
td[data-offen="1"] .normgruppe b { color: var(--amber-text); }
tr.gruppe th { text-align: left; background: var(--grund); font-weight: 600; }
tr.gruppe th .klein { font-weight: 400; margin-left: var(--a-8); }

/* ---------- count tiles (linked on a page, unlinked inside a card) ---------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--a-8); }
.kachel { display: block; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-6); padding: 10px var(--a-12); color: var(--text); }
a.kachel:hover { border-color: var(--blau); text-decoration: none; }
.karte .kachel { background: var(--grund); }
/* counts inside a card keep a tile's width instead of stretching across the card */
.karte .kacheln { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kachel .t { font-size: var(--t-12); color: var(--text-2); font-weight: 600; }
.kachel .n { font-size: var(--t-24); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kachel .n.gut { color: var(--gruen-text); }
.kachel .n.warn { color: var(--amber-text); }
.kachel .n.schlecht { color: var(--rot-text); }
.kachel .u { font-size: var(--t-12); color: var(--text-3); margin-top: var(--a-2); }
.kachel .mini { display: flex; gap: var(--a-2); height: 6px; margin-top: var(--a-8); }
.kachel .mini i { display: block; border-radius: 2px; flex: var(--anteil) 1 0; }

/* the status strip: every status a link, its colour on the left edge */
.stufen { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stufentitel { font-size: var(--t-12); text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); margin-right: var(--a-2); }
.stufe ~ .stufentitel { margin-left: 10px; }
.stufe { display: inline-flex; gap: 6px; align-items: baseline; background: var(--flaeche); border: 1px solid var(--linie); border-left: 4px solid var(--farbe, var(--neutral)); border-radius: var(--r-4); padding: 3px 10px; font-size: var(--t-12); color: var(--text-2); white-space: nowrap; }
.stufe b { color: var(--text); font-size: var(--t-14); font-variant-numeric: tabular-nums; }
.stufe:hover { border-color: var(--blau); border-left-color: var(--farbe, var(--neutral)); text-decoration: none; }

/* ---------- next up ---------- */
.naechstes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--a-8) var(--a-16); }
.naechstes h3 { font-size: var(--t-12); color: var(--text-2); }
a.alle { display: inline-block; font-size: var(--t-12); margin-top: 6px; }
.naechstes table { table-layout: fixed; }
.naechstes td:last-child { width: 108px; text-align: right; }
.naechstes td.kurz { max-width: none; }

/* ---------- filter bar: one surface, one height, widths as shares of the bar ---------- */
/* a select takes one share, the search two (it takes free text); none shrinks below its own words - a select's longest
   "Jeder …/Alle …" placeholder (16 characters with its arrow), the search's placeholder (24) - the bar wraps instead */
.filter { display: flex; flex-wrap: wrap; gap: var(--a-8); align-items: center; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-6); padding: var(--a-4) var(--a-12); }
.filter > select { flex: 1 1 0; min-width: 16ch; }
.filter > input[type=search] { flex: 2 1 0; min-width: 24ch; }
.filter > .aktivfilter, .filter > .knopf, .filter > noscript { flex: none; }
.filter .anzahl { flex: none; margin-left: auto; font-size: var(--t-12); color: var(--text-2); }
.aktivfilter { display: inline-flex; align-items: center; gap: 6px; background: var(--blau-hell); color: var(--blau); border-radius: var(--r-pille); padding: 2px 4px 2px 10px; font-size: var(--t-12); font-weight: 600; }
.aktivfilter a { color: var(--blau); font-weight: 700; padding: 0 6px; border-radius: var(--r-pille); }
.aktivfilter a:hover { background: #cfe2fb; text-decoration: none; }

/* ---------- controls: one look, one height for single-line controls; a textarea keeps its rows ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select {
  font: inherit; font-size: var(--t-13); color: var(--text); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--r-4); height: var(--feld); padding: 0 var(--a-8); max-width: 100%; }
textarea { font: inherit; font-size: var(--t-13); color: var(--text); background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--r-4); padding: 6px var(--a-8); width: 100%; display: block; }
textarea.mailtext { font: var(--t-13)/1.5 var(--mono); }
input.voll { width: 100%; }
/* the daily read count: LesezahlHoechst = 1000 is four digits, plus the padding and Edge's number spinner (measured 15 px) */
input.zahl { width: calc(4ch + 2 * var(--a-8) + 15px + 2px); }
.feld { display: flex; flex-direction: column; gap: 3px; font-size: var(--t-12); color: var(--text-2); }
/* a form of stacked fields: a label, its control 2 below, the next field 8 below */
.formular > * { margin-top: 0; margin-bottom: 0; }
.formular > * + * { margin-top: var(--a-8); }
.formular > label + * { margin-top: var(--a-2); }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; vertical-align: middle; }
.knopf.aus { color: var(--text-3); cursor: default; background: var(--grund); }
.knopf.aus:hover { border-color: var(--linie); color: var(--text-3); }
details.tabelle > summary.knopf { list-style: none; width: max-content; }
details.tabelle[open] > summary.knopf { margin-bottom: var(--a-8); }
details.tabelle > summary.knopf::-webkit-details-marker { display: none; }

/* ---------- data table: one density ---------- */
/* a single-line row is --zeile (25 px, the measured BEFORE row): 13 px text at 1.4 (18.2 px), 1 px rule, 3 px above and below;
   a second line of 12 px .klein text adds 16.8 px, as before */
table { border-collapse: collapse; width: 100%; font-size: var(--t-13); line-height: 1.4; }
/* 6 px beside each cell's text - the before pages' dense tables (.eng); with 8 px Zuordnungen needed 32 px more than its frame */
th { text-align: left; font-size: var(--t-12); color: var(--text-2); font-weight: 600; height: var(--kopfzeile); padding: 0 6px; border-bottom: 1px solid var(--linie); background: var(--kopfgrund); white-space: nowrap; }
td, tbody th { padding: calc((var(--zeile) - 19px) / 2) 6px; border-bottom: 1px solid var(--linie-2); vertical-align: middle; }
tbody th { background: none; font-weight: 400; height: auto; }
td.z, th.z { text-align: right; font-variant-numeric: tabular-nums; }
tr.klick:hover td { background: var(--zeile-hover); }
th.sort { user-select: none; }
th.sort a { color: inherit; }
th.sort a:hover { color: var(--blau); text-decoration: none; }
td.zustand { white-space: nowrap; }
/* a pill in a page-wide list table wraps inside its cell rather than widening the table past its frame (Zuordnungen at 1280) - except in
   a cell that is kept on one line (.nw: Aufgaben "Art"), where a wrap would make the row two lines (measured: 24 -> 25 rows/screen) */
.tabellenrahmen td > .chip { white-space: normal; }
td.nw > .chip { white-space: nowrap; }
/* PIM-202: a column header's filter menu - a small button right after the header's title (at the cell's right edge it sat beside the NEXT column's title); open, its
   panel hangs under it (absolute: it moves no row). No scroll area of its own (the page is the one scroller): a long value list flows in columns instead. */
/* every sticky header cell is its own layer (z-index 1), so a later cell painted over an earlier one's open panel - the cell with the open menu goes above them */
.tabellenrahmen th:has(> .spaltenfilter[open]) { z-index: 2; }
th > .spaltenfilter { display: inline-block; position: relative; margin-left: var(--a-4); font-weight: 400; vertical-align: middle; }
.spaltenfilter > summary { list-style: none; cursor: pointer; color: var(--text-2); padding: 0 var(--a-4); border: 1px solid var(--linie); border-radius: var(--r-4); line-height: 1.4; }
.spaltenfilter > summary::-webkit-details-marker { display: none; }
.spaltenfilter > summary:hover, .spaltenfilter[open] > summary { color: var(--blau); background: var(--blau-hell); }
.spaltenfilter.an > summary { color: var(--blau); background: var(--blau-hell); font-weight: 700; }
.spaltenfilter > form { position: absolute; top: 100%; left: 0; z-index: 3; display: flex; flex-direction: column; gap: var(--a-8); min-width: 240px; max-width: 70vw;
  padding: var(--a-8) var(--a-12); background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-6); box-shadow: var(--schatten);
  text-align: left; white-space: normal; font-size: var(--t-13); color: var(--text); }
.spaltenfilter .spaltenwerte.viele { column-count: 3; column-gap: var(--a-12); width: 66ch; }
.spaltenfilter .spaltenwerte > label { display: block; break-inside: avoid; padding: var(--a-2) 0; }
.spaltenfilter label { white-space: normal; }
.spaltenfilter .knoepfe { display: flex; gap: var(--a-8); }
/* the one free column of a table takes what the others leave and truncates (instead of a guessed max-width) */
td.rest { width: 100%; max-width: 0; }
td.rest, td.rest > a, td.rest > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a need bar in a PO row: its eight states (BedarfReihe) each at least 20 px wide when all are present - the text columns beside
   it keep their width instead of wrapping (a free column would squeeze the supplier name to three lines, measured) */
td.balkenzelle { min-width: calc(8 * 20px); }
/* a file name in a table with no free column: the stylesheet's one truncation cap */
td.kurz { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* PIM-397 (Kai, 02.11.2026: "reduce subject width by 1/3. increase Place accordingly"): the Log list's Subject column is 2/3 of what it was and Place takes the third it gave up.
   Measured on the DEV copy before the change: When 108 + Who 75 + Decision 275 + Products 60 = 518 px at every width, Place 200 (the cap of td.kurz), Subject the rest - at 1920 px
   (table 1617) Subject 899, at 3440 px (table 3137) Subject 2419; the table is the window less 303 px (sidebar and page margins). Subject 2/3 of that and Place the third it gave up: Subject =
   2/3 (T - 718) and Place = 200 + 1/3 (T - 718) = T/3 - 39 px for a table T wide, i.e. 29 % of T at 1280 px, 31 % at 1920, 32 % at 3440. The table is fixed-layout (a table cell resolves no
   calc() with a percentage): the four small columns keep their 518 px plus 9 px of air (112 and 80 where a date and a name were cut at the measured width), Place is 31 % of the table and Subject (no width) takes what is left,
   at every width of the table, New and Old frame alike (1280: 147 and 303, 1920: 589 and 501, 3440: 1638 and 972 - within 35 px of the exact thirds). Cells narrower than their text end in an ellipsis. Scoped to the Log table: td.rest and td.kurz are shared.
   PIM-397 rework (Kai 05.11.2026: "more space for Who, Decision, less space for subject. do not touch the other columns"; his choice C of Q-PIM-398-1): Who 205 px (the widest name on the DEV copy of
   05.11. needs 205, so no name is cut) and Decision 322 px (all but one decision of 161 fit); When 112, Products 60 and Place 31 % are unchanged, so the px come out of Subject alone.
   PIM-398 (Kai's verdict 05.11.2026: "regarding the col widths make a sensible fit"): the New view's Log has sortable headings and a filter row (a from / to date above When, a value choice
   above Products), so When is 140 px (the whole date and time, 114 px, and the date fields fit; before it cut 140 rows by 2 px) and Products 72 px (the heading with its sort mark). Who, Decision
   and Place as above; Subject takes the rest. A column can be resized by the person (neu.js). */
table[data-protokoll] { table-layout: fixed; width: 100%; }
table[data-protokoll] th:nth-child(1) { width: 140px; }
table[data-protokoll] th:nth-child(2) { width: 205px; }
table[data-protokoll] th:nth-child(3) { width: 322px; }
table[data-protokoll] th:nth-child(5) { width: 104px; }
table[data-protokoll] th:nth-child(6) { width: 31%; }
table[data-protokoll] td { overflow: hidden; text-overflow: ellipsis; }
table[data-protokoll] td.rest { width: auto; max-width: none; }
table[data-protokoll] td.kurz { max-width: none; }
/* PIM-121: the row an entry of the Entscheidungen page links to (a decision in a document's Verlauf, a rule on the Regeln page) */
tr:target > td { background: var(--amber-hell); }
/* PIM-283 D1: the Documents list is one line per row - the file name cell too: a name longer than the cap ends in an ellipsis (the link holds it whole) */
td.dateiname { max-width: 44em; overflow: hidden; text-overflow: ellipsis; }
td.eins { max-width: 150px; }
td.eins, td.eins div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* PIM-101: the contact list never cuts a value off. A single-line field is as wide as what it holds (field-sizing; the page also sets
   size= from the value, the fallback of a browser without it); a note is a wrapping box that grows with its text and takes the width
   the other columns leave. */
table.kontakte td input { field-sizing: content; max-width: none; }
/* an empty field keeps the room for what it usually holds: an address of 25 characters, a phone number of 17, a name of 15 */
table.kontakte td input[type=email] { min-width: 26ch; }
table.kontakte td input[type=tel] { min-width: 18ch; }
table.kontakte td input[data-feld=ansprechpartner] { min-width: 16ch; }
table.kontakte td input[data-feld=stapel] { min-width: 6ch; }
table.kontakte td textarea { field-sizing: content; min-width: 16ch; resize: none; overflow: hidden; }
/* no scroller of its own (Kai) - the page scrolls; the header row sticks to the top of main's padding box */
.tabellenrahmen { border: 1px solid var(--linie); border-radius: var(--r-6); background: var(--flaeche); }
.tabellenrahmen th { position: sticky; top: calc(-1 * var(--a-16)); z-index: 1; }
table.normen { table-layout: fixed; }
table.normen th:first-child { width: 48%; }
table.normen td { overflow-wrap: anywhere; }
.ns { font-size: var(--t-12); }
.ns.gut { color: var(--gruen-text); }
.ns.schlecht { color: var(--rot-text); }
.ns.neutral { color: var(--text-2); }

/* the product matrix: one dot per type, rotated type headers */
.matrix td.zelle { padding-left: 2px; padding-right: 2px; width: 26px; min-width: 26px; }
.matrix th.typ { padding: 6px 2px; width: 26px; min-width: 26px; vertical-align: bottom; height: 96px; }
.matrix th.typ span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; font-size: var(--t-12); line-height: 1.1; white-space: nowrap; }
.matrix th.norm { background: #f1f5fa; }
.matrix td.mc { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matrix td.trenn, .matrix th.trenn { border-left: 2px solid var(--linie); }
.punkt { display: block; width: 100%; height: 18px; border-radius: 3px; }

/* the coverage heatmap */
.heat td.h { text-align: center; font-variant-numeric: tabular-nums; font-size: var(--t-12); padding: 0; color: var(--farbe-text, var(--text)); }
.heat td.h a { display: block; padding: calc((var(--zeile) - 19px) / 2) 2px; color: inherit; }
.heat td.h a:hover { outline: 2px solid var(--navy); outline-offset: -2px; text-decoration: none; }

/* ---------- marks painted by data: data-farbe names a Ton, mapped ONCE here (fill and the text on it) ---------- */
[data-farbe=gruen] { --farbe: var(--gruen); --farbe-text: #fff; }
[data-farbe=gruen-hell] { --farbe: var(--gruen-hell); --farbe-text: var(--gruen-text); }
[data-farbe=blau] { --farbe: var(--blau); --farbe-text: #fff; }
[data-farbe=rot] { --farbe: var(--rot); --farbe-text: #fff; }
[data-farbe=amber] { --farbe: var(--amber); --farbe-text: #fff; }
[data-farbe=navy] { --farbe: var(--navy); --farbe-text: #fff; }
[data-farbe=neutral] { --farbe: var(--neutral); --farbe-text: var(--text-2); }
[data-farbe=leer] { --farbe: var(--leer); --farbe-text: var(--text-3); }
[data-farbe=schraffur-gruen] { --farbe: var(--schraffur-gruen); --farbe-text: var(--text); }
[data-farbe=schraffur-amber] { --farbe: var(--schraffur-amber); --farbe-text: var(--text); }
[data-farbe=schraffur-rot] { --farbe: var(--schraffur-rot); --farbe-text: var(--text); }
[data-farbe=heat-0] { --farbe: var(--heat-0); --farbe-text: var(--text); }
[data-farbe=heat-1] { --farbe: var(--heat-1); --farbe-text: var(--text); }
[data-farbe=heat-2] { --farbe: var(--heat-2); --farbe-text: var(--text); }
[data-farbe=heat-3] { --farbe: var(--heat-3); --farbe-text: #fff; }
[data-farbe=heat-4] { --farbe: var(--heat-4); --farbe-text: #fff; }
.seg, .punkt, .legende i, .legendenzeile i, .kachel .mini i, .heat td.h { background: var(--farbe); }
/* a cell-state pill shows the state's matrix colour - one state, one colour on dots, legend and pill */
.chip[data-farbe] { background: var(--farbe); color: var(--farbe-text); }
/* a fill as light as the card needs its edge */
.legende i, .legendenzeile i, .punkt[data-farbe=leer] { box-shadow: inset 0 0 0 1px var(--linie); }

/* ---------- legend and bar chart ---------- */
.legende { display: flex; flex-wrap: wrap; gap: var(--a-4) var(--a-12); font-size: var(--t-12); color: var(--text-2); }
.legende span { display: inline-flex; align-items: center; gap: 5px; }
.legende i, .legendenzeile i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
/* the label column as wide as its longest label up to 2/5 of the card, the figure column as wide as its figure */
.balken { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr) max-content; align-items: center; gap: var(--a-4) 10px; }
.balken .l { font-size: var(--t-13); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.balken .l a { color: var(--text); }
.balken .l small { color: var(--text-3); margin-left: var(--a-4); }
.balken .r { font-size: var(--t-12); color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { display: flex; gap: var(--a-2); height: 18px; }
.seg { display: block; min-width: 3px; height: 100%; flex: var(--anteil) 1 0; }
.seg.anteil { flex: 0 0 calc(var(--anteil) * 1%); }
.seg:first-child { border-radius: 4px 0 0 4px; }
.seg:last-child { border-radius: 0 4px 4px 0; }
.seg:only-child { border-radius: 4px; }
.seg:hover { outline: 2px solid var(--navy); outline-offset: 1px; text-decoration: none; }

/* ---------- the document: pages left, what was read right ---------- */
.blaettern { display: flex; align-items: center; gap: var(--a-8); }
.blaettern .knopf { font-size: var(--t-18); }
.blaettern .seitenzahl { flex: 1; text-align: center; font-size: var(--t-12); color: var(--text-2); }
img.blatt { display: block; width: 100%; height: auto; border: 1px solid var(--linie); border-radius: var(--r-4); background: #fff; }
/* PIM-105: a page is whole on screen without scrolling, portrait or landscape. The page card starts at the top of main and is
   exactly as tall as main's content box - the frame's own definition (.rahmen is 100vh, the app bar --kopf, main's padding
   --a-16 above and below), not a measured offset. Inside the card the image takes what the card's title, button row and page
   turner leave: it only shrinks (never past its natural size), keeps its aspect ratio, and its border hugs the page. The card
   sticks while the read column beside it, which may be longer, scrolls with the page (no scroller of its own - Kai). */
.blattansicht .seitenkarte { position: sticky; top: 0; height: calc(100vh - var(--kopf) - 2 * var(--a-16)); display: flex; flex-direction: column; }
.blattansicht img.blatt { flex: 0 1 auto; min-height: 0; width: auto; max-width: 100%; align-self: center; object-fit: contain;
  /* never taller than the page's own pixels (a 2560 x 1600 screen would stretch an A4 image past its 1287 px and blur it; max-height is
     the rule's own banned word). Two lines, the second wins where the browser reads attr() as a length (Chrome, Edge): the img's own
     height attribute is its natural height, whatever the page format. The first is the fallback (Firefox has no typed attr()): the A4
     height of the renderer - the format of every page set today - so it does not upscale either; a page of another format is
     only held to the card's height there, which is how PIM-105 drew it. The same fallback value also answers a page whose size is
     unknown (no width/height attribute, data-groessen "-") in Chrome and Edge: held to 1287 px, harmless for the A4 pages there are. */
  height: min(var(--blatt-hoehe), var(--seite-hoehe));
  height: min(var(--blatt-hoehe), attr(height px, var(--seite-hoehe))); }
/* PIM-136: the document page is a header and three regions in reading order - the page card, the header (the h1), the readings
   (.lesung), the decisions (.entscheidung) - and the room decides how they sit (nav bar | document | readings | decisions at 3440 x
   1440, the form beside the page at 1920 x 1080, as before at 1280 x 900).
   (the screens named here are examples: 3440 x 1440 side by side, 1920 x 1080 the form beside the page, 1280 x 900 as before)
   ONE SOURCE for every size below (E3), three numbers:
     the page image's own pixels   --seite-breite x --seite-hoehe = 910 x 1287 (A4 at the renderer's 110 dpi, AgentSeitenBauen)
     the least a pane needs        --panemin = 791 px: the review card's tick table at its own min-content, plus the card's 2 x 16
                                   padding and 2 x 1 border. PIM-146 re-measured it (07.10.2026, every one of the 138 documents of the
                                   box's round, Edge): the three choices of PIM-133 P2 and the norm columns of PIM-131 had grown it from
                                   543 to 1088 px, so at 2560 the form overflowed its 628 px pane, cut off at "Schließt offene Pflichtno…".
                                   With its headers and pills wrapping (as the readings' tables do) it is 757 px at most - 757 + 34.
     the card's own chrome         --seitenrand (the rows above the image) and 34 px beside it (2 x 16 padding, 2 x 1 border)
   The page card is as wide as its image: the image is as tall as the card leaves - the viewport less the app bar, the padding and the
   card's own rows, all tokens (137.6 px at today's tokens, measured 138) - but never taller than its own pixels (an A4 image stretched
   on a 2560 x 1600 screen would blur; max-height is the rule's own banned word), its width follows from the aspect ratio (the img
   carries its pixel size), and the rows above it take no width of their own (width: 0 + min-width: 100%), so a long note under "Original
   öffnen" wraps instead of widening the column. A row that wraps anyway makes the card one row too short: the frame and the image
   shrink with it (flex-shrink, min-height 0), the width following the shrunk height by the aspect ratio, so the page keeps its shape and
   is centred in the column. The column is as wide as the image (fit-content) and never so wide that the panes lose their minimum -
   no percentage of the page: a 3440, a 2400 and a 2800 px screen all give the card 910 + 34 = 944 px at most.
   The thresholds are written in range syntax, (width < N) and (width >= N), never max-width: N-1 beside min-width: N: a fractional CSS
   width (browser zoom, display scaling: 1760.5) must match exactly one layout, not fall between two.
   The two thresholds below are the same numbers added up (a media query cannot take a custom property; a test holds them to these):
     two columns  = nav 196 + main padding 32 + card 944 + gap 12 + 1 pane 791         + scrollbar 15  = 1990 px
     three panes  = nav 196 + main padding 32 + card 944 + 2 gaps 24 + 2 panes 1582    + scrollbar 15  = 2793 px */
.blattansicht { --seitenrand: calc(2px + 2 * var(--a-16) + 1.4 * var(--t-14) + 3 * var(--a-8) + 2 * var(--feld));
  /* the height the card leaves the page image (PIM-173: one source for the image and the zoomed window that stands in for it) */
  --blatt-hoehe: calc(100vh - var(--kopf) - 2 * var(--a-16) - var(--seitenrand));
  --seite-breite: 910px; --seite-hoehe: 1287px; --panemin: 791px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--a-12); align-items: start; }
.blattansicht .seitenkarte > .knoepfe, .blattansicht .seitenkarte > .blaettern { width: 0; min-width: 100%; }
/* below 1990 px (1280 x 900, 1920 x 1080): as the page always stood - the page card beside the header, the metadata and the norms, and the form
   (its rows are the pairings) and the set-aside pairings each as wide as main under them. The readings region dissolves into the grid for that
   (display: contents), each of its cards placed by its own name; rows 1-4 are the right column the page card spans. */
@media (width < 1990px) {
  /* the page card (the image's case) shares the row as it always did, half and half; a card without an image keeps the older third.
     The rows are pinned: the card spans rows 1-4, so its spare height must go to the last of them, never into the header's row. */
  .blattansicht { row-gap: 0; grid-template-rows: auto auto auto 1fr; }
  .blattansicht:has(img.blatt) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .blattansicht > .seitenkarte { grid-row: 1 / span 4; }
  /* PIM-146 follow-up: the card does not stick here - a sticky grid item is held to the grid, not to its own rows, so scrolled down to the
     form (a full-width row below it) the card stayed at the top and covered the form's left part (1280 x 900: card y 64-884 over the form from
     y 48). The rows beside it (header, metadata, norms) are about as tall as the card anyway */
  .blattansicht .seitenkarte { position: relative; }
  .blattansicht > .kopf { grid-column: 2; grid-row: 1; }
  .blattansicht > .lesung { display: contents; }
  .blattansicht > .lesung > * { grid-column: 2; margin-top: var(--a-12); min-width: 0; }
  .blattansicht > .lesung > .hinweisbox { grid-row: 2; }
  .blattansicht > .lesung > .metadaten { grid-row: 3; }
  .blattansicht > .lesung > .normenkarte { grid-row: 4; }
  /* PIM-153: the form (whose rows are the pairings) comes first under the page, the set-aside pairings after it */
  .blattansicht > .entscheidung { grid-column: 1 / -1; grid-row: 5; margin-top: var(--a-12); }
  .blattansicht > .lesung > .aussortiert { grid-column: 1 / -1; grid-row: 6; }
}
/* the readings' tables may sit in a column beside the page (the Metadaten and Normen cards): a header or a pill may wrap instead of
   widening the column past main (never a horizontal scroll). PIM-146: the review form's tick table too - its headers ("Schließt offene
   Pflichtnormen") and pills ("ok – Norm passt", a compressor list) held it to 1088 px at its narrowest, now 757 (--panemin) */
.blattansicht .lesung th, .blattansicht .lesung td > .chip, .blattansicht .entscheidung th, .blattansicht .entscheidung td > .chip { white-space: normal; }
/* from 1990 px the form sits beside the page instead of under everything: the page spans all rows, and the decisions come FIRST in the
   column - the readings are the longer part, so beneath them the form would start below the fold (measured numbers: the plan and
   docs/plans/pim-136-screens/nachher-metrics.json). The markup order stays document, header, readings, decisions: the focus order differs from the picture in this
   one range only (the readings hold links, no controls; the form is the work), accepted rather than reordering the markup for it -
   at 2793 px and up, and below 1990, the picture and the markup agree. */
@media (width >= 1990px) {
  /* the card spans all three rows: its spare height goes to the last (the readings), never into the header's or the form's row */
  .blattansicht { row-gap: var(--a-12); grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-rows: auto auto 1fr; }
  .blattansicht:has(img.blatt) { grid-template-columns: fit-content(calc(100% - var(--panemin) - var(--a-12))) minmax(0, 1fr); }
  .blattansicht > .seitenkarte { grid-row: 1 / span 3; }
  .blattansicht > .kopf { grid-column: 2; grid-row: 1; }
  .blattansicht > .entscheidung { grid-column: 2; grid-row: 2; }
  .blattansicht > .lesung { grid-column: 2; grid-row: 3; }
}
/* from 2793 px - 3440 x 1440, 2800 x 1440 and the like: nav bar | document | readings | decisions, one screen high; the
   header runs over the two panes */
@media (width >= 2793px) {
  /* the card spans both rows: its spare height goes to the panes' row, so they start right under the header */
  .blattansicht { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 2fr); grid-template-rows: auto 1fr; }
  .blattansicht:has(img.blatt) { grid-template-columns: fit-content(calc(100% - 2 * var(--panemin) - 2 * var(--a-12))) minmax(0, 1fr) minmax(0, 1fr); }
  .blattansicht > .seitenkarte { grid-row: 1 / span 2; }
  .blattansicht > .kopf { grid-column: 2 / -1; grid-row: 1; }
  .blattansicht > .lesung { grid-column: 2; grid-row: 2; }
  .blattansicht > .entscheidung { grid-column: 3; grid-row: 2; }
}
/* PIM-134: the image sits in a frame (the flex item the image was) with the boxes over it, one svg per page. In the frame the image
   has no border (a border would shift the drawn page inside the frame by 1 px against the boxes): its outline hugs it instead. */
.blattrahmen img.blatt { border: 0; outline: 1px solid var(--linie); outline-offset: -1px; border-radius: 0; }
.blattrahmen { position: relative; display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; max-width: 100%; align-self: center; }
/* one svg per page with boxes over the whole frame; its viewBox is the page image in pixels and "meet" centres it the way the image
   is drawn (object-fit: contain), so a box lies on the drawn image whatever the size */
svg.marken { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
svg.marken[hidden] { display: none; }
/* PIM-173 (Kai: "a 2x, 4x zoom ... and / or a double click on a marked field opens an enlarged (2x) view"): the buttons beside the page turner,
   and the window the frame sits in. At 1x the window is no box (display: contents) and the page is exactly as PIM-105 sized it; zoomed in, the
   stylesheet gives the window the 1x page's size and the frame z times its width (pim.js only sets classes and the page's pixel size as data-b /
   data-h, PIM-104: no script writes a style), and the window scrolls inside itself in both directions - the one scroller
   of the page besides main and nav, and only while the person has asked for it (AnsichtenTests.No_scroll_area_inside_the_page names it). The
   boxes are an svg over the frame, so they scale with it. A box takes the double click (it is drawn, never in the way: the svg itself takes none). */
.zoom { display: inline-flex; gap: var(--a-4); }
.zoom[hidden] { display: none; }
.blaettern .zoom .knopf { font-size: var(--t-13); padding-left: var(--a-8); padding-right: var(--a-8); }
.zoom .knopf[aria-pressed="true"], .zoom .knopf[aria-pressed="true"]:hover { background: var(--blau); border-color: var(--blau); color: #fff; }
.blattfenster { display: contents; }
.blattansicht .blattfenster.gross { display: block; flex: 0 1 auto; min-height: 0; align-self: center; max-width: 100%; overflow: auto; overscroll-behavior: contain;
  background: #fff; outline: 1px solid var(--linie); outline-offset: -1px;
  /* the window is the 1x page's size: the image's own height rule (--blatt-hoehe, its natural height from the attribute) and the page's own shape,
     both from the current page's pixel size that pim.js copies onto the window (data-b x data-h, any format - PIM-105). The first line of each pair
     is the fallback where the browser has no typed attr() (the A4 renderer size, --seite-breite x --seite-hoehe; aspect-ratio takes numbers only) */
  height: min(var(--blatt-hoehe), var(--seite-hoehe));
  height: min(var(--blatt-hoehe), attr(data-h px, var(--seite-hoehe)));
  aspect-ratio: 910 / 1287;
  aspect-ratio: attr(data-b type(<number>), 910) / attr(data-h type(<number>), 1287); }
.blattansicht .blattfenster.gross .blattrahmen { display: block; flex: none; max-width: none; align-self: auto; }
.blattansicht .blattfenster.gross.z2 .blattrahmen { width: 200%; }
.blattansicht .blattfenster.gross.z4 .blattrahmen { width: 400%; }
.blattansicht .blattfenster.gross .blattrahmen img.blatt { width: 100%; height: auto; max-width: none; outline: 0; }
/* every box is drawn as the page opens, in its field's colour (the class f-<field>, below): a full-strength outline and a light fill, so
   the text under it stays readable; a field the web does not know falls back to amber */
svg.marken .marke { fill: var(--feldfarbe, var(--amber)); fill-opacity: .16; stroke: var(--feldfarbe, var(--amber)); stroke-width: 2px; vector-effect: non-scaling-stroke;
  /* PIM-173: the box takes the double click that opens the 2x view (the svg itself takes none) */
  pointer-events: all; cursor: zoom-in; }
svg.marken .marke.puls { animation: puls 1.6s ease-out 1; }
@keyframes puls { 0%, 40% { fill-opacity: .6; stroke-width: 6px; } 100% { fill-opacity: .16; stroke-width: 2px; } }
@media (prefers-reduced-motion: reduce) { svg.marken .marke.puls { animation: none; fill-opacity: .5; } }
/* PIM-134: one colour per read field (tokens --feld-*, grundwerte.css) - the frame on the page, and a swatch before the field's label
   in the review form, its line under it and its row in the readings (.feldfarbe: only where the page has a frame for the field) */
.f-modelle { --feldfarbe: var(--feld-modelle); }
.f-doc_number { --feldfarbe: var(--feld-doc_number); }
.f-cert_to_report { --feldfarbe: var(--feld-cert_to_report); }
.f-ausstelldatum { --feldfarbe: var(--feld-ausstelldatum); }
.f-pruefstelle { --feldfarbe: var(--feld-pruefstelle); }
.f-pruefer_typ { --feldfarbe: var(--feld-pruefer_typ); }
.f-lieferant { --feldfarbe: var(--feld-lieferant); }
.f-kompressoren { --feldfarbe: var(--feld-kompressoren); }
.f-normen { --feldfarbe: var(--feld-normen); }
.feldfarbe > span:first-child::before, button.ort.feldfarbe::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: var(--a-4); vertical-align: -1px;
  border: 2px solid var(--feldfarbe); border-radius: 2px; background: color-mix(in srgb, var(--feldfarbe) 16%, transparent); box-sizing: border-box; }
/* the line under a form field: where the reading found it - a button that looks like a link */
button.ort { align-self: flex-start; background: none; border: 0; padding: 0; font: inherit; color: var(--blau); cursor: pointer; text-align: left; }
button.ort:hover { text-decoration: underline; }
.ort.klein { font-size: var(--t-12); }
/* an upload's PDF fills the visible column: the viewport less the app bar, main's padding, the page header line, the gap,
   and its own "Datei öffnen" row below - whatever the PDF's page format */
iframe.vorschau { display: block; width: 100%; height: calc(100vh - var(--kopf) - 2 * var(--a-16) - var(--feld) - var(--a-12) - var(--feld) - var(--a-8));
  border: 1px solid var(--linie); border-radius: var(--r-6); background: #fff; }
pre.mail { white-space: pre-wrap; overflow-wrap: anywhere; font: var(--t-13)/1.5 var(--mono); background: var(--grund); border: 1px solid var(--linie); border-radius: var(--r-6); padding: 10px var(--a-12); margin: 0; }

/* ---------- PIM-136: the product page - the facts, the Produkthülle (the readings), the document search, the norm coverage ---------- */
/* stacked in the order the page always had; wide, the Produkthülle (the long one) sits beside the other three, each placed by its
   own name. The first three rows hold the left cards, the last row takes what the Produkthülle's height leaves over.
   The two panes' least widths are the cards' own min-content (the widest of 400 products of the recorded round, measured in the
   browser; each includes the card's 2 x 16 padding and 2 x 1 border): the facts, search and norm cards 525 px, the Produkthülle 776 px.
   The threshold is the same numbers added up (a media query cannot take a custom property; a test holds them):
     two panes = nav 196 + main padding 32 + 525 + gap 12 + 776 + scrollbar 15 = 1556 px */
details.normen > summary, details.huelle > summary { cursor: pointer; }
/* PIM-154: an edition as the document writes it ("EN 60335-2-6:2003+A1:2005+A2:2008+...") has no space to wrap at - it may break anywhere */
.produktschritte td .klein { overflow-wrap: anywhere; }
/* PIM-184 (Kai 11.10.2026: "Tables overlap horizontally"): the product page's panes are as wide as the grid gives them, never wider - a
   table in one wraps instead of painting over the neighbour or past the screen. In the product's steps every cell and header may break an
   edition anywhere (the norm table's "Fassung im Dokument" is a plain cell, 471 px on 14055 at 1920; the document table has one header per
   open standard, its edition the header text, 1168 px on 21672 at 3440); the Produkthülle's state cell keeps its pills on one line but wraps
   the sentences below them. Keyed on the product steps' own marker: the order and request pages reuse .produktansicht > .produktschritte */
[data-produktschritte] td, [data-produktschritte] th { overflow-wrap: anywhere; }
[data-produktschritte] th { white-space: normal; }
.huelle td.zustand > div { white-space: normal; }
/* PIM-154 (Kai 08.10.): the step's one request button sits at the right of its heading, apart from the lists below */
.schrittkopf { display: flex; align-items: center; justify-content: space-between; gap: var(--a-8); flex-wrap: wrap; }
.schrittkopf h3 { margin: 0; }
details.normen > summary > h2, details.huelle > summary > h2 { display: inline; }
.produktansicht { --fakten-min: 525px; --huelle-min: 776px; display: flex; flex-direction: column; gap: var(--a-12); }
@media (width >= 1556px) {
  .produktansicht { display: grid; grid-template-columns: minmax(var(--fakten-min), 1fr) minmax(var(--huelle-min), 1fr); grid-template-rows: auto auto 1fr auto auto; align-items: start; }
  .produktansicht > .produktkarte { grid-column: 1; grid-row: 1; }
  /* PIM-184 P5a (plan §3.6): the facts left, the steps right - the steps' column spans the three rows the left cards use, so the 1fr row takes their height and the left
     cards stay together. The norm card (folded once Prüfen is done) and the hand-over to PIM (the slot table) come below the steps */
  .produktansicht > .produktschritte { grid-column: 2; grid-row: 1 / span 3; }
  .produktansicht > .normen { grid-column: 2; grid-row: 4; }
  .produktansicht > .huelle { grid-column: 2; grid-row: 5; }
  .produktansicht > .suche { grid-column: 1; grid-row: 2; }
}
/* PIM-184 P5a: the product steps - the pieces the page always had (the norm table, the linked documents, the open norms) sit inside them without a frame of their own; the step that
   is open is framed, a done one is one line, a later one is greyed (the document page's steps, .pruefung .schritt above) */
.produktschritte { display: flex; flex-direction: column; gap: var(--a-8); }
.produktschritte .schritt .schritt { border: 0; padding: 0; background: none; }
.produktschritte .schritt.offen { border: 2px solid var(--blau); }
.produktschritte details.normen.innen > summary > h2 { font-size: var(--t-13); margin: 0; }
.produktschritte .schrittform { margin: 0; }
/* PIM-184 P5c (K27): the linked documents' own form - the three choices of a row (the cells keep wrapping), the rejection's reason revealed only while Ablehnen is chosen,
   "Weiteres Dokument zuordnen" under each table and the one save button below them */
.produktschritte .dokumentform { margin: 0; }
.dokwahl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--a-4) var(--a-8); margin-top: var(--a-4); }
.dokwahl > label.wahl { display: inline-flex; align-items: center; gap: var(--a-4); white-space: nowrap; }
.dokwahl > label.wahl input { margin: 0; }
/* PIM-255 P1 (D3): the reason chips - radios drawn as chips (one click, no script needed), "Not this product" first; the note appears with a checked rejection */
.chipsatz { display: inline-flex; flex-wrap: wrap; gap: var(--a-4); }
/* PIM-274: the label is the box its hidden radio is positioned in - an absolute input with no positioned ancestor sits against the page, outside main's
   clip, and gave the page a second (viewport) scrollbar beside main's whenever the radios lay below the first screen */
label.chipwahl { position: relative; display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap; }
label.chipwahl input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
label.chipwahl span { display: inline-block; padding: 0 8px; line-height: 20px; border: 1px solid var(--linie); border-radius: var(--r-pille); background: var(--flaeche); font-size: var(--t-12); color: var(--text-2); }
label.chipwahl:hover span { border-color: var(--neutral); background: var(--zeile-hover); }
label.chipwahl input:checked + span { background: var(--blau-hell); border-color: var(--blau); color: var(--navy); font-weight: 600; }
label.chipwahl input[value^="abgelehnt"]:checked + span { background: var(--rot-hell); border-color: var(--rot-linie); color: var(--rot-text); }
label.chipwahl input:focus-visible + span { outline: 2px solid var(--blau); outline-offset: 1px; }
.dokwahl > label.chipwahl { display: inline-flex; }
/* PIM-255 P2 (D1, D3): the document card - "Reject document …" is the whole-document reason, one chip each (red when checked, like a row's rejection), the note optional */
.dokablehnen .chipsatz { margin: var(--a-4) 0; }
.dokablehnen label.chipwahl input:checked + span { background: var(--rot-hell); border-color: var(--rot-linie); color: var(--rot-text); }
.dokumentkarte .knoepfe { align-items: center; }
input.chipnotiz { display: none; width: 14em; min-width: 0; font-size: var(--t-12); padding: 1px 6px; }
tr:has(input[value^="abgelehnt"]:checked) input.chipnotiz, .dokwahl:has(input[value^="abgelehnt"]:checked) > input.chipnotiz { display: inline-block; }
.pruefung td.chips { white-space: normal; }
.dokumentform .weiteres { display: flex; flex-wrap: wrap; align-items: center; gap: var(--a-8); margin-top: var(--a-8); }
.dokumentform .weiteres input[type="text"] { flex: 1 1 14em; min-width: 0; }
.produktschritte .knoepfe { margin-top: var(--a-8); }
/* the columns inside a step: as many as fit at --schritt-spalte each (no breakpoint of its own - the steps' pane is whatever width the frame gives it) */
.produktschritte { --schritt-spalte: 500px; }
.produktschritte .zwei, .produktschritte .drei { display: grid; gap: var(--a-16); align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(var(--schritt-spalte), 100%), 1fr)); }

/* PIM-184 P7: the Supplier Portal view - the supplier selector, and the supplier's own page in a sandboxed frame that takes what main leaves of the screen
   (the page brings its own header, legend and scrolling grid; 220 px = the head, the selector and the line above the frame) */
.lieferantenwahl { display: flex; flex-wrap: wrap; gap: var(--a-4) var(--a-8); margin: 0 0 var(--a-8); }
.lieferantenwahl a.chip { text-decoration: none; }
.portalrahmen { display: block; width: 100%; height: calc(100vh - 220px); min-height: 480px; border: 1px solid var(--linie); border-radius: var(--r-6); background: var(--flaeche); }
/* PIM-184 P7: one block per gap-list name without a Sage number on /anfragen (the number card moved here from the batch composer) */
.nummernblock + .nummernblock { border-top: 1px solid var(--linie-2); margin-top: var(--a-12); padding-top: var(--a-12); }
.nummernblock h3 { margin: 0 0 var(--a-4); }

.produktschritte .dokumentbreit { margin-top: var(--a-16); }
/* ---------- the review form ---------- */
.pruefung > * { margin-top: 0; margin-bottom: 0; }
.pruefung > * + * { margin-top: 10px; }
.pruefung .felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--a-8) var(--a-12); }
.pruefung .feld.breit { grid-column: 1 / -1; }
.pruefung details > summary { font-size: var(--t-13); color: var(--text-2); }
.pruefung details > * + * { margin-top: var(--a-8); }
/* PIM-133 P2: the three choices of a row - narrow columns, one radio each, the words in the header's title and the aria-label */
.pruefung th.wahl, .pruefung td.wahl { width: 3.4em; text-align: center; padding-left: 4px; padding-right: 4px; }
.pruefung td.wahl input { margin: 0; }
/* PIM-133 P4: a decided row's follow-ons, under the row (amber: a change has consequences outside this page) */
.pruefung tr.folgenzeile td { background: var(--amber-hell); font-size: var(--t-12); }
.pruefung ul.folgen, .vorher ul.folgen { margin: 2px 0 0; padding-left: 1.2em; }
.vorher .ueberschrieben { margin-top: var(--a-4); }
/* PIM-153: a row's compressor - as wide as its cell, never wider than 6em by itself (an entry like "DL1-45K, DL1-16S-4, …: WV35YT" would
   widen the tick table past --panemin; the full text stays in the open list) */
.pruefung td select.kompressor { display: block; width: 100%; min-width: 6em; margin-top: 2px; font-size: var(--t-12); }
.pruefung .wahlleiste { color: var(--text-2); }
/* PIM-133 P6: the keys of the review form, and the line the first F of a commit with "nicht zutreffend" rows shows beside the button */
.pruefung .tasten { color: var(--text-2); }
.pruefung kbd { font: inherit; font-size: var(--t-12); padding: 0 4px; border: 1px solid var(--linie); border-radius: var(--r-4); background: var(--flaeche); }
.pruefung .fhinweis { margin-left: var(--a-8); color: var(--amber-text, var(--text)); font-weight: 600; }
/* PIM-184 P1b: the steps of the work pane - the current one open, a done one folded to a line with its tick, a later one greyed (the left menu is the
   only navigation: no walk bar, no step bar) */
.pruefung .schritt { border: 1px solid var(--linie); border-radius: var(--r-6); padding: var(--a-8) 10px; background: var(--grund); }
.pruefung .schritt > * + * { margin-top: 10px; }
.pruefung .schritttitel { margin: 0; font-size: var(--t-13); }
.pruefung .schrittnr { display: inline-block; min-width: 1.4em; text-align: center; border: 1px solid var(--linie); border-radius: var(--r-6); }
.pruefung .schritt.erledigt, .pruefung .schritt.abgelehnt, .pruefung .schritt.wartet { padding-top: 4px; padding-bottom: 4px; }
.pruefung .schritt.wartet { color: var(--text-2); opacity: .7; }
.pruefung .schrittzeile .zeichen { font-weight: 700; }
.pruefung .weiteres { display: flex; flex-wrap: wrap; align-items: center; gap: var(--a-8); }
.pruefung .hinweis-leer { border: 1px solid var(--linie); border-radius: var(--r-6); padding: var(--a-8); background: var(--amber-hell); }
/* PIM-184 P2: the Old :target overlay. PIM-615 / PIM-634 moved every pop-up onto Toni's modal and deleted the :target and .popup rules; this base rule stays because the artworks drawer
   (NeuBausteine.Schublade, class "overlay show") still takes its top offset (padding-top, align-items) from it - Toni's artworks sheet sets neither. */
.overlay { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(11, 31, 54, .45); align-items: flex-start; justify-content: center; padding-top: 60px; }

/* ---------- PIM-123: a proposal on the product page - what, why, what to check, and the decision in place ---------- */
.vorschlag { border: 1px solid var(--linie); border-radius: var(--r-6); padding: var(--a-8) 10px; background: var(--grund); }
.vorschlag + .vorschlag, .vorschlag + details.verworfen, details.verworfen { margin-top: var(--a-8); }
.vorschlag > * + * { margin-top: 6px; }
.erklaerung { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px var(--a-12); margin: 0; font-size: var(--t-13); }
.erklaerung dt { color: var(--text-2); font-weight: 600; }
.erklaerung dd { margin: 0; overflow-wrap: anywhere; }
details.verworfen > summary { font-size: var(--t-13); color: var(--text-2); cursor: pointer; }
details.verworfen ul { margin: var(--a-4) 0 0; padding-left: 18px; font-size: var(--t-13); }

/* ---------- the stand-alone pages (no access, sign-in failed): one card on the page ---------- */
body > header { height: var(--kopf); }
.einzelkarte { max-width: 640px; margin: 48px auto; }
.einzelkarte h2 { font-size: var(--t-18); }
.einzelkarte ul { padding-left: 20px; }

#tip { position: fixed; pointer-events: none; background: var(--navy); color: #fff; font-size: var(--t-12); padding: 6px var(--a-8); border-radius: var(--r-4); max-width: 320px; z-index: 50; display: none; line-height: 1.35; }

/* narrow screens: reflow, never shrink - nav becomes a strip, cards stack (desktop is the target, K2) */
@media (width < 761px) {
  .rahmen { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--kopf) auto minmax(0, 1fr); }
  header .suche, header .stand { display: none; }
  /* PIM-269: at 390 px the title, the environment badge, the version and the user do not fit the bar - the version gives way, the badge stays */
  header .version { display: none; }
  nav { display: flex; gap: var(--a-4); overflow-x: auto; padding: 6px var(--a-8); border-right: 0; border-bottom: 1px solid var(--linie); min-width: 0; }
  header { min-width: 0; overflow: hidden; }
  nav a { flex: 0 0 auto; gap: 6px; }
  nav .trenner, nav .klein { display: none !important; }
  /* PIM-184 P1a: in the strip a heading is one more item and a step is not indented */
  nav .abschnitt { flex: 0 0 auto; margin-top: 0; padding: 7px 10px; }
  nav a.schritt { padding-left: 10px; }
  .raster, .raster.weit, .zweispaltig { grid-template-columns: minmax(0, 1fr); }
  /* stacked columns: the page card is as tall as its page again and scrolls away with the rest */
  .blattansicht .seitenkarte { position: static; height: auto; }
  .blattansicht, .blattansicht:has(img.blatt) { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .blattansicht > .seitenkarte { grid-row: auto; }
  .blattansicht > .lesung { display: flex; }
  .blattansicht > .kopf { grid-column: auto; grid-row: auto; }
  .blattansicht > .lesung > * { grid-column: auto; grid-row: auto; margin-top: 0; }
  .blattansicht > .entscheidung { grid-column: auto; grid-row: auto; margin-top: 0; }
  .blattansicht { row-gap: var(--a-12); }
  .blattansicht img.blatt { height: auto; }
  .blattansicht .blattfenster.gross { width: 100%; height: auto; }
  .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: var(--a-12); }
  td.zustand { white-space: normal; }
  td.zustand .chip { margin-bottom: 2px; }
}

/* ---------- PIM-210: the supplier dashboard (the colleague's prototype V02, docs/plans/pim-210/) - the prototype's structure on the app's tokens ---------- */
.dashbereich { padding: 0; overflow: hidden; }
.dashbereich > * + * { margin-top: 0; }
.bereichkopf { display: flex; align-items: center; justify-content: space-between; gap: var(--a-12); padding: var(--a-12) var(--a-16); }
.bereichtitel { display: flex; align-items: center; gap: var(--a-12); }
.bereichtitel h2 { font-size: var(--t-18); }
.bereichtitel .unter { font-size: var(--t-12); color: var(--text-3); }
.symbol { display: grid; place-items: center; flex: none; width: var(--feld); height: var(--feld); border-radius: var(--r-6); background: var(--blau-hell); color: var(--blau); }
.bereichrechts { display: flex; align-items: center; gap: var(--a-8); }
.dashbereich .tabellenrahmen { border: 0; border-top: 1px solid var(--linie); border-radius: 0; }
.dashbereich .tabellenrahmen th { position: static; }
a.po { font-weight: 700; }
.bereichfuss { display: flex; align-items: center; justify-content: space-between; gap: var(--a-12); padding: var(--a-8) var(--a-16); background: var(--kopfgrund); border-top: 1px solid var(--linie-2); font-size: var(--t-12); color: var(--text-3); }
/* the slide-in details of a row: a link closes it (no script), the shade is the navy token at 45% */
/* in flow, no scroller of its own (the app's rule: the page scrolls) - a panel above the tables that slides in */
.schublade { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-6); box-shadow: var(--schatten); animation: schublade-ein .24s ease; }
@keyframes schublade-ein { from { transform: translateX(var(--a-16)); opacity: 0; } to { transform: none; opacity: 1; } }
.schubladenkopf { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--a-12); padding: var(--a-16); border-bottom: 1px solid var(--linie); }
.schubladenkopf h2 { font-size: var(--t-18); margin: var(--a-4) 0; }
.schubladenkoerper { padding: var(--a-16); display: flex; flex-direction: column; gap: var(--a-12); }
.schubladenkoerper h3 { font-size: var(--t-14); margin: 0; }
.schubladenkoerper .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schubladenpunkt { display: flex; flex-direction: column; gap: var(--a-4); padding: var(--a-8) 0; border-bottom: 1px solid var(--linie-2); }
.schubladenfuss { display: flex; justify-content: flex-end; padding: var(--a-12) var(--a-16); border-top: 1px solid var(--linie); }
/* PIM-255 P5 (mockup "Products > Homa"): a supplier's card - its open gaps by supplier model with the document types as ticks on the left, the pre-written request on the right
   (sticky from a width that holds both). Dashed = asked already and still waiting: shown, not ticked. */
.lieferantansicht { display: grid; gap: var(--a-12); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (width >= 1556px) { .lieferantansicht { grid-template-columns: minmax(0, 2fr) minmax(420px, 1fr); } .lieferantansicht > .anfragekarte { position: sticky; top: 0; } }
.dokchips { display: flex; flex-wrap: wrap; gap: 3px 6px; }
label.dok { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-12); border: 1px solid var(--linie); border-radius: var(--r-pille); padding: 0 8px 0 4px; background: var(--flaeche); white-space: nowrap; line-height: 20px; }
label.dok:has(input:checked) { background: var(--blau-hell); border-color: #cfe2fb; color: var(--blau); font-weight: 600; }
label.dok.gefragt { border-style: dashed; color: var(--text-3); }
label.dok input { margin: 0; }
label.dok small { color: var(--text-3); font-weight: 400; }
td.produkte { font-size: var(--t-12); color: var(--text-2); }
.lieferantansicht th.wahl, .lieferantansicht td.wahl { width: 3.4em; text-align: center; padding-left: 4px; padding-right: 4px; }
.anfragemeta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px var(--a-12); font-size: var(--t-13); margin: 0 0 var(--a-8); }
.anfragemeta dt { color: var(--text-2); font-weight: 600; }
.anfragemeta dd { margin: 0; overflow-wrap: anywhere; }
.anfragekarte form { margin-top: var(--a-8); }
.wahlleiste { color: var(--text-2); margin: 0 0 var(--a-4); }
/* PIM-255 P6: a purchase order's card (D8) - its documents per line as chips in their state: ticked = asked with this request, later = the next request, dashed = asked already (by whichever card sent it first, D25). */
span.dok { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-12); border: 1px solid var(--linie); border-radius: var(--r-pille); padding: 0 8px; background: var(--flaeche); white-space: nowrap; line-height: 20px; }
span.dok.zufragen { background: var(--blau-hell); border-color: #cfe2fb; color: var(--blau); font-weight: 600; }
span.dok.gefragt, span.dok.spaeter { border-style: dashed; color: var(--text-3); }
span.dok.erfuellt { color: var(--text-3); }
span.dok small { color: var(--text-3); font-weight: 400; }
