/* Herstellerunterlagen — Artikelmaske v0.3.0 (FB-2026-011…015, Grilling G-1/G-2)
 *
 * Eine Bildschirmseite ohne Scrollen, gemessen an AL's Fenster 1808×639: Kopf als eine
 * Leiste (≤ 80 px), darunter Dokumentzeilen · Bühne · Reiter. Die Aktionen sitzen in der
 * Kopfzeile der Bühne, damit das Dokument den Großteil der Höhe bekommt.
 * Bewegung nur als Antwort auf Handlungen (Hover, Auswahl, Reiter, Balken beim Öffnen);
 * keine Einflüge ab Deckkraft 0 und kein Text-Farbverlauf (Feedback-Screenshots per
 * html2canvas müssen die Seite so zeigen, wie sie ist). Lädt nach maske.css.
 */

:root {
    --hd-kupfer: #c27a1a;
    --hd-kupfer-hell: #f0b44c;
    --hd-tiefe: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 18px -12px rgba(120, 72, 6, .25);
}
html.dark, [data-theme="dark"] {
    --hd-kupfer: #e3a93c;
    --hd-kupfer-hell: #ffd27a;
    --hd-tiefe: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px -14px rgba(0, 0, 0, .7);
}

/* Maske und Gehäuse nutzen die ganze Breite und einen knapperen Rand. */
.inhalt:has(> #artikelmaske:not([hidden])),
.inhalt:has(> #gehaeuse:not([hidden])) { max-width: none; padding: 12px 16px; }

/* ── Seitenraster: genau eine Bildschirmhöhe ──────────────────── */
.hd-maske.hd-seite {
    display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px;
    height: calc(100dvh - var(--kopf-hoehe) - 34px - 24px); min-height: 460px;
}
.hd-seite .hd-raster {
    grid-template-columns: minmax(230px, 270px) minmax(0, 1fr) minmax(280px, 330px);
    align-items: stretch; min-height: 0; gap: 8px;
}
.hd-seite .hd-docs, .hd-seite .hd-fakten { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.hd-seite .hd-buehne { display: flex; flex-direction: column; min-height: 0; box-shadow: var(--hd-tiefe); }
.hd-seite .hd-buehne-inhalt { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hd-seite .hd-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hd-seite .hd-pane > * { flex: 1; min-height: 0; }
.hd-seite .hd-pdf { min-height: 0; }
.hd-seite .hd-pdf-leiste { padding: 0 6px; min-height: 30px; }
.hd-seite .hd-pdf-leiste .hd-ik { width: 28px; height: 28px; }
.hd-seite .hd-pdf-flaeche { padding: 8px; }
.hd-seite .hd-pdf-flaeche { max-height: none; flex: 1; min-height: 0; }
.hd-seite .hd-pdf-blatt { margin: 0 auto; }
.hd-seite .hd-bild { align-items: center; min-height: 0; padding: 8px; }
.hd-seite .hd-bild img { max-height: 100%; }
.hd-seite .hd-3d { height: 100%; min-height: 0; }
.hd-seite .hd-3d .v3d { min-height: 0; }
.hd-seite .hd-vgl { flex: 1; min-height: 0; }
.hd-seite .hd-buehne-fuss { flex: none; padding: 6px 10px; }
.hd-pdf-einpassen[aria-pressed="true"] { background: var(--akzent-hell); color: var(--akzent-text); border-color: var(--akzent); }

/* Bühnenzeile: Dokument links, Aktionen rechts — ersetzt die frühere Aktionsleiste */
.hd-buehne-zeile {
    display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
    padding: 5px 8px; border-bottom: 1px solid var(--rand); background: var(--flaeche);
}
.hd-buehne-zeile .hd-buehne-kopf { flex: 1 1 0; padding: 0; border: 0; background: none; min-width: 0; flex-wrap: nowrap; gap: 8px; }
.hd-buehne-zeile .hd-buehne-titel { min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.hd-buehne-zeile .hd-buehne-titel > .hd-leise { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-buehne-zeile .hd-vergleich select { max-width: 190px; }
.hd-buehne-zeile .hd-akt-knoepfe { flex-wrap: nowrap; gap: 6px; }
.hd-buehne-zeile .hd-buehne-kopf:empty { display: none; }
.hd-buehne-titel { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.hd-buehne-zeile .hd-aktionsleiste {
    position: static; margin: 0; padding: 0; border: 0; box-shadow: none; background: none; flex: none; flex-wrap: nowrap;
}
.hd-buehne-zeile .hd-akt-ctx, .hd-buehne-zeile .hd-tasten { display: none; }
.hd-buehne-zeile .hd-gross { min-height: 32px; padding: 3px 12px; font-size: .86rem; }
.hd-buehne-zeile kbd { display: none; }
.hd-typ select {
    min-height: 30px; padding: 2px 26px 2px 10px; border: 1px solid var(--rand); border-radius: 8px;
    background: var(--grund); color: var(--text); font: 700 .9rem 'Montserrat', sans-serif; cursor: pointer;
}
.hd-typ select:hover, .hd-typ select:focus-visible { border-color: var(--akzent); }
.hd-abgelegt-als { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; color: var(--text-leise); }

/* ── Kopf: zweizeilig, zusammen etwa 88 px (D-14) ─────────────── */
.hd-seite .hd-kopfband, .hd-kompakt .hd-kopfband {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto auto;
    align-items: center; column-gap: 10px; row-gap: 6px; margin: 0; padding: 8px 10px; min-height: 0;
    background: var(--flaeche); box-shadow: var(--hd-tiefe);
}
.hd-kopf-bild { grid-row: 1 / 3; grid-column: 1; align-self: center; width: 44px; height: 44px; border-radius: 10px; cursor: zoom-in; flex: none; }
.hd-kopf-bild-leer { cursor: default; }
.hd-kopf-bild-rahmen {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
    border-radius: 10px; background: #fff; overflow: hidden; color: #94a3b8; border: 1px solid rgba(15, 23, 42, .08);
}
.hd-kopf-bild-leer .hd-kopf-bild-rahmen { background: var(--grund); border: 1px dashed var(--rand); }
.hd-kopf-bild-rahmen img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.hd-kopf-bild:hover .hd-kopf-bild-rahmen { border-color: var(--akzent); }
.hd-kopf-zeile1 { grid-column: 2; grid-row: 1; display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.hd-kopf-zeile1 .hd-titel { margin: 0; font-size: 1.3rem; line-height: 1.15; white-space: nowrap; flex: none; }
.hd-kopf-zeile1 .hd-bez { margin: 0; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hd-kopf-zeile2 { grid-column: 2 / 4; grid-row: 2; display: flex; align-items: center; gap: 5px; min-width: 0; }
/* Zeile 2 (AP-9): Hersteller und Herstellernummer haben Vorrang — bis etwa 20 Zeichen ungekürzt bei 608 px Kopfbreite.
   Der Familie-Chip gibt zuerst nach (bis auf sein Symbol), die Stationen tragen keinen Rahmen mehr. */
.hd-kopf-meta { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.hd-kopf-meta > * { flex: none; }
.hd-kopf-meta .hd-herst-name, .hd-kopf-meta .hd-mpn, .hd-kopf-meta .hd-chip { flex: 0 1 auto; min-width: 3.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-kopf-meta .hd-herst-name, .hd-kopf-meta .hd-mpn { max-width: 24ch; }
.hd-kopf-meta .hd-chip { display: inline-block; max-width: 9em; }
/* Schrumpf-Gewicht 1e5: Hersteller und MPN geben erst nach, wenn der Chip nur noch sein Symbol zeigt (sonst fehlen
   Bruchteile eines Pixels und Chrome setzt „…“). */
.hd-kopf-meta .hd-chip-knopf { flex: 0 100000 auto; min-width: 27px; padding: 1px 7px; font-size: .74rem; }
.hd-kopf-meta .hd-chip-knopf svg { vertical-align: -2px; }
.hd-kopf-status { display: inline-flex; }
.hd-kopf-status:empty { display: none; }
.hd-kopf-status .hd-marke { padding: 1px 7px; font-size: .72rem; }
.hd-kopf-rechts { display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.hd-kopf-aktionen { display: inline-flex; align-items: center; gap: 2px; }
.hd-kopf-aktionen .hd-klein-knopf { padding: 3px 8px; font-size: .76rem; min-height: 26px; white-space: nowrap; }
.hd-kopf-neu { width: 24px; height: 26px; }
.hd-kopf-rechts .hd-stationen { gap: 2px; }
.hd-kopf-rechts .hd-station { min-width: 20px; height: 24px; padding: 0 1px; border: 0; border-radius: 6px; background: transparent; }
.hd-kopf-rechts .hd-st-nein { border: 0; }
.hd-kopf-rechts .hd-st-bild img { max-height: 16px; }
.hd-kopf-rechts .hd-station[data-station="timeline"] .hd-st-bild img { max-height: 13px; padding: 0 1px; }
.hd-kopf-rechts .hd-st-marke { top: -3px; right: -4px; width: 12px; height: 12px; border-width: 1.5px; }
.hd-kopf-rechts .hd-st-marke svg { width: 7px; height: 7px; }
.hd-kopf-rechts .hd-st-fehler { box-shadow: inset 0 -2px 0 #ef4444; }
/* Schmaler Kopf: „Abschließen“ nur als Symbol (Name bleibt in aria-label und title) */
.hd-kopfblock { container-type: inline-size; }
@container (max-width: 760px) {
    .hd-kopf-aktionen .hd-klein-knopf { width: 28px; padding: 0; justify-content: center; }
    .hd-kopf-aktionen .hd-knopf-text { display: none; }
    .hd-kopf-status .hd-marke svg { display: none; }
}
.hd-herst-name { font: 700 .78rem 'Open Sans', sans-serif; color: var(--text-leise); letter-spacing: 0; }
.hd-mpn { padding: 0 4px; border-radius: 6px; border: 1px solid var(--rand); background: var(--grund); color: var(--text); font-size: .74rem; }
.hd-kopf-ring { grid-column: 3; grid-row: 1; position: relative; display: flex; align-items: center; justify-self: end; border-radius: 50%; cursor: help; }
.hd-kopf-ring:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.hd-maske .hd-kopf-ring .hd-ring { width: 40px; height: 40px; }
.hd-kopf-ring .hd-ring-text { display: none; }
.hd-ring-zahl { font: 800 28px 'Montserrat', sans-serif; fill: var(--text); }
.hd-ring-von { font-size: 15px; fill: var(--text-leise); font-weight: 700; }
.hd-ring-text { font: 600 7.5px 'Open Sans', sans-serif; fill: var(--text-leise); }

/* Ring-Tooltip (D-5): sofort bei Hover und Fokus, Esc schließt, Lage per Skript im Fenster */
.hd-ring-tip {
    position: fixed; z-index: 400; left: 0; top: 0; width: 290px; max-width: calc(100vw - 16px); box-sizing: border-box;
    padding: 10px 12px; border: 1px solid var(--rand); border-radius: 10px; background: var(--grund); color: var(--text);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .28); font-size: .82rem; line-height: 1.35; text-align: left; cursor: default;
    visibility: hidden; pointer-events: none;
}
.hd-kopf-ring:hover:not(.hd-tip-zu) .hd-ring-tip, .hd-kopf-ring:focus-visible:not(.hd-tip-zu) .hd-ring-tip { visibility: visible; }
.hd-tip-titel { margin: 0 0 4px; font-weight: 600; color: var(--akzent-text); }
.hd-ring-tip ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 3px; }
.hd-ring-tip ul:last-child { margin-bottom: 0; }
.hd-ring-tip li { display: flex; align-items: center; gap: 6px; }
.hd-tip-fehlt li { color: var(--hd-fehl); }
.hd-tip-segmente li span { flex: 1 1 auto; }
.hd-tip-segmente li em { font-style: normal; font-size: .74rem; color: var(--text-leise); }
.hd-tip-ok { color: var(--hd-gut); }
.hd-tip-offen { color: var(--hd-warn); }
li.hd-tip-fehlt { color: var(--text-leise); }
.hd-tip-segmente li span { color: var(--text); }
.hd-seg { fill: none; stroke-width: 9; stroke-linecap: round; }
.hd-seg-ok    { stroke: #22c55e; }
.hd-seg-offen { stroke: #eab308; }
.hd-seg-fehlt { stroke: var(--rand); }

/* Ablage: drei kleine Original-Symbole */
.hd-stationen { display: flex; gap: 6px; align-items: center; }
.hd-station {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 34px; padding: 0 6px; border-radius: 9px; background: var(--grund);
    border: 1px solid var(--rand); text-decoration: none; color: inherit; font: inherit; cursor: default;
    transition: border-color .15s, box-shadow .15s;
}
a.hd-station, button.hd-station { cursor: pointer; }
a.hd-station:hover, button.hd-station:hover, a.hd-station:focus-visible, button.hd-station:focus-visible { border-color: var(--akzent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--akzent) 25%, transparent); }
.hd-st-bild { display: inline-flex; align-items: center; }
.hd-st-bild img { display: block; max-height: 22px; width: auto; }
.hd-station[data-station="timeline"] .hd-st-bild img { background: #fff; border-radius: 4px; padding: 1px 2px; max-height: 20px; }
.hd-st-marke {
    position: absolute; top: -5px; right: -5px; display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%; color: #fff; border: 2px solid var(--flaeche);
}
.hd-st-marke svg { width: 9px; height: 9px; }
.hd-st-ja .hd-st-marke     { background: #16a34a; }
.hd-st-wartet .hd-st-marke { background: #d97706; }
.hd-st-fehler { border-color: #ef4444; }
.hd-st-fehler .hd-st-marke { background: #dc2626; }
.hd-st-nein { border-style: dashed; }
.hd-st-nein .hd-st-bild, .hd-st-wartet .hd-st-bild { filter: grayscale(1); opacity: .45; }
.hd-st-nein .hd-st-marke { background: #94a3b8; }

/* ── Dokumentzeilen ──────────────────────────────────────────── */
:is(.hd-seite, .hd-kompakt) .hd-zonentitel { margin: 0 0 6px; font-size: .95rem; }
:is(.hd-seite, .hd-kompakt) .hd-karten { gap: 6px; }
:is(.hd-seite, .hd-kompakt) .hd-karte {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 6px;
    padding: 6px 8px 6px 6px; box-shadow: none; position: relative; overflow: hidden;
    transition: border-color .15s, background .15s;
}
:is(.hd-seite, .hd-kompakt) .hd-karte::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--akzent);
    transform: scaleY(0); transition: transform .2s ease;
}
:is(.hd-seite, .hd-kompakt) .hd-karte:hover { border-color: color-mix(in srgb, var(--akzent) 45%, var(--rand)); }
:is(.hd-seite, .hd-kompakt) .hd-karte.hd-gewaehlt { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent-hell) 70%, var(--grund)); }
:is(.hd-seite, .hd-kompakt) .hd-karte.hd-gewaehlt::before { transform: scaleY(1); }
:is(.hd-seite, .hd-kompakt) .hd-karte-wahl { align-items: center; gap: 9px; min-width: 0; }
:is(.hd-seite, .hd-kompakt) .hd-mini { width: 34px; height: 42px; border-radius: 5px; background: #fff; }
:is(.hd-seite, .hd-kompakt) .hd-karte-text { gap: 3px; }
:is(.hd-seite, .hd-kompakt) .hd-karte-art { font-size: .88rem; line-height: 1.2; }
.hd-karte-zeile { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hd-marke-mini { padding: 0 7px; font-size: .68rem; }
.hd-karte-rechts { display: flex; align-items: center; gap: 4px; }
:is(.hd-seite, .hd-kompakt) .hd-tw { padding: 2px 6px; gap: 5px; border-radius: 7px; }
:is(.hd-seite, .hd-kompakt) .hd-tw-balken { width: 32px; height: 6px; }
:is(.hd-seite, .hd-kompakt) .hd-tw-zahl { font-size: .78rem; }
.hd-quelle { display: inline-flex; padding: 4px; border-radius: 6px; color: var(--text-leise); }
.hd-quelle:hover { color: var(--akzent-text); background: var(--flaeche); }
:is(.hd-seite, .hd-kompakt) .hd-tw-erkl, :is(.hd-seite, .hd-kompakt) .hd-karte > .hd-hinweis { grid-column: 1 / -1; margin-top: 2px; font-size: .8rem; }
.hd-ab { display: inline-flex; align-items: center; gap: 3px; }
.hd-ab-i { display: inline-flex; align-items: center; justify-content: center; height: 18px; min-width: 18px; padding: 0 1px; border-radius: 4px; }
.hd-ab-i img { display: block; }
.hd-ab-breit img { background: #fff; border-radius: 2px; }
.hd-ab-nein img, .hd-ab-wartet img { filter: grayscale(1); opacity: .35; }
.hd-ab-fehler { box-shadow: 0 0 0 1.5px #ef4444; }
.hd-ab-wartet { box-shadow: 0 0 0 1.5px #d97706; }

/* ── Reiter (FB-2026-012): ruhig, Auswahl an der Unterkante ──── */
:is(.hd-seite, .hd-kompakt) .hd-fakten { gap: 0; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--grund); box-shadow: var(--hd-tiefe); }
.hd-reiter {
    display: flex; gap: 2px; padding: 4px 4px 0; background: var(--flaeche);
    border-bottom: 1px solid var(--rand); border-radius: var(--radius) var(--radius) 0 0;
}
.hd-reiter-knopf {
    display: inline-flex; align-items: center; gap: 5px; justify-content: center; flex: 0 0 auto;
    min-height: 34px; padding: 4px 10px 6px; border: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0;
    background: none; color: var(--text-leise); font: 600 .78rem 'Open Sans', sans-serif; cursor: pointer; white-space: nowrap;
    transition: color .15s, background .15s, border-color .15s;
}
.hd-reiter-knopf:hover { color: var(--text); background: color-mix(in srgb, var(--akzent) 8%, transparent); }
.hd-reiter-knopf[aria-selected="true"] { flex: 1 1 auto; color: var(--akzent-text); border-bottom-color: var(--akzent); background: var(--grund); }
.hd-reiter-knopf:not([aria-selected="true"]) .hd-reiter-text { display: none; }
.hd-reiter-zahl {
    min-width: 17px; padding: 0 5px; border-radius: 999px; background: var(--akzent); color: #fff;
    font: 700 .64rem 'Open Sans', sans-serif; line-height: 16px; text-align: center;
}
.hd-reiter-feld { padding: 10px 12px 12px; font-size: .86rem; }

/* Einkauf als Diagramme */
.hd-dg-raster { display: grid; gap: 8px; }
/* Einkauf wird nachgeladen (Plan Detailansicht AP-9): Platzhalter in Diagrammhöhe, die Maske blockiert nicht */
.hd-dg-laedt { display: grid; gap: 6px; }
.hd-dg-laedt .hd-dg-skel { display: block; min-height: 150px; border-radius: 10px; }
.hd-dg-karte { margin: 0; padding: 8px 10px 6px; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); color: var(--akzent-text); }
.hd-dg-karte figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; color: var(--text); }
.hd-dg-titel { font: 700 .82rem 'Montserrat', sans-serif; }
.hd-dg-kenn { font: 700 .82rem 'Open Sans', sans-serif; }
.hd-dg-kenn .hd-leise { font-weight: 400; }
.hd-dg-einzel { margin: 4px 0 2px; color: var(--text); }
.hd-dg-trend { font: 700 .72rem 'Open Sans', sans-serif; padding: 1px 8px; border-radius: 999px; background: var(--grund); border: 1px solid var(--rand); color: var(--text-leise); }
.hd-trend-hoch { color: var(--hd-fehl); border-color: currentColor; }
.hd-trend-runter { color: var(--hd-gut); border-color: currentColor; }
.hd-dg { display: block; width: 100%; height: auto; max-height: 170px; overflow: visible; }
.hd-dg-null { stroke: var(--rand); stroke-width: 1; }
.hd-saeule rect { fill: var(--akzent); transform-box: fill-box; transform-origin: bottom; animation: hd-wachsen .45s calc(var(--i, 0) * 60ms) ease-out backwards; }
.hd-sb-bestellt rect { fill: var(--akzent); }
.hd-sb-verbraucht rect { fill: var(--hd-kupfer-hell); }
.hd-dg-wert { font: 700 9px 'Open Sans', sans-serif; fill: var(--text); stroke: var(--flaeche); stroke-width: 3px; paint-order: stroke; stroke-linejoin: round; }
.hd-dg-achse { font: 600 9.5px 'Open Sans', sans-serif; fill: var(--text-leise); }
.hd-dg-linie { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hd-dg-flaeche { fill: url(#hd-dg-verlauf); }
.hd-dg-punkt circle { fill: var(--grund); stroke: currentColor; stroke-width: 2; }
.hd-dg-hinweis { margin: 2px 0 0; font-size: .7rem; color: var(--text-leise); }
.hd-lz { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 10px; font-size: .82rem; }
.hd-lz-label { color: var(--text-leise); font-weight: 600; }
.hd-lz-bahn { position: relative; height: 8px; border-radius: 4px; background: var(--rand); }
.hd-lz-spanne { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: color-mix(in srgb, var(--akzent) 35%, transparent); }
.hd-lz-median { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--akzent); }
.hd-dg-stand { margin: 8px 0 0; }

/* Die Balken wachsen beim Öffnen des Reiters (Antwort auf die Handlung) und stehen danach. */
@keyframes hd-wachsen { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
    .hd-maske *, .hd-maske *::before, .hd-maske *::after { animation: none !important; transition: none !important; }
}

/* Vorschau-Panel (Kompaktmodus): dieselbe Maske wie die Seite (hd-kompakt hd-seite), aber in der Panelhöhe
 * statt der Fensterhöhe — so sieht die Vorschau aus Prüfmatrix, Liste und Korb aus wie die Artikelmaske
 * (AL 13.10.2026). Unter 1101 px stapelt sie wie die Seite und scrollt im Panel. */
@media (min-width: 1101px) {
    .hd-vorschau-inhalt:has(.hd-maske) { overflow: hidden; padding: 10px 12px 12px; }
    .hd-vorschau .hd-maske.hd-seite { height: 100%; min-height: 0; }
}
.hd-kompakt .hd-kopf-zeile2 { flex-wrap: wrap; }
.hd-kompakt .hd-raster { gap: 10px; margin-top: 10px; }

/* ── Kleinere Fenster ────────────────────────────────────────── */
@media (max-width: 1280px) {
    .hd-seite .hd-raster { grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(250px, 300px); }
}
@media (max-width: 1100px) {
    .hd-maske.hd-seite { height: auto; min-height: 0; display: block; }
    .hd-kopf-zeile1, .hd-kopf-zeile2 { flex-wrap: wrap; }
    .hd-kopf-meta { flex-wrap: wrap; overflow: visible; }
    .hd-seite .hd-raster { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); margin-top: 10px; }
    .hd-seite .hd-fakten { grid-column: 1 / -1; }
    .hd-seite .hd-buehne { min-height: 70vh; }
    /* Altbefund (Plan Detailansicht §6), bei der Gate-1-Probe 390 px sichtbar: Hinweis und Knöpfe der Bühnenzeile
       lagen über „Nicht vergleichen“ — unter 1100 px umbrechen statt überlagern (AP-9). */
    .hd-buehne-zeile { flex-wrap: wrap; }
    .hd-buehne-zeile .hd-buehne-kopf { flex: 1 1 100%; flex-wrap: wrap; }
    .hd-buehne-zeile .hd-aktionsleiste, .hd-buehne-zeile .hd-akt-knoepfe { flex: 1 1 100%; flex-wrap: wrap; }
}
@media (max-width: 760px) {
    .hd-seite .hd-raster { grid-template-columns: minmax(0, 1fr); }
}

/* FB-2026-021: Einkauf ohne Scrollen — Kennzeile über der Jahresreihe */
.hd-ek-zeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 8px; font-size: .82rem; color: var(--text); }
.hd-ek-teil { min-width: 0; }
.hd-ek-label { white-space: nowrap; }
.hd-ek-label { color: var(--text-leise); font-weight: 600; }
.hd-ek-trenner { color: var(--text-leise); }
.hd-dg-preis .hd-dg-einzel { margin: 2px 0 0; }
button.hd-quelle { border: 0; background: none; cursor: pointer; font: inherit; }

/* ── Vorschau groß (AL 13.10.2026, Vorbild Dok-Register v0.7.6) ───────────────
 * Die Bühne läuft rechts über die volle Höhe; Kopf, Dokumente und Reiter stehen
 * links daneben. Die PDF-Leiste schwebt senkrecht in der freien Fläche neben dem
 * Blatt und kostet keine Höhe; die Fußzeile entfällt auf der Maske. „Ganze Seite“
 * füllt damit die volle Höhe der Bühne. Nur Desktop — darunter bleibt alles wie es war. */
@media (min-width: 1101px) {
    .hd-maske.hd-seite {
        grid-template-columns: minmax(230px, 270px) minmax(280px, 330px) minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas: "kopf kopf buehne" "docs fakten buehne";
        column-gap: 8px;
        height: calc(100dvh - var(--kopf-hoehe) - 24px);
    }
    .hd-seite .hd-raster { display: contents; }
    .hd-seite .hd-kopfblock { grid-area: kopf; }
    .hd-seite .hd-docs { grid-area: docs; }
    .hd-seite .hd-fakten { grid-area: fakten; }
    .hd-seite .hd-buehne { grid-area: buehne; }
    body:has(#artikelmaske:not([hidden])) .fuss { display: none; }

    .hd-seite .hd-pdf { position: relative; }
    .hd-seite .hd-pdf-leiste {
        position: absolute; top: 10px; left: 10px; z-index: 3;
        flex-direction: column; align-items: stretch; gap: 4px; padding: 6px;
        width: 114px; box-sizing: border-box; border: 1px solid var(--rand); border-radius: 10px;
        background: var(--flaeche); box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
    }
    .hd-seite .hd-pdf-leiste .hd-ik { width: 100%; }
    .hd-seite .hd-pdf-seite { padding: 2px 0; text-align: center; font-size: .76rem; }
    .hd-seite .hd-pdf-trenner { width: auto; height: 1px; margin: 2px 0; }
    .hd-seite .hd-pdf-treffer { margin: 0; flex-direction: column; align-items: stretch; }
    .hd-seite .hd-pdf-th { text-align: center; font-size: .7rem; line-height: 1.2; overflow-wrap: anywhere; }
    .hd-seite .hd-pdf-treffer .hd-seitenknopf { min-width: 0; width: 100%; box-sizing: border-box; }
    .hd-seite .hd-pdf-flaeche { padding: 8px 8px 8px 134px; background: var(--grund); }
    .hd-seite .hd-buehne-zeile .hd-typ { flex: none; }
    .hd-seite .hd-buehne-zeile .hd-typ select { min-width: 150px; }
    .hd-seite .hd-buehne-zeile .hd-vergleich { min-width: 0; }
    .hd-seite .hd-buehne-zeile .hd-vergleich select { min-width: 0; width: 100%; }
}


/* ── Detailansicht 0.2 (AP-2): Reiter einklappbar, Einkauf-Legende, Belegung ─────────── */
.hd-reiter-knopf[hidden] { display: none; }
.hd-reiter-klapp {
    order: 2; margin-left: auto; flex: 0 0 auto; align-self: center; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; margin-bottom: 3px; border: 0; border-radius: 8px; background: none; color: var(--text-leise); cursor: pointer;
}
.hd-reiter-klapp:hover { color: var(--text); background: color-mix(in srgb, var(--akzent) 10%, transparent); }
.hd-reiter-klapp:focus-visible, .hd-reiter-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.hd-reiter-felder { min-height: 0; }

/* eingeklappt: nur die Symbolleiste */
.hd-fakten-zu .hd-reiter-felder { display: none; }
.hd-fakten-zu .hd-reiter-text, .hd-fakten-zu .hd-reiter-zahl { display: none; }
.hd-fakten-zu .hd-reiter { border-bottom: 0; border-radius: var(--radius); }
.hd-fakten-zu .hd-reiter-knopf { flex: 0 0 auto; }
.hd-fakten-zu .hd-reiter-knopf[aria-selected="true"] { flex: 0 0 auto; }
@media (min-width: 1101px) {
    .hd-maske.hd-seite.hd-reiter-eingeklappt { grid-template-columns: minmax(230px, 554px) 46px minmax(0, 1fr); }
    .hd-seite .hd-fakten-zu { overflow: hidden; }
    .hd-seite .hd-fakten-zu .hd-reiter { flex-direction: column; align-items: center; height: 100%; padding: 6px 0; gap: 4px; }
    .hd-seite .hd-fakten-zu .hd-reiter-klapp { order: -1; margin: 0 0 4px; }
    .hd-seite .hd-fakten-zu .hd-reiter-knopf { width: 36px; padding: 6px 0; min-height: 36px; border-radius: 8px; border-bottom-width: 0; border-left: 3px solid transparent; }
    .hd-seite .hd-fakten-zu .hd-reiter-knopf[aria-selected="true"] { border-left-color: var(--akzent); }
}

/* Einkauf: Legende statt Textzeilen */
.hd-dg-zusatz { font-weight: 400; font-size: .72rem; }
.hd-dg-legende { display: inline-flex; gap: 10px; font: 600 .7rem 'Open Sans', sans-serif; color: var(--text-leise); }
.hd-leg { display: inline-flex; align-items: center; gap: 4px; }
.hd-leg::before { content: ''; width: 9px; height: 9px; border-radius: 2px; background: var(--akzent); }
.hd-leg-verbraucht::before { background: var(--hd-kupfer-hell); }

/* Belegung */
.bl-karte { margin: 0; padding: 8px; border: 1px solid var(--rand); border-radius: 10px; background: #fff; text-align: center; }
.bl-vorschlag { border-style: dashed; border-color: var(--hd-warn); }
.bl-bild { display: block; width: 100%; height: auto; max-height: 56vh; margin: 0 auto; object-fit: contain; }
.bl-warn { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--hd-warn-bg); color: var(--hd-warn); font-size: .84rem; }
.bl-warn svg { flex: none; margin-top: 2px; }
/* Belegung ohne Board-Zugang (AP-9): ruhiger Hinweis, kein Fehler */
.bl-hinweis { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--grund); border: 1px solid var(--rand); color: var(--text-leise); font-size: .84rem; }
.bl-hinweis svg { flex: none; margin-top: 2px; }
.bl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0 4px; font-size: .84rem; }
.bl-aktion { margin: 8px 0 0; }
.bl-aktion a.hd-knopf { text-decoration: none; display: inline-flex; align-items: center; }
