/* ============================================================================
   App-Layout-Utilities + Design-Tokens (Fluent-v5-Standard-Dark).

   Die App-eigenen Layout-Klassen (.hh-shell/.hh-appbar/.hh-nav/.hh-page-simple,
   Cards, Detail-Header sowie die verbliebenen scoped .razor.css) referenzieren
   weiterhin die App-Token-Namen (--color-*, --space-*, --radius*, …). Die
   FARB-Token sind hier zentral auf Fluents Standard-Design-Token
   (--colorNeutral* / --colorBrand*) gemappt: die App-Shell folgt damit demselben
   Farbschema wie die Fluent-Web-Components, ohne eine eigene Palette zu pflegen.
   Fluent appliziert diese Token beim Start global (via IThemeService, Dark).
   Struktur-Tokens (Abstände, Radien, Schriftgrößen, Dauern, AppBar-/Drawer-Maße)
   behalten ihre ursprünglichen, look-neutralen Werte. MudBlazor/Nocturne sind
   vollständig entfernt – alle Referenzen nutzen direkt die --color-*-Namen.
   ============================================================================ */
:root {
    /* Fluent-v5-Standard-Dark: schaltet UA-Canvas/Scrollbars sofort dunkel
       (vor dem ersten Render, ohne eigene Farb-Literale). Die Fluent-Token
       selbst werden per IThemeService beim Start global appliziert. */
    color-scheme: dark;

    /* ── Akzent-/Statusfarben ─────────────────────────────────────────
       Primär/Info an Fluents Marken-Token gekoppelt; Status-/Soft-Farben
       bleiben semantische Werte (keine Hell/Dunkel-Abweichung; Feintuning
       ggf. pro Screen). ─────────────────────────────────────────────── */
    --color-primary:         var(--colorBrandForeground1);
    --color-primary-hover:   var(--colorBrandForeground2);
    --color-primary-lighten: #2886de;
    --color-primary-soft:    rgba(15, 108, 189, 0.10);
    --color-danger:          #c50f1f;
    --color-danger-soft:     rgba(197, 15, 31, 0.10);
    --color-success:         #0e700e;
    --color-success-soft:    rgba(14, 112, 14, 0.10);
    --color-warning:         #bc4b09;
    --color-warning-soft:    rgba(188, 75, 9, 0.10);
    --color-info:            var(--colorBrandForeground1);
    --color-info-soft:       rgba(15, 108, 189, 0.10);

    /* ── Status als Vorder-/Flächenfarbe auf DUNKLEN Flächen ──────────
       Die Werte darüber sind gesättigte Vollton-Farben: als Rahmen oder
       Fokus-Glow auf hellen Feldern richtig, als Text-/Icon-Farbe auf
       --color-surface-1/2 aber unbrauchbar (#c50f1f auf #262626 sind rund
       1,7:1 – die Marke liegt bei 3:1 für Icons, 4,5:1 für Text). Diese
       Token sind die aufgehellten Gegenstücke samt dezenter Tönung für
       Icon-Flächen; beide bleiben auch auf der Hover-Fläche über 3:1.
       --color-info braucht kein Gegenstück: es hängt an Fluents
       Brand-Token, das für Dark bereits aufgehellt ist. ──────────────── */
    --color-danger-fg:       #f1707b;
    --color-danger-tint:     rgba(241, 112, 123, 0.16);
    --color-warning-fg:      #f0a30a;
    --color-warning-tint:    rgba(240, 163, 10, 0.16);
    --color-info-fg:         var(--color-info);
    --color-info-tint:       rgba(71, 158, 245, 0.16);

    /* Fluent-Neutral-Token mit Dunkel-Fallback: Fluent exponiert die Neutral-
       Palette NICHT zuverlässig global (nur die Brand-Farbe kommt am :root an).
       Ohne Fallback wären Flächen/Border „invalid" → transparent bzw. none.
       Fluent gewinnt, wenn das Token vorhanden ist; sonst greift der Literal. */
    /* ── Flächen (Fluent-Neutral-Backgrounds) ─────────────────────────── */
    --color-surface-0: var(--colorNeutralBackground2, #1b1b1b); /* Seiten-/AppBar-Hintergrund */
    --color-surface-1: var(--colorNeutralBackground1, #262626); /* Karten, Drawer */
    --color-surface-2: var(--colorNeutralBackground1Hover, #303030); /* Hover, erhöhte Flächen */
    --color-surface-3: var(--colorNeutralBackground1Pressed, #3a3a3a); /* stärkere Hover-States */

    /* ── Border (Fluent-Neutral-Strokes) ──────────────────────────────── */
    --color-border:        var(--colorNeutralStroke2, #383838);
    --color-border-strong: var(--colorNeutralStroke1, #5a5a5a);

    /* ── Text (Fluent-Neutral-Foregrounds) ────────────────────────────── */
    --color-text:           var(--colorNeutralForeground1, #ffffff);
    --color-text-secondary: var(--colorNeutralForeground2, #d6d6d6);
    --color-text-muted:     var(--colorNeutralForeground3, #a0a0a0);
    --color-text-disabled:  var(--colorNeutralForegroundDisabled, #6a6a6a);

    /* ── Typografie (Fluent-Schriftstack; Größen wie zuvor) ───────────── */
    --font-sans:      'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    --font-mono:      'Cascadia Code', 'Fira Code', ui-monospace, monospace;
    --font-size-xs:   0.75rem;
    --font-size-sm:   0.8125rem;
    --font-size-base: 0.9375rem;
    --font-size-lg:   1.0625rem;
    --font-size-xl:   1.375rem;

    /* ── Spacing (unverändert) ────────────────────────────────────────── */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* ── Radien (unverändert) ─────────────────────────────────────────── */
    --radius-sm:   6px;
    --radius:      10px;
    --radius-lg:   16px;
    --radius-full: 9999px;

    /* ── Schatten (für helle Flächen abgeschwächt) ────────────────────── */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow:    0 2px 8px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.14);

    /* ── Layout (unverändert) ─────────────────────────────────────────── */
    --hh-appbar-height: 56px;
    /* 264px statt der früheren 240px: die Sektionsköpfe der Navigation tragen
       seit dem Sidebar-Umbau einen erklärenden Untertitel (AppNavMenu), der bei
       240px durchgängig zweizeilig umbrach. */
    --hh-drawer-width: 264px;

    /* ── Transitions (unverändert) ────────────────────────────────────── */
    --duration-fast: 100ms;
    --duration-base: 150ms;
    --duration-slow: 250ms;
    --ease-default:  cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Abgeleitete Zustandsfarben ───────────────────────────────────── */
    --color-on-primary:  var(--colorNeutralForegroundOnBrand, #ffffff); /* Text/Icon auf Primärfläche */
    --color-disabled-bg: var(--colorNeutralBackgroundDisabled, rgba(255, 255, 255, 0.06)); /* deaktivierte Flächen */
}

/* ============================================================================
   App-Layout-Utilities (Schicht 2, selbst gebaute Klassen).
   ============================================================================ */

/* ── HHCard ─────────────────────────────────────────────────────────────── */
.hh-card {
    background: var(--color-surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--duration-base) var(--ease-default),
                transform var(--duration-base) var(--ease-default),
                box-shadow var(--duration-base) var(--ease-default);
}

/* ── HHEmptyState ───────────────────────────────────────────────────────── */
.hh-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-8) var(--space-6);
    gap: var(--space-2);
}

.hh-empty__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    margin-bottom: var(--space-2);
}

.hh-empty__icon { font-size: 30px; color: var(--color-text-muted); }
.hh-empty__title { font-size: var(--font-size-lg); font-weight: 600; color: var(--color-text); }
.hh-empty__desc { color: var(--color-text-secondary); font-size: var(--font-size-sm); max-width: 40ch; line-height: 1.6; }

/* ── HHPageSimple (globaler Seiten-Rahmen) ──────────────────────────────────
   Bewusst GLOBAL statt als scoped .razor.css im SharedUi-Projekt: SharedUis
   scoped CSS (.rz.scp.css) kommt am gerenderten Markup nicht zuverlässig an,
   wodurch die flachen Seiten ohne Header-Struktur/Padding rendern. Über die
   Klassennamen greifen die Regeln hier global und zuverlässig.
   Header ist sticky/fix, der Content-Bereich scrollt. ───────────────────────── */
.hh-page-simple {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--color-surface-0);
}

.hh-page-simple__breadcrumb {
    flex-shrink: 0;
    width: 100%;
    padding: 0 var(--space-6);
}

.hh-page-simple__breadcrumb .hh-breadcrumbs {
    padding: var(--space-2) 0;
}

.hh-page-simple__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-surface-0);
    min-height: 60px;
}

.hh-page-simple__title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hh-page-simple__title {
    font-size: var(--font-size-lg);
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hh-page-simple__subtitle {
    font-size: var(--font-size-sm);
    line-height: 1.35;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hh-page-simple__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.hh-page-simple__content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: var(--space-6);
}

@media (max-width: 599px) {
    .hh-page-simple__header {
        flex-wrap: wrap;
        padding: var(--space-3) var(--space-4);
    }

    .hh-page-simple__actions {
        margin-left: auto;
    }

    .hh-page-simple__title,
    .hh-page-simple__subtitle {
        white-space: normal;
    }

    .hh-page-simple__content {
        padding: var(--space-4);
    }
}
.hh-empty__action { margin-top: var(--space-4); }

/* ── Formularfelder (HHSearchField + geteilte Feld-Struktur) ────────────── */
.hh-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.hh-field__wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.hh-field__icon-start {
    position: absolute;
    left: var(--space-3);
    font-size: 16px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.hh-field__input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px var(--space-3);
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--duration-base) var(--ease-default),
                box-shadow var(--duration-base) var(--ease-default),
                background var(--duration-base) var(--ease-default);
}

.hh-field__wrap:has(.hh-field__icon-start) .hh-field__input {
    padding-left: calc(var(--space-3) + 24px);
}

.hh-field__input::placeholder { color: var(--color-text-muted); }

.hh-field__input:hover { border-color: var(--color-border-strong); }

.hh-field__input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.hh-field__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hh-field--error .hh-field__input {
    border-color: var(--color-danger);
}

.hh-field--error .hh-field__input:focus {
    box-shadow: 0 0 0 3px var(--color-danger-soft);
}

/* ── HHValidationMessage ────────────────────────────────────────────────── */
.hh-validation {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hh-validation__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    color: var(--color-danger);
}

.hh-validation__item i { font-size: 14px; flex-shrink: 0; }

/* ── HHText (Typografie) ────────────────────────────────────────────────── */
.hh-text {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
}

.hh-text--h1 { font-size: 2.25rem;  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.hh-text--h2 { font-size: 1.875rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.hh-text--h3 { font-size: 1.5rem;   font-weight: 600; line-height: 1.3; }
.hh-text--h4 { font-size: 1.25rem;  font-weight: 600; line-height: 1.35; }
.hh-text--h5 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
.hh-text--h6 { font-size: var(--font-size-lg); font-weight: 600; line-height: 1.4; }

.hh-text--subtitle1 { font-size: var(--font-size-base); font-weight: 500; line-height: 1.5; }
.hh-text--subtitle2 { font-size: var(--font-size-sm);   font-weight: 600; line-height: 1.5; }

.hh-text--body1 { font-size: var(--font-size-base); line-height: 1.6; }
.hh-text--body2 { font-size: var(--font-size-sm);   line-height: 1.5; }

.hh-text--caption {
    font-size: var(--font-size-xs);
    line-height: 1.5;
    color: var(--color-text-secondary);
}

/* body1, body2 und caption rendern als inline-span – erzwingt eine eigene Zeile */
.hh-text--block { display: block; }

.hh-text--align-left   { text-align: left; }
.hh-text--align-center { text-align: center; }
.hh-text--align-right  { text-align: right; }

.hh-text--secondary { color: var(--color-text-secondary); }
.hh-text--muted     { color: var(--color-text-muted); }
.hh-text--primary   { color: var(--color-primary); }
.hh-text--danger    { color: var(--color-danger); }

/* ── HHSearchField ──────────────────────────────────────────────────────── */
.hh-search__input {
    padding-right: calc(var(--space-3) + 24px);
}

/* Browser-eigenes Clear-X des type="search" ausblenden – wir rendern ein eigenes */
.hh-search__input::-webkit-search-cancel-button { display: none; }

.hh-search__clear {
    position: absolute;
    right: var(--space-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: color var(--duration-base) var(--ease-default),
                background var(--duration-base) var(--ease-default);
}

.hh-search__clear:hover {
    color: var(--color-text);
    background: var(--color-surface-3);
}

/* Toolbar über DataGrids: Titel links, Quick-Search rechts */
.hh-grid-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

/* Quick-Search in DataGrid-Toolbars: nicht die gesamte Restbreite einnehmen */
.hh-grid-search {
    max-width: 320px;
}

/* ── Layout-Utilities (Stack/Grid/Spacer) ──────────────────────────────── */
.hh-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.hh-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
}

.hh-row--wrap { flex-wrap: wrap; }
.hh-row--start { align-items: flex-start; }
.hh-row--end { justify-content: flex-end; }

.hh-stack--gap-1, .hh-row--gap-1 { gap: var(--space-1); }
.hh-stack--gap-2, .hh-row--gap-2 { gap: var(--space-2); }
.hh-stack--gap-3, .hh-row--gap-3 { gap: var(--space-3); }
.hh-stack--gap-4, .hh-row--gap-4 { gap: var(--space-4); }
.hh-stack--gap-6, .hh-row--gap-6 { gap: var(--space-6); }

.hh-spacer { flex: 1 1 auto; }
/* Füllt die Restbreite in einer .hh-row. min-width:0 ist dabei tragend, sonst
   verhindert die Mindestbreite des Inhalts jedes Ellipsen-Abschneiden. */
.hh-grow { flex: 1 1 auto; min-width: 0; }

/* Aktionsbutton neben einem Eingabefeld (z.B. „Scannen", „Neu anlegen"), in
   einer Flex-Zeile mit align-items:flex-end. Unterhalb des sichtbaren
   Eingabefelds liegen zwei Fluent-Abstände, an denen sich der Button sonst
   ausrichtet und dadurch zu tief sitzt:
     --spacingVerticalM   (12px) .my-3-o, das Fluent jedem Feld mit Label anhängt
     --spacingVerticalXXS  (2px) row-gap zur leeren Message-Zeile des
                                 fluent-field-Grids (rows: label/input/message)
   Beide bekommt der Button als unteren Außenabstand, damit seine Unterkante
   exakt auf der Unterkante des Eingabefelds liegt. */
.hh-field-action {
    margin-bottom: calc(var(--spacingVerticalM) + var(--spacingVerticalXXS));
}

.hh-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-3);
}

.hh-grid--gap-2 { gap: var(--space-2); }
.hh-grid--gap-4 { gap: var(--space-4); }

.hh-col-1  { grid-column: span 1; }
.hh-col-2  { grid-column: span 2; }
.hh-col-3  { grid-column: span 3; }
.hh-col-4  { grid-column: span 4; }
.hh-col-5  { grid-column: span 5; }
.hh-col-6  { grid-column: span 6; }
.hh-col-7  { grid-column: span 7; }
.hh-col-8  { grid-column: span 8; }
.hh-col-9  { grid-column: span 9; }
.hh-col-10 { grid-column: span 10; }
.hh-col-11 { grid-column: span 11; }
.hh-col-12 { grid-column: span 12; }

/* Breakpoints: sm = 600px, md = 960px */
@media (min-width: 600px) {
    .hh-col-sm-1  { grid-column: span 1; }
    .hh-col-sm-2  { grid-column: span 2; }
    .hh-col-sm-3  { grid-column: span 3; }
    .hh-col-sm-4  { grid-column: span 4; }
    .hh-col-sm-5  { grid-column: span 5; }
    .hh-col-sm-6  { grid-column: span 6; }
    .hh-col-sm-7  { grid-column: span 7; }
    .hh-col-sm-8  { grid-column: span 8; }
    .hh-col-sm-9  { grid-column: span 9; }
    .hh-col-sm-10 { grid-column: span 10; }
    .hh-col-sm-11 { grid-column: span 11; }
    .hh-col-sm-12 { grid-column: span 12; }
}

@media (min-width: 960px) {
    .hh-col-md-1  { grid-column: span 1; }
    .hh-col-md-2  { grid-column: span 2; }
    .hh-col-md-3  { grid-column: span 3; }
    .hh-col-md-4  { grid-column: span 4; }
    .hh-col-md-5  { grid-column: span 5; }
    .hh-col-md-6  { grid-column: span 6; }
    .hh-col-md-7  { grid-column: span 7; }
    .hh-col-md-8  { grid-column: span 8; }
    .hh-col-md-9  { grid-column: span 9; }
    .hh-col-md-10 { grid-column: span 10; }
    .hh-col-md-11 { grid-column: span 11; }
    .hh-col-md-12 { grid-column: span 12; }
}

/* ── HHButtonGroup (verbundene Buttons – Sort-Richtung im Filter-Drawer) ── */
.hh-btn-group {
    display: inline-flex;
    width: 100%;
}

/* ── HHAvatar (kleines rundes Icon-Badge) ───────────────────────────────── */
.hh-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border-strong);
    color: var(--color-text-secondary);
    font-size: 15px;
}

.hh-avatar--primary {
    background: var(--color-primary-soft);
    border-color: rgba(15, 108, 189, 0.3);
    color: var(--color-primary);
}

/* ── HHBreadcrumbs ──────────────────────────────────────────────────────── */
.hh-breadcrumbs__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.hh-breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.hh-breadcrumbs__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color var(--duration-base) var(--ease-default);
}

.hh-breadcrumbs__link:hover {
    color: var(--color-text);
    text-decoration: underline;
}

.hh-breadcrumbs__link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.hh-breadcrumbs__text {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.hh-breadcrumbs__item--current {
    color: var(--color-text);
    font-weight: 500;
}

.hh-breadcrumbs__sep {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

.hh-breadcrumbs__icon {
    font-size: 14px;
}

/* ── HHSplitButton ──────────────────────────────────────────────────────── */
.hh-split {
    display: inline-flex;
    align-items: stretch;
}

.hh-split__main {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.hh-split__toggle {
    height: 100%;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
}

/* Workaround Fluent v5 RC: Der Fokus-Unterstrich (.root::after) von
   fluent-text-input/-textarea spannt mit left/right -1px über die Feldkanten
   hinaus. Visuell wird der Überstand per clip-path gekappt, die absolut
   positionierte Box zählt aber trotzdem zum Scroll-Overflow – beim Fokussieren
   eines Feldes erscheint dadurch in Dialogen ein horizontaler Scrollbalken.
   Unterstrich auf Feldbreite begrenzen und den Clip entsprechend anpassen. */
fluent-text-input::part(root)::after,
fluent-textarea::part(root)::after {
    left: 0;
    right: 0;
    clip-path: inset(calc(100% - 2px) 0 0);
}

/* Workaround Fluent v5 RC: fluent-menu-item hat grid-template-columns
   "20px 20px auto 20px", legt den Text (part=content) aber in eine der beiden
   fixen 20px-Spalten: ohne Icon in Spalte 1 ("--indent: 0"), MIT Icon in Spalte 2
   ("--indent: 1"). Der nowrap-Text läuft in beiden Fällen über und wird an der
   Kante der Menu-Liste abgeschnitten. Content bis vor die letzte Spalte spannen,
   damit das Item nach Textbreite misst (gemessen: 20px -> 232px).

   Korrektur zur früheren Fassung dieses Kommentars: die Klasse gilt NICHT nur für
   reine Text-Items. Sie ist auch bei Icons nötig (s.o.) und verträgt sich mit
   Untermenüs – "-2" endet vor der letzten Spalte, in der Fluent den Submenu-Pfeil
   zeichnet, und der bleibt damit sichtbar (Inhalt endet bei 303px, Pfeil bei 327px).
   Unverträglich ist allein ein zusätzlicher end-Slot: der belegt genau diese Spalte.
   Verwendet von HHSplitButton, dem AppBar-Benutzermenü und jedem Menü, das sich per
   Klasse hh-menu-plain dazu bekennt. */
.hh-split fluent-menu-item::part(content),
.hh-menu-plain fluent-menu-item::part(content) {
    grid-column-end: -2;
}

/* Hier stand bis Fluent v5 RC4 die Klasse hh-menu-end: fluent-menu hängte sein Popover
   per inset-inline-start an den Trigger-Start und kannte als einzigen Ausweich-Fallback
   flip-block – also vertikal. Ein Menü nahe dem rechten Fensterrand (Sprachauswahl,
   Remote-Scan in der AppBar) lief deshalb aus dem Bild und musste von Hand rechtsbündig
   gestellt werden.

   RC5 hat die Regel umgestellt auf
       position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
   und weicht damit auch horizontal aus. Nachgemessen (Trigger fix am rechten Rand,
   169px breites Menü, Viewport 1280): RC4 ragte 65px hinaus, RC5 klappt von selbst
   nach links und bleibt 8px innerhalb. Die Klasse ist damit ersatzlos entfallen –
   nicht wieder einführen, sie würde das Ausweichen nur wieder festnageln. */

/* Workaround Fluent v5 RC: fluent-dropdown (FluentSelect/-Combobox) gibt seinem
   .control z-index:1, spannt selbst aber keinen Stacking-Context auf. Der z-index
   wirkt dadurch im Stacking-Context des Dialogs – gleichauf mit dem sticky Header
   von fluent-dialog-body (.title, ebenfalls z-index:1), aber später im DOM. Ein
   Select im Dialoginhalt scrollt deshalb über den Header statt darunter (alle
   anderen Felder und Buttons verhalten sich korrekt). isolation kapselt den
   z-index im Select; die geöffnete Optionsliste ist ein echtes Popover
   (popover="manual") und liegt im Top-Layer – sie bleibt davon unberührt. */
fluent-dropdown {
    isolation: isolate;
}
