/**
 * Herstellerunterlagen — Prüfmatrix. Baut auf app.css und maske.css auf (hd-tab, hd-knopf, hd-feld, hd-dialog).
 */
.hd-pm-filter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 10px 14px; margin: 0 0 8px; }
.hd-pm-filter .hd-feld { margin: 0; min-width: 0; }
.hd-pm-filter select, .hd-pm-filter input { width: 100%; min-width: 0; box-sizing: border-box; }
.hd-pm-stand, .hd-pm-legende, .hd-pm-nurlesen { margin: 6px 0; }
.hd-pm-nurlesen { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); }

.hd-pm-leiste {
    position: sticky; top: calc(var(--kopf-hoehe, 52px) + 4px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
    margin: 10px 0; padding: 8px 12px; border: 1px solid var(--rand); border-radius: var(--radius);
    background: var(--flaeche); box-shadow: var(--hd-schatten);
}
.hd-pm-alle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .88rem; cursor: pointer; }
.hd-pm-zahl { font-weight: 700; font-size: .88rem; color: var(--akzent-text); }
.hd-pm-aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.hd-pm-ck { width: 18px; height: 18px; flex: none; accent-color: var(--akzent); cursor: pointer; }

.hd-pm-rahmen { max-height: none; }
.hd-pm-tab { table-layout: fixed; min-width: 1000px; }
.hd-pm-tab th { white-space: normal; overflow-wrap: normal; hyphens: auto; font-size: .78rem; padding: 6px 5px; }
.hd-pm-tab th[scope=col] { position: sticky; top: 0; z-index: 2; }
.hd-pm-tab td { padding: 6px 5px; }
.hd-pm-tab .hd-pm-artikel { position: sticky; left: 0; z-index: 1; width: 160px; background: var(--grund); }
.hd-pm-tab thead .hd-pm-artikel { background: var(--flaeche); z-index: 3; }
.hd-pm-tab th[scope=row].hd-pm-artikel { display: table-cell; font-weight: 400; }
.hd-pm-artikel > .hd-pm-ck { float: left; margin: 2px 8px 0 0; }
.hd-pm-artikel-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.hd-pm-nummer { font-weight: 700; }

.hd-pm-zelle { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hd-pm-fund { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border: 1px solid var(--rand); border-radius: 8px; background: var(--grund); }
.hd-pm-fund:hover { border-color: var(--akzent); }
.hd-pm-gew { background: var(--akzent-hell); border-color: var(--akzent); }
.hd-pm-knopf {
    display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 6px; flex: 1; min-width: 0; min-height: 36px; padding: 1px 2px; border: 0; background: none;
    color: var(--text); font: inherit; font-size: .78rem; text-align: left; cursor: pointer;
}
.hd-pm-art { justify-self: start; padding: 0 5px; border-radius: 5px; background: var(--akzent-text); color: var(--grund); font: 700 .72rem 'Fira Code', monospace; }
.hd-pm-host { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-pm-nr { justify-self: start; padding: 0 6px; border-radius: 999px; font-size: .7rem; font-weight: 600; white-space: nowrap; }
.hd-pm-nr-ja { background: var(--hd-gut-bg); color: var(--hd-gut); }
.hd-pm-nr-nein { background: var(--hd-warn-bg); color: var(--hd-warn); }
.hd-pm-knopf:focus-visible, .hd-pm-ck:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 2px; border-radius: 6px; }

.hd-dialog-pm { width: min(560px, 92vw); }
.hd-pm-fortschritt { width: 100%; height: 12px; accent-color: var(--akzent); }
.hd-pm-fehler { margin: 10px 0 0; padding: 8px 12px 8px 28px; max-height: 40vh; overflow: auto; border-radius: 8px; background: var(--hd-fehl-bg); color: var(--hd-fehl); font-size: .84rem; }

@media (max-width: 760px) {
    .hd-pm-filter { grid-template-columns: 1fr 1fr; }
    .hd-pm-suchfeld { grid-column: 1 / -1; }
    .hd-pm-aktionen { margin-left: 0; }
    .hd-pm-leiste { top: calc(var(--kopf-hoehe, 52px) + 2px); }
    .hd-pm-tab { min-width: 0; table-layout: auto; }
    /* Mobil: Zeile als Karte, Zellen untereinander mit Beschriftung */
    .hd-pm-tab thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .hd-pm-tab, .hd-pm-tab tbody, .hd-pm-tab tr, .hd-pm-tab td, .hd-pm-tab th[scope=row] { display: block; width: 100%; }
    .hd-pm-tab tr { border-bottom: 3px solid var(--rand); padding-bottom: 6px; }
    .hd-pm-tab td { min-width: 0; border-bottom: 0; padding: 3px 8px; }
    .hd-pm-tab td:not(:has(.hd-pm-zelle)) { display: none; }
    .hd-pm-tab td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; color: var(--text-leise); }
    .hd-pm-tab .hd-pm-artikel { position: static; max-width: none; }
}
@media print { .hd-pm-leiste, .hd-pm-filter { display: none; } }

/* Schnelle Zuordnung direkt am Fund (AL 12.10.2026) */
@media (min-width: 761px) { .hd-pm-tab { min-width: 1240px; } }
.hd-pm-fund { flex-direction: column; align-items: stretch; gap: 4px; padding: 4px; }
.hd-pm-fund-kopf { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hd-pm-schnell { display: flex; flex-direction: column; gap: 4px; }
.hd-pm-schnell select { width: 100%; min-width: 0; min-height: 30px; padding: 2px 4px; font-size: .74rem; border: 1px solid var(--rand); border-radius: 6px; background: var(--grund); color: var(--text); }
.hd-pm-tasten { display: flex; gap: 4px; align-items: center; }
.hd-pm-tasten .hd-pm-weg { flex: 1; }
.hd-pm-mini {
    display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--rand); border-radius: 6px;
    background: var(--grund); color: var(--text); cursor: pointer;
}
.hd-pm-mini:hover:not(:disabled) { border-color: var(--akzent); }
.hd-pm-ok:not(:disabled) { color: var(--hd-gut); border-color: var(--hd-gut); }
.hd-pm-mini:disabled, .hd-pm-schnell select:disabled { opacity: .45; cursor: not-allowed; }
.hd-pm-mini:focus-visible, .hd-pm-schnell select:focus-visible { outline: 2px solid var(--akzent-text); outline-offset: 1px; }
.hd-pm-doppelt { border-color: var(--hd-warn); box-shadow: inset 3px 0 0 var(--hd-warn); }
.hd-pm-doppelt-text { margin: 0; padding: 2px 4px; border-radius: 5px; background: var(--hd-warn-bg); color: var(--hd-warn); font-size: .7rem; line-height: 1.3; }
.hd-pm-laeuft { opacity: .55; pointer-events: none; }
.hd-pm-schalter-zeile { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.hd-pm-schalter { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; cursor: pointer; }
.hd-pm-schalter input { width: 18px; height: 18px; accent-color: var(--akzent); }
.hd-pm-ki { margin: 0; padding: 2px 4px; border-radius: 5px; background: var(--akzent-hell); color: var(--text); font-size: .7rem; line-height: 1.3; }
.hd-pm-ki .hd-link { font-size: .72rem; font-weight: 700; }
/* Die Matrix nutzt die volle Breite (sonst werden die Zuordnungs-Knöpfe abgeschnitten) */
.inhalt:has(#pruefmatrix:not([hidden])) { max-width: none; }
.hd-pm-ki { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; }
.hd-pm-ki-grund { flex-basis: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-leise); }
@media (max-width: 760px) { .hd-pm-fund, .hd-pm-ki, .hd-pm-artikel-text { min-width: 0; max-width: 100%; } .hd-pm-tab td, .hd-pm-tab th[scope=row] { box-sizing: border-box; } }
