/* Portal (SPEC-014…042): Rahmen und gemeinsame Bausteine, ausschließlich über die Tokens aus brand/brand.css (UI-01).
   Gestaltung nach SPEC-042 (UI-01…10): neutrale Flächen, 1-px-Ränder, Radien 6/8 px, Geist 12–24 px, Schnitte 400–600,
   Abstände auf dem 4-px-Raster. Reihenfolge: Rahmen → Bausteine (Meldung, Karte, Formular, Tabelle, Badge, Menü) → Ansichten. */

/* ==== Rahmen ============================================================================================================== */

body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar hint"
    "sidebar main";
}

.skip-link {
  position: absolute;
  left: -999px;
  top: var(--space-2);
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-selected);
  color: var(--text-on-selected);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.skip-link:focus {
  left: var(--space-2);
}

/* Kopfzeile (SPEC-037): rechts der Seitenleiste; Suchfeld (Dummy), rechts „Ticket anlegen“, Darstellungsschalter,
   Sprache, persönliches Menü. Fläche wie die Seitenleiste, feine Linie unten; Icons einfarbig. */
.portal-header {
  grid-area: header;
  position: sticky;
  top: 0;
  z-index: 5;
  box-sizing: border-box;
  height: var(--frame-header-height);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-4) 0 var(--space-5);
  background: var(--surface-header);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-default);
}

/* Versteckte Teile der Kopfzeile bleiben versteckt, auch wenn ihre Klasse eine Anzeigeart setzt (Sitzung noch nicht bestätigt). */
.portal-header [hidden] {
  display: none;
}

.header-search {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.search-field {
  position: relative;
  flex: 0 1 auto;
  width: 535px;
  min-width: 12rem;
}

.search-field input {
  width: 100%;
  height: var(--control-height);
  padding: 0 52px 0 36px;
  border-color: var(--border-default);
  background: var(--surface-app);
  color: var(--text-body);
  font-size: var(--text-sm);
  cursor: not-allowed;
}

/* Deaktiviert (Dummy, SPEC-037-AC-06), aber lesbar: Platzhalter im Nebentext statt grauer Browser-Vorgabe. */
.search-field input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.search-field svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-secondary);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.search-shortcut {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  padding: 0 var(--space-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 18px;
  pointer-events: none;
}

.header-tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  font-size: var(--text-base);
  white-space: nowrap;
}

/* „Ticket anlegen“: primäre Aktion mit Plus-Icon links (CD-05; hell Royal Blue, dunkel Icy Blue über die Aktions-Tokens). */
.header-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-height);
  margin-right: var(--space-1);
  padding: 0 var(--space-3) 0 10px;
}

.header-action svg {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
}

/* „Issue anlegen“ bei Wartung (SPEC-125-AC-11): der Support ist nur lesbar, die Aktion ist ausgegraut und nicht bedienbar. */
.header-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* „Ticket anlegen“ bei gesperrtem Support (SPEC-059): ausgegraut als Umriss in der Nebentext-Farbe, Schloss rechts; Klick führt zur Sperrseite. */
.header-action[data-locked="true"],
.header-action[data-locked="true"]:hover {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-secondary);
}

.header-action svg.header-lock {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  stroke-linejoin: round;
}

/* Schaltfläche nur mit Icon (Sprache, persönliches Menü): ohne Fläche, Hover neutral, offen = gewählter Zustand */
.icon-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-base);
}

.icon-button:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
}

.icon-button[aria-expanded="true"],
.icon-button[aria-expanded="true"]:hover {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.icon-button svg,
.nav-toggle svg,
.portal-nav a svg,
.service-model-symbol svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Kubernetes-Rad (SPEC-037-AC-28, CHG-005): als einziges Icon überall 15 % größer dargestellt. `scale` vergrößert nur die Darstellung,
   Abstände und die Lage der Beschriftung bleiben; die Drehung im Zustand „Unknown“ (transform) wirkt unabhängig davon. */
svg[data-icon="kubernetes-wheel"] {
  scale: 1.15;
}

/* Baustein Schalter (role="switch"): die Bereichsschalter in Customer Access (SPEC-060): Pille 44 × 24 px mit rundem Knopf, aus links, an rechts;
   aus: neutrale Fläche mit Rand. Pillenform, weil die Form eine Funktion hat (UI-03). an = Aktionsfarbe des Modus, damit „frei“ in dichten Tabellen
   auf einen Blick vom Rand des ausgeschalteten Zustands zu unterscheiden ist (Bedienelement 3:1, UI-04). Das Darstellungssymbol der Kopfzeile ist seit
   SPEC-172 kein Schalter mehr, sondern ein Symbolknopf (.theme-cycle). */
.switch {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: flex-start;
  width: 44px;
  height: 24px;
  min-height: 24px;
  padding: 0 2px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius-pill);
  background: var(--surface-app);
  color: var(--text-primary);
}

.switch:hover:not(:disabled) {
  border-color: var(--surface-selected);
  background: var(--surface-app);
}

.switch-knob {
  display: grid;
  flex: none;
  place-items: center;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  background: var(--surface-card);
}

.switch[aria-checked="true"] .switch-knob {
  border-color: transparent;
}

.switch[aria-checked="true"],
.switch[aria-checked="true"]:hover:not(:disabled) {
  justify-content: flex-end;
  border-color: var(--action-primary);
  background: var(--action-primary);
}

.switch[aria-checked="true"] .switch-knob {
  background: var(--action-primary-text);
}

/* Darstellungssymbol (SPEC-172): quadratischer Symbolknopf (Mockup IDEA-028: Breite = Höhe der Bedienelemente); das Symbol zeigt den gewählten Modus (Monitor,
   Sonne, Mond) in der Textfarbe, mittig. */
.theme-cycle {
  justify-content: center;
  width: var(--control-height);
  padding: 0;
}

.theme-cycle svg {
  width: 20px;
  height: 20px;
}

/* Während des Speicherns gesperrt (SPEC-060): Wartezeiger statt Verbotszeichen; die Abschwächung kommt aus der Regel für gesperrte Bedienelemente. */
.portal-main .switch:disabled {
  cursor: progress;
}

/* Persönliches Menü: durch eine feine Linie abgesetzt; Avatar bzw. Benutzersymbol, Name, Pfeil nach unten. */
.user-container:has(> .user-button:not([hidden])) {
  margin-left: var(--space-1);
  padding-left: var(--space-3);
  border-left: 1px solid var(--border-default);
}

.user-button {
  height: 40px;
  padding: 0 var(--space-2) 0 var(--space-1);
  font-weight: var(--weight-medium);
}

.icon-button .user-icon {
  width: 20px;
  height: 20px;
  margin: 0 var(--space-1);
}

/* Pfeil als gezeichnete Ecke statt svg/img (SPEC-032 zählt die Bilder im Auslöser). */
.user-chevron {
  flex: none;
  width: 5px;
  height: 5px;
  margin: 0 var(--space-1) 3px 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* Seitenleiste (SPEC-037-AC-18…22): volle Fensterhöhe, bleibt beim Scrollen stehen; oben das Logo in Höhe der Kopfzeile, darunter die
   Navigation. Eingeklappt 64 px breit mit dem Logomark 35 × 35. Die Breite läuft als Übergang (--motion-sidebar); das Raster der Seite
   folgt ihr in jedem Bild (Spalte `auto`), daher beginnt die Kopfzeile stets rechts der Seitenleiste. Ruhiges Ein- und Ausklappen:
   Icons und Zeichen stehen in beiden Zuständen an derselben Stelle (gleiche Abstände, keine Zentrierung beim Einklappen); die
   schrumpfende Leiste schneidet Schriftzug und Beschriftungen ab, die zugleich weich aus- bzw. einblenden. Das Logomark ersetzt das
   Logo erst am Ende des Übergangs (nav.js) deckungsgleich. Reduzierte Bewegung: alles sofort.
   Ende des Bildlaufs (AC-18): Die Seite kann eine gebrochene Höhe haben (z. B. 6458,5 px), die Bildlauflänge des Dokuments ist auf
   ganze Pixel gerundet (6459 px). Ganz unten endet der Rasterbereich der Leiste dann einen Bruchteil vor der Fensterunterkante, und
   `sticky` schöbe die Leiste um diesen Bruchteil nach oben. Der negative Außenabstand unten erlaubt der Leiste, den Rasterbereich um
   bis zu 1 px zu überragen; sie bleibt damit exakt bei y = 0. Maße und Raster ändern sich dadurch nicht (die Seite ist mindestens
   fensterhoch). */
.portal-sidebar {
  grid-area: sidebar;
  position: sticky;
  z-index: 6; /* eigene Stapelebene über dem Inhalt, damit Tooltips der eingeklappten Navigation nicht unter Karten liegen */
  top: 0;
  margin-bottom: -1px;
  align-self: start;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface-sidebar);
  border-right: 1px solid var(--border-default);
  transition: width var(--motion-sidebar);
}

.portal-sidebar.is-collapsed {
  width: var(--sidebar-width-collapsed);
}

/* Links 14 px: Mitte des Zeichens bei 31,5 px, der Mitte der eingeklappten Leiste ohne Rand (und der Icons darunter). */
.sidebar-brand {
  flex: none;
  box-sizing: border-box;
  height: var(--frame-header-height);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 var(--space-4) 0 14px;
  border-bottom: 1px solid var(--border-default);
}

/* Deckkraft des Schriftzugs im Logo mit Schriftzug (rechts vom Zeichen, ab 28 % der Bildbreite); in Ruhe immer 100 %. */
@property --wordmark-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

.portal-logo {
  display: block;
  flex: none;
  width: 150px;
  height: auto;
  --wordmark-alpha: 100%;
  mask-image: linear-gradient(to right, currentColor 28%, color-mix(in srgb, currentColor var(--wordmark-alpha), transparent) 28%);
  transition: --wordmark-alpha var(--motion-fade-in);
}

.portal-sidebar.is-collapsed .portal-logo {
  --wordmark-alpha: 0%;
  transition: --wordmark-alpha var(--motion-fade-out);
}

.portal-logo[data-variant="logomark"] {
  width: 35px;
  height: 35px;
  mask-image: none;
}

/* Seitennavigation (SPEC-014/015/037): neun Bereiche oben, unten die Box mit „Einstellungen“ und dem Umschalter (AC-23). */
.portal-nav {
  --nav-inset: 10px;
  /* Quadrate unten (Symbol des Service Model, Umschalter): Seitenlänge und Abstand nach links, mit dem ihre Mitte auf der Linie der 18-px-Icons liegt. */
  --nav-square: 36px;
  --nav-square-offset: calc(var(--nav-inset) + 9px - var(--nav-square) / 2);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: var(--space-4) var(--space-3) var(--space-3);
}

.portal-nav[hidden] {
  display: none;
}

/* Rahmen ohne bestätigten Zugang (SPEC-053): Kopfzeile und Seitenleiste bleiben versteckt, auch gegen ihre Anzeigeart. */
.portal-header[hidden],
.portal-sidebar[hidden] {
  display: none;
}

.portal-nav ul {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Reicht die Fensterhöhe nicht (SPEC-154-AC-13), scrollt nur die Liste der Bereiche; Logo, Kopfzeile und der Fuß unten stehen (UI-11), auch
   eingeklappt (SPEC-037-AC-33, CHG-019): die Tooltips stehen dort fest im Fenster und ragen deshalb nicht in den Überlauf der Liste. Eingeklappt
   ohne sichtbaren Rollbalken, damit die Icons auf ihrer Linie bleiben (AC-29). Innenabstand und gleich großer negativer Außenabstand lassen den
   Fokusring der Einträge (2 px + 2 px Abstand) im Sichtbereich, ohne die Lage der Icons zu ändern. */
.portal-nav > #nav-list {
  min-height: 0;
  margin: calc(-1 * var(--space-1));
  padding: var(--space-1);
  overflow-y: auto;
}

.portal-nav.is-collapsed > #nav-list {
  overflow-x: hidden;
  scrollbar-width: none;
}

.portal-nav li {
  position: relative;
}

/* Service Model (SPEC-179, CHG-008, CHG-012): erstes Element unten (über „Einstellungen“, SPEC-179-AC-13), ohne Rahmen, Pille und Schatten. Oben die Beschriftung
   in Großbuchstaben, darunter das Lucide-Symbol der Stufe (18 px, Textfarbe) in einem Quadrat mit dezenter Fläche – für alle Stufen dieselbe – und rechts daneben der
   Name; darunter eine Trennlinie zu „Einstellungen“. Quadrat und Beschriftung stehen auf --nav-square-offset, das Quadrat damit mittig auf der Linie der
   Navigationssymbole, aus- und eingeklappt an derselben Stelle. Eingeklappt blenden Beschriftung und Name wie die Namen der Bereiche aus (.nav-label); die Beschriftung
   behält ihre Höhe, damit das Quadrat beim Übergang nicht springt (E-10). Zugänglicher Name und Tooltip setzt service-model.js. */
.service-model {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 0 var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.service-model-caption {
  margin-left: var(--nav-square-offset);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

.service-model-tier {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  overflow: hidden;
  padding-left: var(--nav-square-offset);
}

.service-model-symbol {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-square);
  height: var(--nav-square);
  border-radius: var(--radius-md);
  background: var(--surface-brand-subtle);
  color: var(--text-primary);
}

.service-model-name {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.portal-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-sizing: border-box;
  min-height: 36px;
  margin: 0 0 var(--space-1);
  padding: 0 var(--nav-inset);
  overflow: hidden;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  text-decoration: none;
}

/* Umschalter (SPEC-037-AC-29, CHG-012; Text SPEC-037-AC-31, CHG-015): eine Schaltfläche aus dem kompakten Quadrat (neutraler 1-px-Rand, keine Fläche, nur das Icon
   panel-left-close, mittig auf der Linie der Navigationssymbole) und – ausgeklappt – dem Text „Einklappen“ rechts daneben, vertikal mittig, in Schrift und Farbe der
   gedämpften Navigationstexte. Eingeklappt bleibt nur das Quadrat an derselben Stelle: Der Text blendet wie die Namen der Bereiche aus und seine Breite läuft mit der
   Leiste auf 0, damit die Schaltfläche dort nicht breiter als das Quadrat ist. Der zugängliche Name steht im aria-label (nav.js). */
.nav-toggle {
  flex: none;
  align-self: flex-start;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  max-width: calc(100% - var(--nav-square-offset));
  height: var(--nav-square);
  margin-left: var(--nav-square-offset);
  /* Luft rechts hinter dem Text wie zwischen Quadrat und Text (SPEC-037-AC-34, CHG-026); eingeklappt 0. */
  padding: 0 var(--space-3) 0 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  transition: padding-right var(--motion-sidebar);
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.nav-toggle-square {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--nav-square);
  height: var(--nav-square);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
}

.nav-toggle .nav-label {
  max-width: 12em;
  margin-left: var(--space-3);
  transition: opacity var(--motion-fade-in), visibility var(--motion-fade-in), max-width var(--motion-sidebar), margin-left var(--motion-sidebar);
}

/* Hover ohne Fläche und Rahmen, nur Text und Icon dunkler; schlägt die globale Regel button:hover (SPEC-037-AC-34, CHG-026). */
.nav-toggle:hover:not(:disabled) {
  border-color: transparent;
  background: transparent;
  color: var(--text-primary);
}

/* Fokusring nur für die Tastatur (UI-10): nach einem Mausklick bleibt er nicht stehen. */
.nav-toggle:focus:not(:focus-visible) {
  outline: none;
}

.portal-nav.is-collapsed .nav-toggle {
  padding-right: 0;
}

.portal-nav.is-collapsed .nav-toggle .nav-label {
  max-width: 0;
  margin-left: 0;
  transition: opacity var(--motion-fade-out), visibility var(--motion-fade-out), max-width var(--motion-sidebar), margin-left var(--motion-sidebar);
}

/* Unten (SPEC-037-AC-23, ohne Box seit SPEC-037-AC-29, CHG-012): Service Model (nur Kundenportal), „Einstellungen“ als gewöhnlicher Eintrag und der Umschalter,
   ohne Rand und ohne eigene Fläche. Die Einträge behalten den Innenabstand der Liste, ihre Icons stehen genau über denen der Liste. */
.nav-footer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-3);
}

.nav-item {
  position: relative;
}

.portal-nav .nav-footer a {
  margin: 0;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  transition: opacity var(--motion-fade-in), visibility var(--motion-fade-in);
}

.portal-nav a:hover {
  background: var(--surface-hover);
}

/* Aktiver Bereich: Icy-Blue-Fläche mit Deep-Teal-Text in beiden Modi (CD-05, SPEC-015-AC-05), 6 px Radius (SPEC-042-AC-05). */
.portal-nav a[aria-current="page"] {
  background: var(--surface-nav-active);
  color: var(--text-on-selected);
}

/* Eingeklappt: Beschriftungen blenden aus und sind danach unsichtbar (visibility bleibt während des Ausblendens sichtbar). */
.portal-nav.is-collapsed .nav-label {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-fade-out), visibility var(--motion-fade-out);
}

/* Unterpunkte (SPEC-037-AC-24): je Bereich eine Liste direkt unter dem Bereichslink, sichtbar nur, solange der Bereich aktiv
   (ein Unterpunkt mit aria-current, router.js; unter Updates trägt die gezeigte Unterseite "page", SPEC-089) und die Navigation ausgeklappt ist; sonst Höhe 0 und unsichtbar (nicht fokussierbar).
   Die Höhe läuft mit der Breite der Leiste (keine Sprünge der übrigen Einträge); der Text blendet beim Einklappen mit den Beschriftungen
   aus und beim Ausklappen erst ein, wenn die Leiste fast breit ist. Der Text beginnt bündig mit dem Text des Bereichs (kein Einzug),
   13 px; aktiv markiert nur über die Schrift (Textfarbe --text-primary, 500), ohne Linie und ohne Fläche (Entscheidung Tim 2026-11-03). */
/* BUG-004: Die Höhe läuft je Unterpunkt (Zeile der li), nicht je Liste; die Liste selbst klappt nur Deckkraft und Sichtbarkeit. */
.portal-nav .nav-sublist {
  flex: none;
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-fade-out), visibility var(--motion-fade-out);
}

/* BUG-004: Den Abstand zum nächsten Bereich (sonst der untere Rand des Bereichslinks, der aus dem li herausragt) trägt bei Bereichen mit
   Unterliste das li selbst; der Abstand zwischen Bereichslink und Unterpunkt ist der obere Rand des Unterpunkts und klappt mit ihm ein. Sonst
   bliebe der Rand des Bereichslinks zwischen Link und eingeklappter Liste stehen (Eintrag 4 px höher als sein Link). Aus- und eingeklappt
   stehen alle Einträge an derselben Stelle wie zuvor. */
.portal-nav li:has(> .nav-sublist) {
  margin-bottom: var(--space-1);
}

.portal-nav li:has(> .nav-sublist) > a {
  margin-bottom: 0;
}

.nav-sublist > li {
  min-height: 0;
  overflow: hidden;
}

/* Ein verborgener Unterpunkt (hidden, z. B. „New Issue“ ohne Schreibrecht, SPEC-136) bleibt verborgen; `display: grid` unten überstimmt sonst die Browserregel. */
.portal-nav .nav-sublist > li[hidden] {
  display: none;
}

/* BUG-004: Eine Zeile je Unterpunkt; minmax(0, …) hält die Zeile bei 0, auch wenn der Link seine Mindesthöhe (control-height) hat. */
.portal-nav .nav-sublist > li {
  display: grid;
  grid-template-rows: minmax(0, 0fr);
  transition: grid-template-rows var(--motion-subnav);
}

.portal-nav .nav-sublist:has(a[aria-current]) {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--motion-fade-in-late), visibility var(--motion-fade-in-late);
}

.portal-nav .nav-sublist:has(a[aria-current]) > li {
  grid-template-rows: minmax(0, 1fr);
}

.portal-nav.is-collapsed .nav-sublist,
.portal-nav.is-collapsed .nav-sublist:has(a[aria-current]) {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-fade-out), visibility var(--motion-fade-out);
}

.portal-nav.is-collapsed .nav-sublist > li,
.portal-nav.is-collapsed .nav-sublist:has(a[aria-current]) > li {
  grid-template-rows: minmax(0, 0fr);
}

/* Per zweitem Klick auf den aktiven Bereich zugeklappt (SPEC-037-AC-26): Bereichslink mit aria-expanded="false" (router.js). */
.portal-nav li:has(> a[aria-expanded="false"]) > .nav-sublist {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-fade-out), visibility var(--motion-fade-out);
}

.portal-nav li:has(> a[aria-expanded="false"]) > .nav-sublist > li {
  grid-template-rows: minmax(0, 0fr);
}

/* Textbeginn = Innenabstand + Icon (18 px) + Abstand zwischen Icon und Text, wie im Bereichslink. */
.portal-nav .nav-sublist a {
  --nav-sub-indent: calc(var(--nav-inset) + 18px + var(--space-3));
  min-height: var(--control-height);
  margin: var(--space-1) 0 0;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--nav-sub-indent);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
}

/* Markierter Unterpunkt: aria-current="true" (Aktion „Issue erstellen“) bzw. "page" (Unterseite „Board“/„Kalender“, SPEC-089, E-15). */
.portal-nav .nav-sublist a[aria-current],
.portal-nav .nav-sublist a[aria-current]:hover {
  background: transparent;
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

/* Die Textbreite ist die der ausgeklappten Leiste und bleibt beim Ein- und Ausklappen gleich: kein Neuumbruch, keine Höhenänderung,
   der Link schneidet ab. Lange Texte brechen mit Silbentrennung der Seitensprache um. */
.portal-nav .nav-sublist a span {
  flex: none;
  width: calc(var(--sidebar-width) - 1px - 2 * var(--space-3) - var(--nav-sub-indent) - var(--space-2));
  line-height: var(--leading-tight);
  white-space: normal;
  hyphens: auto;
  overflow-wrap: anywhere;
}

/* Fokusring innen, damit die Liste ihn beim Auf- und Zuklappen nicht abschneidet. */
.portal-nav .nav-sublist a:focus {
  outline-offset: -2px;
}

/* Eingeklappt dreht sich nur der Pfeil von panel-left-close; das Icon sieht dann aus wie panel-left-open (Lucide). */
.nav-toggle .nav-toggle-arrow {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--motion-sidebar);
}

.portal-nav.is-collapsed .nav-toggle .nav-toggle-arrow {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .portal-sidebar,
  .portal-logo,
  .nav-label,
  .portal-nav.is-collapsed .nav-label,
  .nav-toggle,
  .nav-toggle .nav-label,
  .portal-nav.is-collapsed .nav-toggle .nav-label,
  .portal-nav .nav-sublist,
  .portal-nav .nav-sublist > li,
  .portal-nav .nav-sublist:has(a[aria-current]),
  .portal-nav.is-collapsed .nav-sublist,
  .portal-nav.is-collapsed .nav-sublist:has(a[aria-current]),
  .portal-nav li:has(> a[aria-expanded="false"]) > .nav-sublist,
  .portal-sidebar.is-collapsed .portal-logo,
  .nav-toggle .nav-toggle-arrow {
    transition: none;
  }
}

/* Tooltip der eingeklappten Navigation: fest im Fenster am Anker des Eintrags (rechter Rand, senkrechte Mitte; nav.js setzt --tooltip-x und
   --tooltip-y), damit ihn der Überlauf der scrollenden Liste nicht abschneidet (SPEC-037-AC-33). */
.portal-nav [role="tooltip"] {
  position: fixed;
  left: calc(var(--tooltip-x, 0px) + var(--space-2));
  top: var(--tooltip-y, 0px);
  transform: translateY(-50%);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  z-index: 7;
}

/* Gesperrter Bereich (SPEC-059): Eintrag in der Nebentext-Farbe, Schloss einfarbig rechts; eingeklappt klein unten rechts am Icon,
   freigestellt in der Fläche des Eintrags. Unterpunkte eines gesperrten Bereichs fehlen (hidden, gegen die Anzeigeart der Liste). */
.portal-nav a[data-locked="true"] {
  position: relative;
  color: var(--text-secondary);
}

.portal-nav a[data-locked="true"][aria-current="page"] {
  color: var(--text-on-selected);
}

.portal-nav a svg.nav-lock {
  width: 14px;
  height: 14px;
  margin-left: auto;
  stroke-width: 2;
}

.portal-nav.is-collapsed a svg.nav-lock {
  position: absolute;
  top: calc(50% - 1px);
  left: calc(var(--nav-inset) + 9px);
  width: 12px;
  height: 12px;
  padding: 1px;
  border-radius: var(--radius-sm);
  background: var(--surface-sidebar);
}

.portal-nav.is-collapsed a:hover svg.nav-lock {
  background: var(--surface-hover);
}

.portal-nav.is-collapsed a[aria-current="page"] svg.nav-lock {
  background: var(--surface-nav-active);
}

.portal-nav .nav-sublist[hidden] {
  display: none;
}

/* Zähler neben „Dein Bereich“ (SPEC-168, IDEA-027): die Einträge in „Jetzt handeln“, ab 10 „9+“. Royal Blue, im dunklen Modus Icy Blue (Token --action-primary), nie
   Orange. Ausgeklappt rechts im Link, eingeklappt klein oben rechts am Icon (der Text der Leiste ist dann ausgeblendet); der Link selbst bleibt der Bezugspunkt. */
.portal-nav a[data-view] {
  position: relative;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 20px;
  height: 18px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--action-primary);
  color: var(--hs-on-status);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-badge {
    color: var(--action-primary-text);
  }
}

:root[data-theme="dark"] .nav-badge {
  color: var(--action-primary-text);
}

/* Eingeklappt: kleiner Zähler oben rechts am Icon (Icon 18 px ab --nav-inset); die Breite wächst mit „9+“, bleibt aber im Link (39 px).
   Breite einschließlich Innenabstand (BUG-007): sonst ist schon „8“ 24 px breit und ragt über den Link hinaus. */
.portal-nav.is-collapsed .nav-badge {
  position: absolute;
  box-sizing: border-box;
  top: 2px;
  left: calc(var(--nav-inset) + 10px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
}

/* Inhaltsbereich */
.portal-main {
  grid-area: main;
  min-width: 0;
  padding: var(--space-5) var(--space-6);
  color: var(--text-body);
}

.portal-main:focus {
  outline: none;
}

.portal-main > p {
  max-width: 48rem;
  margin: 0 0 var(--space-4);
}

/* ==== Baustein: Dummy-Badge (SPEC-037) ===================================================================================== */
/* Sichtbares Zeichen für eine künftige Funktion: gestrichelter Slate-Blue-Umriss, Text in der Textfarbe des Modus, keine Fläche. */
.dummy-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  box-sizing: border-box;
  height: 18px;
  padding: 0 6px;
  border: 1px dashed var(--hs-slate-blue);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}

/* ==== Baustein: Sperr- und Wartungsseite (SPEC-059) ======================================================================= */
/* Eine Karte im Inhaltsbereich (Baustein Karte, `.portal-main > section`): Symbol in der Nebentext-Farbe, Überschrift, Beschreibung, Aktion.
   Die Dummy-Aktion „<Bereich> freischalten“ ist nicht bedienbar (aria-disabled) und trägt das Dummy-Badge; sie behält ihr Aussehen ohne Hover-Wechsel. */
.area-notice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.area-notice h1,
.area-notice p {
  margin: 0;
}

.area-notice p {
  color: var(--text-body);
}

.area-notice-icon {
  display: flex;
  color: var(--text-secondary);
}

.area-notice-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area-notice-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.area-dummy-action[aria-disabled="true"],
.area-dummy-action[aria-disabled="true"]:hover {
  border-color: var(--action-primary);
  background: var(--action-primary);
  cursor: default;
}

/* ==== Baustein: Badge für Priorität und Status (CD-02, Ausnahme IDEA-014) ================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: 20px;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}

.badge-critical {
  background: var(--hs-badge-critical-bg);
  color: var(--hs-badge-critical-text);
}

.badge-high {
  background: var(--hs-badge-high-bg);
  color: var(--hs-badge-high-text);
}

.badge-medium {
  background: var(--hs-badge-medium-bg);
  color: var(--hs-badge-medium-text);
}

.badge-low {
  border-color: var(--hs-badge-low-border);
  background: transparent;
  color: var(--text-primary);
}

.badge-open {
  background: var(--hs-badge-open-bg);
  color: var(--hs-badge-open-text);
}

.badge-closed {
  background: var(--hs-badge-closed-bg);
  color: var(--hs-badge-closed-text);
}

/* ==== Baustein: Hinweisseite ohne Rahmen (SPEC-053) ======================================================================== */
/* Eine Karte (Baustein Karte, section in main) schmal und mittig: Logo, Überschrift, ein Satz, Aktionen. Für die Hinweisseite und
   die Fehlerseiten der Anmeldung; Kopfzeile und Seitenleiste sind dabei versteckt. */
.portal-main > .notice-page {
  max-width: 32rem;
  margin: var(--space-6) auto;
  padding: var(--space-6);
}

.notice-page img {
  display: block;
  margin: 0 0 var(--space-6);
}

.notice-page h1 {
  margin: 0 0 var(--space-3);
}

.notice-page p {
  margin: 0 0 var(--space-5);
}

.notice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* Link als primäre Aktion (CD-05): gleiche Form wie ein Button in der Aktionsfarbe des Modus. */
.notice-actions .notice-primary {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--action-primary);
  border-radius: var(--radius-sm);
  background: var(--action-primary);
  color: var(--action-primary-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.notice-actions .notice-primary:hover {
  border-color: var(--action-primary-hover);
  background: var(--action-primary-hover);
}

/* ==== Baustein: Meldung (SPEC-025/026/028, CD-02 Statusfarben) ============================================================= */
.message {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-sizing: border-box;
  max-width: 48rem;
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
}

/* display: flex darf das hidden-Attribut nicht überstimmen (Meldungen sind nur sichtbar, wenn sie etwas sagen) */
.message[hidden] {
  display: none;
}

.message svg {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-error {
  background: var(--message-error-bg);
  color: var(--message-on-status);
}

.message-success {
  background: var(--message-success-bg);
  color: var(--message-on-status);
}

.message-info {
  background: var(--message-info-bg);
  color: var(--message-on-status);
}

.message-warning {
  background: var(--message-warning-bg);
  color: var(--message-on-warning);
}

/* Hinweis „Sprachwahl nicht gespeichert“ (SPEC-036): eigene Zeile zwischen Kopfzeile und Inhalt, nur sichtbar, wenn er gebraucht wird */
.portal-hint {
  grid-area: hint;
  max-width: none;
  margin: 0;
  border-radius: 0;
}

/* Feldfehler: Statusfarbe auf hellem Grund, hält den Kontrast auch im Dunkelmodus (CD-02, WCAG AA) */
.field-error {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--field-error-bg);
  color: var(--field-error-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.field-error[hidden] {
  display: none;
}

.field-error svg {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==== Baustein: Karte (UI-07) ============================================================================================== */
/* Ein Container je logischem Abschnitt: Formular und Liste in Support, Antwort und Anhang im Ticketdetail, die Abschnitte der
   Einstellungen. Fläche --surface-card, 1-px-Rand, 8 px Radius, 16 px Innenabstand, kein Schatten. */
.portal-main > form,
.portal-main > section,
.settings-section {
  box-sizing: border-box;
  max-width: 64rem;
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: none;
}

.portal-main > form h2,
.portal-main > section h2,
.settings-section h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg);
}

.portal-main > section > p:last-child,
.settings-section > p:last-child {
  margin-bottom: 0;
}

/* ==== Einstellungen: Unternavigation (SPEC-037-AC-25) ===================================================================== */
/* Links eine Spalte mit den Abschnitten der Einstellungen, rechts daneben deren Inhalt; Oberkante beider auf derselben Höhe. Die Liste
   ist keine Landmark; der aktive Eintrag trägt die Auswahlfläche wie andere gewählte Zustände (UI-04), 6 px Radius, 14 px/500. */
.settings-layout {
  container: settings / inline-size;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

/* Ohne Unternavigation (helvascale-Frontend › Benutzereinstellungen, SPEC-176): der Inhalt nimmt die ganze Breite. */
.settings-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

/* ==== Einstellungen: Anordnung der Karten (SPEC-042-AC-11) ================================================================ */
/* Profil als Hauptkarte links, Profilbild als Nebenkarte rechts (gleiche Höhe), Passwort als ganze Zeile darunter. Unter 720 px
   Inhaltsbreite (Layout 200 + 24 + 720 px) eine Spalte; die Container-Abfrage folgt dem Ein-/Ausklappen der Seitenleiste. */
.settings-content {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  gap: var(--space-4);
  align-items: stretch;
  max-width: 64rem;
}

.settings-content > .settings-section {
  max-width: none;
  margin: 0;
  padding: calc(var(--space-4) + var(--space-1));
}

.settings-password {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-5);
  align-items: center;
}

.settings-password h2 {
  grid-column: 1 / -1;
}

.settings-password p {
  margin: 0;
  color: var(--text-secondary);
}

.settings-password > button {
  justify-self: end;
}

/* ==== Einstellungen: Preferences (SPEC-175, IDEA-028; Mockup docs/mockups/IDEA-028/customer-einstellungen.html) ===================================== */
/* Eine Karte über die ganze Breite unter Passwort; zwei Radiogruppen mit Auswahlkarten (Wahl, Beispiel), die gewählte trägt die Auswahlfläche (UI-04). */
.settings-preferences {
  grid-column: 1 / -1;
}

.pref-group {
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
}

.pref-group legend {
  margin-bottom: var(--space-1);
  padding: 0;
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.pref-group .form-hint {
  margin: 0 0 var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

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

@container settings (max-width: 600px) {
  .pref-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pref-option {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
}

/* Gewählte Karte (BUG-028): dezente Tönung der Akzentfarbe (hell Icy Blue 18 %, dunkel 14 % auf der Karte) mit Akzentrand und Texten in den Textfarben des Modus; die volle
   Auswahlfläche --surface-selected ist dunkel Icy Blue und trägt nur --text-on-selected. Unterzeile in Fließtextfarbe: --text-secondary liegt auf der Tönung hell bei 4,36:1. */
.pref-option:has(input:checked) {
  border-color: var(--action-primary);
  background: var(--surface-brand-subtle);
  box-shadow: inset 0 0 0 1px var(--action-primary);
}

.pref-option:has(input:checked) .pref-example {
  color: var(--text-body);
}

.pref-option:has(input:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Eigenes Radio statt des Systemzeichens (BUG-028): nicht gewählt ein leerer Ring, gewählt ein gefüllter Akzentpunkt im Akzentring; der globale Eingabestil (Feldfläche) soll nicht durchscheinen. */
.pref-option input {
  flex: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  padding: 0;
  border: 2px solid var(--border-field);
  border-radius: 50%;
  background: transparent;
}

.pref-option input:checked {
  border-color: var(--action-primary);
  background: radial-gradient(circle closest-side, var(--action-primary) 55%, transparent 62%);
}

.pref-option strong {
  display: block;
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.pref-option .pref-example {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.pref-option .lang-flag {
  display: inline-block;
  margin-right: var(--space-2);
}

.pref-option svg {
  width: 18px;
  height: 18px;
  margin-right: var(--space-1);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}

/* Zuschnitt offen (SPEC-032): Profilbild über die volle Breite unter Profil, damit Bild und Vorschau Platz haben. */
.settings-content:has(.crop) > .settings-profile,
.settings-content:has(.crop) > .settings-avatar {
  grid-column: 1 / -1;
}

@container settings (max-width: 943px) {
  .settings-content {
    grid-template-columns: minmax(0, 1fr);
  }
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-nav a {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: var(--control-height);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  text-decoration: none;
}

.settings-nav a:hover {
  background: var(--surface-hover);
}

.settings-nav a[aria-current="true"],
.settings-nav a[aria-current="true"]:hover {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

/* ==== Baustein: Formular ================================================================================================== */
.portal-main form label {
  display: block;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.portal-main .ticket-form {
  display: grid;
  grid-template-columns: minmax(0, 40rem);
  gap: var(--space-1);
  align-items: start;
}

.ticket-form label {
  margin-top: var(--space-2);
}

.ticket-form label:first-child,
.ticket-form .form-hint + label {
  margin-top: 0;
}

/* Dauerhafter Formularhinweis (SPEC-050): ruhiger Nebentext statt Statusfläche (CD-02: Statusfarben nur für Rückmeldungen) */
.ticket-form .form-hint {
  margin: 0 0 var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.ticket-form .form-hint[hidden] {
  display: none;
}

.ticket-form input,
.ticket-form textarea,
.ticket-form select {
  width: 100%;
}

.ticket-form input:not([type="file"]),
.ticket-form select {
  height: 36px;
}

/* Dateiauswahl: kein Feldrahmen, die Auswahl-Schaltfläche als sekundäre Aktion */
.portal-main input[type="file"] {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.portal-main input[type="file"]::file-selector-button {
  box-sizing: border-box;
  height: var(--control-height);
  margin-right: var(--space-3);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.ticket-form button {
  justify-self: start;
  margin-top: var(--space-3);
}

.portal-main .profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-1) var(--space-4);
  margin: 0 0 var(--space-5);
}

/* Reihenfolge im DOM: Bezeichnung, Feld, Fehler je Name, Mobilnummer (Bezeichnung, Feld, Hilfetext, Fehler), dann Speichern;
   Vorname links, Nachname rechts (SPEC-042-AC-11), darunter links die Mobilnummer (SPEC-124); Hilfetext und Fehler teilen sich eine Zeile,
   weil immer nur eines sichtbar ist. */
.profile-form > :nth-child(1) { grid-area: 1 / 1; }
.profile-form > :nth-child(2) { grid-area: 2 / 1; }
.profile-form > :nth-child(3) { grid-area: 3 / 1; }
.profile-form > :nth-child(4) { grid-area: 1 / 2; }
.profile-form > :nth-child(5) { grid-area: 2 / 2; }
.profile-form > :nth-child(6) { grid-area: 3 / 2; }
.profile-form > :nth-child(7) { grid-area: 4 / 1; margin-top: var(--space-2); }
.profile-form > :nth-child(8) { grid-area: 5 / 1; }
.profile-form > :nth-child(9) { grid-area: 6 / 1; }
.profile-form > :nth-child(10) { grid-area: 6 / 1; }
.profile-form > :nth-child(11) { grid-area: 7 / 1; }

/* Hilfetext unter der Mobilnummer (SPEC-124): ruhiger Nebentext wie der Formularhinweis (CD-02) */
.profile-form .form-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.profile-form .form-hint[hidden] {
  display: none;
}

.profile-form input {
  width: 100%;
  height: 36px;
}

.profile-form button {
  justify-self: start;
  margin-top: var(--space-3);
}

@container settings (max-width: 943px) {
  .portal-main .profile-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-form > :nth-child(n) {
    grid-area: auto;
  }

  .profile-form label:not(:first-child) {
    margin-top: var(--space-2);
  }
}

/* Die eine orange Hauptaktion einer Ansicht (CD-05) */
.primary-action,
.primary-action:hover:not(:disabled) {
  border-color: var(--action-emphasis);
  background: var(--action-emphasis);
  color: var(--action-emphasis-text);
}

/* Sekundäre Aktionen (CD-05, UI-05): Umriss, Text in der Textfarbe, keine zweite gefüllte Hauptaktion je Ansicht. */
.profile-email button,
.settings-section > button,
.avatar-actions button,
.crop-buttons button + button,
.ticket-form button:not(.primary-action),
.cluster-state-actions button.secondary,
.maintenance-mode button.secondary,
.notice-actions button,
.portal-main .overview-period-button {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
}

.profile-email button:hover:not(:disabled),
.settings-section > button:hover:not(:disabled),
.avatar-actions button:hover:not(:disabled),
.crop-buttons button + button:hover:not(:disabled),
.ticket-form button:not(.primary-action):hover:not(:disabled),
.cluster-state-actions button.secondary:hover:not(:disabled),
.maintenance-mode button.secondary:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

.portal-main button:disabled,
.portal-main input:disabled,
.portal-main textarea:disabled,
.portal-main select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==== Bereich Clusters (SPEC-070) ========================================================================================== */
/* Seitenkopf mit Überschrift und primärem Knopf „+ Cluster hinzufügen“; darunter je Umgebung eine Karte (Prod, Non-Prod) mit Anzahl und
   einer Tabelle in voller Breite. Beide Tabellen teilen die Spaltenaufteilung (colgroup, feste Tabellenbreite): die Spalten sind in beiden
   gleich breit. Unter der Mindestbreite scrollt die Tabelle in ihrer Karte waagrecht, die Seite nicht. Zustand immer Symbol und Text (CD-02);
   Fremdmarken-Logos 16 px links neben dem Klartext (CD-02 Ausnahme), Farbe nur über die Tokens --logo-<marke>. */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
}

.page-head h1 {
  margin: 0;
}

.page-actions {
  display: flex;
  flex: none;
  gap: var(--space-2);
}

.page-actions[hidden] {
  display: none;
}

button.with-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

button.with-icon svg,
.cluster-state-actions button svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.cluster-content > section {
  box-sizing: border-box;
  margin: 0 0 var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.cluster-content > .table-card {
  overflow: hidden;
}

.table-card .card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.portal-main .table-card .card-head h2 {
  margin: 0;
}

.table-card .count {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

/* Clusters › Development und Production (SPEC-210, UI-11): Kopf und Hinweise stehen fest, in der Karte scrollt nur der Tabellenkörper (Kopfzeile bleibt stehen). */
body:has(.clusters-page) {
  height: 100vh;
  overflow: hidden;
}

.portal-main:has(> .clusters-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.clusters-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.clusters-page > .page-head,
.clusters-page > .cluster-toolbar {
  flex: none;
}

.clusters-page > .cluster-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.clusters-page .cluster-content > .table-card {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}

.clusters-page .cluster-content > .cluster-state {
  margin-bottom: 0;
}

.clusters-page .cluster-content .table-card .card-head {
  flex: none;
}

.clusters-page .cluster-content .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.clusters-page .cluster-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-card);
}

.table-card .cluster-env-empty {
  margin: 0;
  padding: var(--space-2) var(--space-4) var(--space-4);
  color: var(--text-secondary);
}

/* Versionsquellen (SPEC-079-AC-10, UI-11): wie Clusters › Development – Kopf, Warnung, Kartenkopf und Fußnote stehen, in der Karte scrollt nur der
   Tabellenkörper (Kopfzeile bleibt stehen). */
body:has(.sources-page) {
  height: 100vh;
  overflow: hidden;
}

.portal-main:has(> .sources-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.sources-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.sources-page > .page-head,
.sources-page > .message {
  flex: none;
}

.sources-page > .cluster-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.sources-page .cluster-content > .table-card {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}

.sources-page .cluster-content > .cluster-state {
  margin-bottom: 0;
}

.sources-page .cluster-content .table-card .card-head,
.sources-page .cluster-content .table-card .src-note {
  flex: none;
}

.sources-page .cluster-content .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.sources-page .src-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-card);
}

/* Bei Überbreite scrollt nur die Tabelle seitlich; position hält auch visuell versteckte Beschriftungen in der Scrollfläche. */
.table-scroll {
  position: relative;
  overflow-x: auto;
}

/* Mindestbreite und Anteile aus dem gemessenen Bedarf (Geist 13 px: „Disconnected“, „Managed Service“, Datum mit Uhrzeit, längste
   Version); freier Platz verteilt sich gleichmäßig, nur die Pfeilspalte bleibt fest schmal. */
.portal-main .cluster-table {
  width: 100%;
  min-width: 1158px;
  table-layout: fixed;
}

.cluster-table col.c-name { width: 9.89%; }
.cluster-table col.c-state { width: 11.34%; }
.cluster-table col.c-dist { width: 9.17%; }
.cluster-table col.c-infra { width: 10.98%; }
.cluster-table col.c-nodes { width: 6.99%; }
.cluster-table col.c-owner { width: 13.25%; }
.cluster-table col.c-current { width: 12.52%; }
.cluster-table col.c-latest { width: 12.25%; }
.cluster-table col.c-last { width: 13.61%; }
.cluster-table col.c-open { width: 56px; }

.portal-main .cluster-table th,
.portal-main .cluster-table td {
  height: auto;
  padding: var(--space-3) var(--space-2);
  overflow: hidden;
}

.portal-main .cluster-table th {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  background: var(--surface-card);
  vertical-align: bottom;
}

.portal-main .cluster-table th:first-child,
.portal-main .cluster-table td:first-child {
  padding-left: var(--space-4);
}

.portal-main .cluster-table th:last-child,
.portal-main .cluster-table td:last-child {
  padding-right: var(--space-4);
  text-align: right;
}

/* Alle Zeilen gleich hoch: zweizeilige Werte (Versionen) bestimmen die Höhe. */
.portal-main .cluster-table tbody td {
  height: 68px;
}

.th-main,
.th-sub {
  display: block;
}

.th-sub {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Ganze Zeile klappt das Detail darunter auf (SPEC-071-AC-16, CHG-032): Zeiger; fokussierbar ist der Knopf am Zeilenende (Pfeil, dreht sich beim Aufklappen). */
.portal-main tr.row-open {
  cursor: pointer;
}

.portal-main tr.row-open:has(.row-toggle[aria-expanded="true"]) {
  background: var(--surface-hover);
}

.portal-main .row-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.portal-main .row-toggle:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

.portal-main .row-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.row-toggle svg {
  transition: transform var(--motion-panel);
}

.row-toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.row-chevron {
  display: inline-flex;
  color: var(--text-secondary);
}

.row-chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-main tr.row-open:hover .row-chevron {
  color: var(--text-primary);
}

.cluster-name-text {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

.cell-main {
  display: block;
  color: var(--text-body);
  white-space: nowrap;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.cell-empty,
.last-seen.muted {
  color: var(--text-secondary);
}

/* Logos neben Distribution und Infrastruktur: nie ohne Text; Symbole einfarbig in der Markenfarbe aus brand.css. */
.with-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.brand-logo {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--text-primary);
}

/* Logos der AppCare-Bindungsarten (Helm, Operator Framework, Argo CD) sind 20 px groß (CHG-038, SPEC-196-AC-12); sie stehen mittig zum Text in .type-tag. */
.type-tag .brand-logo {
  width: 20px;
  height: 20px;
}

/* Logos mit eigener Dunkel-Variante (AWS): je Modus ein Bild, das andere ist ausgeblendet (dieselben Bedingungen wie die Tokens in brand.css). */
.logo-variants {
  display: contents;
}

.only-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-light {
    display: none;
  }

  :root:not([data-theme="light"]) .only-dark {
    display: inline-block;
  }
}

:root[data-theme="dark"] .only-light {
  display: none;
}

:root[data-theme="dark"] .only-dark {
  display: inline-block;
}

.logo-openshift { color: var(--logo-openshift); }
.logo-okd { color: var(--logo-okd); }
.logo-rancher { color: var(--logo-rancher); }
.logo-k3s { color: var(--logo-k3s); }
.logo-kubernetes { color: var(--logo-kubernetes); }
.logo-googlecloud,
.logo-gke { color: var(--logo-googlecloud); }
.logo-openstack { color: var(--logo-openstack); }
.logo-helm { color: var(--logo-helm); }
.logo-argo { color: var(--logo-argo); }

/* Zustand: Symbol und englisches Label in der Textfarbe. */
.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-body);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.state svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Healthy und Up to date: grüne Fläche mit weißem Haken (5,4:1, auch im Dunkelmodus) */
.state-ready .state-fill {
  fill: var(--hs-status-success);
  stroke: none;
}

.state-ready .state-mark {
  fill: none;
  stroke: var(--hs-on-status);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Attention und „Kein Owner“: Warnfläche Orange mit Deep-Teal-Zeichen (CD-02 Statusfarbe Warnung) */
.state-attention .state-fill,
.hint-missing .state-fill {
  fill: var(--hs-status-warning);
  stroke: none;
}

.state-attention .state-mark,
.hint-missing .state-mark {
  fill: none;
  stroke: var(--hs-deep-teal);
  stroke-width: 2.2;
  stroke-linecap: round;
}

/* Unknown: drehendes Kubernetes-Rad in Orange (Warnfarbe); bei reduzierter Bewegung steht es still. */
.state-unknown svg {
  color: var(--hs-status-warning);
  animation: cluster-wheel-spin 6s linear infinite;
}

@keyframes cluster-wheel-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .state-unknown svg { animation: none; }
}

/* Disconnected: Stecker als Strichsymbol in der Nebentextfarbe */
.state-disconnected svg {
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.has-tip {
  cursor: default;
}

.has-tip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Tooltip (role="tooltip"): fest positioniert, damit ihn die Scrollfläche nicht abschneidet; Stil wie die Navigations-Tooltips. */
.cluster-tip {
  position: fixed;
  z-index: 30;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  pointer-events: none;
}

.cluster-tip > span {
  display: block;
}

/* Hinweis an gesperrt sichtbaren Schreibaktionen (CHG-046, SPEC-136-AC-14): fest positioniert (im modalen Dialog als Kind des Dialogs), Stil wie der Tooltip oben, aber umbrechend. */
.role-hint {
  position: fixed;
  z-index: 30;
  box-sizing: border-box;
  max-width: min(22rem, calc(100vw - 2 * var(--space-2)));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  pointer-events: none;
}

/* Für die Rolle gesperrter Knopf (aria-disabled, bleibt fokussierbar): ausgegraut wie „Update planen“ gesperrt, ohne Hover-Wechsel. Die doppelte Wurzel hebt die Spezifität
   über alle Hover-Regeln der Knopfarten (primär, sekundär, Tabelle, Dialog). */
:root:root button.role-locked[aria-disabled="true"],
:root:root button.role-locked[aria-disabled="true"]:hover {
  border-color: var(--border-default);
  background: var(--surface-card);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Gesperrter Link (Unterpunkt „New Issue“ der Navigation, CHG-048): ohne Hover-Fläche, gedämpft. */
:root:root a.role-locked[aria-disabled="true"],
:root:root a.role-locked[aria-disabled="true"]:hover {
  background: transparent;
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Latest Version: Hinweis „Update verfügbar“ in der Hinweisfarbe (nie Orange, keine Fläche) */
.ver-update {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
}

.ver-update .ver-icon {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 1px;
}

.ver-update .upd-fill {
  fill: var(--status-info-icon);
  stroke: none;
}

.ver-update .upd-mark {
  fill: none;
  stroke: var(--status-info-icon-mark);
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* „Last seen“ veraltet: Warnfläche Orange mit Deep-Teal-Text (5,3:1) und Uhr (Orange trägt keinen Fließtext, CD-02) */
.last-seen {
  color: var(--text-body);
  white-space: nowrap;
}

.last-seen-stale {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  box-sizing: border-box;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--message-warning-bg);
  color: var(--message-on-warning);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.last-seen-stale svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

/* Owner: Avatar mit Initialen bzw. helvascale-Logomark mit dem Label „Managed Service“ darunter; fehlender Owner mit Warnzeichen. */
.owner {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.owner-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--hs-avatar-initials-bg);
  color: var(--hs-avatar-initials-text);
  font-size: 10px;
  font-weight: var(--weight-semibold);
}

.owner-logomark {
  flex: none;
}

.owner-managed {
  display: block;
  margin: 0 0 0 32px;
  line-height: 16px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.hint-missing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-body);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.hint-missing svg {
  width: 15px;
  height: 15px;
  flex: none;
}

/* Laden: je Karte zwei Platzhalterzeilen ohne Text; bei reduzierter Bewegung ohne Pulsieren. */
.skeleton {
  display: block;
  height: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  animation: cluster-skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton.short { width: 40%; }
.skeleton.mid { width: 65%; }
.skeleton.long { width: 90%; }

@keyframes cluster-skeleton-pulse {
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* Ladezustand der Übersicht (SPEC-038-AC-21): Platzhalter in der Höhe der Tabellenzeilen, der Hinweis „Wird geladen“ nur für Hilfstechnik. */
.overview-loading {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.overview-loading .skeleton { height: 28px; }

/* Leerzustand und Wartung: Symbol im Kreis, Überschrift, Text, Aktion – mittig in einer Karte. */
.cluster-content > .cluster-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  text-align: center;
}

.portal-main .cluster-state h2 {
  margin: var(--space-2) 0 0;
}

.cluster-state p {
  max-width: 34rem;
  margin: 0;
  color: var(--text-secondary);
}

.cluster-state-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-3);
}

.state-illustration {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-brand-subtle);
  color: var(--text-primary);
}

.state-illustration svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sperrseite Clusters (SPEC-059, SPEC-070-AC-08): drei Vorteile nebeneinander, je Titel und ein Satz. */
.locked-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  max-width: 48rem;
  margin: var(--space-1) 0 0;
  padding: 0;
  list-style: none;
}

.locked-benefits li {
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-body);
  font-size: var(--text-sm);
}

.locked-benefits strong {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

@media (max-width: 720px) {
  .locked-benefits {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==== Baustein: Tabelle =================================================================================================== */
.portal-main table {
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.portal-main th,
.portal-main td {
  height: 36px;
  box-sizing: border-box;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: middle;
}

.portal-main th {
  border-bottom-color: var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.portal-main td {
  color: var(--text-body);
  font-weight: var(--weight-regular);
}

.portal-main tbody tr:last-child td {
  border-bottom: 0;
}

.portal-main tbody tr:hover td {
  background: var(--surface-hover);
}

.portal-main td a {
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.portal-main td a:hover {
  text-decoration: underline;
}

.portal-main time {
  font-variant-numeric: tabular-nums;
}

.ticket-table {
  width: 100%;
}

.ticket-table th:first-child,
.ticket-table td:first-child {
  padding-left: 0;
}

.ticket-table th:last-child,
.ticket-table td:last-child {
  padding-right: 0;
}

.ticket-table th:first-child,
.ticket-table td:first-child {
  font-variant-numeric: tabular-nums;
}

/* ==== Bereich Clusters im helvascale-Frontend (SPEC-073) ====================================================================== */
/* Wie die Clusters-Seite des Kundenportals (SPEC-070) mit einer zusätzlichen ersten Spalte „Kunde“ und am Zeilenende dem Icon-Knopf
   „Ownerschaft übernehmen“ vor dem Pfeil; darüber eine Werkzeugleiste mit Suche, Kundenauswahl, „Nur Managed Service“ und Anzahl. */
.cluster-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.cluster-toolbar[hidden] {
  display: none;
}

.cluster-toolbar .search-input {
  position: relative;
  flex: 0 1 18rem;
}

.cluster-toolbar .search-input svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.cluster-toolbar input[type="search"] {
  width: 100%;
  height: var(--control-height);
  padding: 0 var(--space-3) 0 36px;
  font-size: var(--text-sm);
}

.cluster-toolbar input[type="search"]::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.cluster-toolbar select {
  height: var(--control-height);
  font-size: var(--text-sm);
}

.cluster-toolbar label.check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.cluster-toolbar .count {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

/* Elf Spalten: Anteile nach dem Bedarf (Kundenname, „Managed Service“), die Aktionsspalte (Übernahme und Pfeil) fest. Die Mindestbreite passt bei 1489 px Fensterbreite
   ohne waagrechtes Scrollen in den Inhaltsbereich, damit der Übernahme-Knopf sichtbar bleibt; darunter scrollt die Tabelle in ihrer Karte. */
.portal-main .cluster-table.staff {
  min-width: 1180px;
}

.cluster-table.staff col.c-kunde { width: 11.5%; }
.cluster-table.staff col.c-name { width: 8%; }
.cluster-table.staff col.c-state { width: 10.5%; }
.cluster-table.staff col.c-dist { width: 8.5%; }
.cluster-table.staff col.c-infra { width: 9%; }
.cluster-table.staff col.c-nodes { width: 7.5%; }
.cluster-table.staff col.c-owner { width: 12.5%; }
.cluster-table.staff col.c-current { width: 11.5%; }
.cluster-table.staff col.c-latest { width: 11.5%; }
.cluster-table.staff col.c-last { width: 9%; }
.cluster-table.staff col.c-open { width: 76px; }

.cluster-table.staff .cell-main {
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}

.portal-main .row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--border-field);
  background: transparent;
  color: var(--text-primary);
}

.portal-main .row-action:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

.row-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Nur lesbare Angaben eines Kunden-Clusters im Detail-Pop-up: ruhige Fläche statt Eingabefeld. */
.field input[readonly] {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.segmented:has(input:disabled) {
  opacity: 0.6;
}

/* Rückfrage „Ownerschaft übernehmen?“: die Folgen als Liste. */
.dialog-body ul.consequences {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
}

.dialog-body ul.consequences li {
  margin-bottom: var(--space-1);
}

/* ==== Bereich Customer Access (SPEC-060) =================================================================================== */
/* Suchfeld über den Tabellen, darunter je Kundengruppe eine Karte (Baustein Karte) mit Überschrift, Anzahl und einer dichten Tabelle
   (Baustein Tabelle, 36 px Zeilen): Name, Alias bzw. E-Mail, je Bereich ein Schalter (zentriert), „Zuletzt geändert“ als Nebentext.
   Breite Tabellen scrollen in ihrer Karte waagrecht. */
.access-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.access-search {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.access-search input {
  width: 100%;
  height: var(--control-height);
  padding: 0 var(--space-3) 0 36px;
  font-size: var(--text-sm);
}

.access-search input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.access-search svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-secondary);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Feste App (UI-11, SPEC-107-AC-08), wie AppCare › Apps: Kopf und Werkzeugleiste stehen; der eine Scrollbereich „access-scroll“ enthält
   beide Kundenlisten. Notlösung für sehr kleine Fenster: dann scrollt der Inhaltsbereich. */
body:has(.access-page) {
  height: 100vh;
  overflow: hidden;
}

.portal-main:has(> .access-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.access-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.access-page > :not(.access-scroll) {
  flex: none;
}

.access-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.access-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

/* Der Tabellenkopf bleibt beim Scrollen stehen (SPEC-076-AC-10): die Tabellenfläche ist kein eigener Scrollbereich, sonst haftet der Kopf nicht
   am einen Scrollbereich „access-scroll“; zu breite Tabellen scrollen dort seitlich. */
.access-scroll .table-scroll {
  overflow: visible;
}

.access-scroll .access-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-card);
}

/* Die Karten je Kundengruppe im Scrollbereich: wie Karten im Inhaltsbereich (Fläche, 1-px-Rand, 8 px Radius, kein Schatten). */
.access-scroll > .access-section {
  box-sizing: border-box;
  max-width: none;
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.access-section-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}

.access-section-head h2 {
  margin: 0;
  font-size: var(--text-lg);
}

.access-count {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.portal-main .access-table {
  width: 100%;
}

.portal-main .access-table th:first-child,
.portal-main .access-table td:first-child {
  padding-left: 0;
}

.portal-main .access-table th:last-child,
.portal-main .access-table td:last-child {
  padding-right: 0;
}

.portal-main .access-table .access-switch-cell {
  padding: 0 var(--space-2);
  text-align: center;
}

.access-switch-cell .switch {
  vertical-align: middle;
}

.portal-main .access-table .access-name {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.portal-main .access-table .access-secondary,
.portal-main .access-table .access-changed {
  color: var(--text-secondary);
  white-space: nowrap;
}

.portal-main .access-table td.access-changed {
  font-variant-numeric: tabular-nums;
}

/* Bereichszelle (SPEC-060-AC-11, CHG-008): Override-Schalter (klein) neben dem Bereichsschalter; ohne Override ist der Bereichsschalter gesperrt und gedimmt und zeigt den Standard
   des Service Models (Klasse is-default, zusätzlich zur Abschwächung gesperrter Bedienelemente). */
.access-area {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.access-area .switch-override {
  width: 32px;
  height: 20px;
  min-height: 20px;
}

.access-area .switch-override .switch-knob {
  width: 14px;
  height: 14px;
}

.access-area .switch.is-default,
.access-area .switch.is-default:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Spalte „Service Model“ (SPEC-060-AC-10): Auswahl im Eingabestil, Hilfe „?“ als Pille mit Tooltip am Spaltenkopf. */
.portal-main .access-table .access-model {
  min-width: 10rem;
  padding: 0 var(--space-2);
  text-align: left;
  white-space: nowrap;
}

.portal-main .access-table .service-model-select {
  min-height: 28px;
  max-width: 100%;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
}

.access-table .access-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: var(--space-1);
  border: 1px solid var(--text-secondary);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: var(--weight-medium);
  line-height: 1;
  vertical-align: middle;
  cursor: help;
}

.access-table .access-hint:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.access-empty {
  margin: var(--space-3) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.access-empty[hidden] {
  display: none;
}

/* ==== Spalte „TAM“ unter Customer Access (SPEC-076) ========================================================================== */
/* Werkzeugleiste mit „Ohne TAM“ und Zähler rechts; in der Tabelle nach den Kundenspalten ein Auswahlknopf mit Avatar (Initialen) und Name
   bzw. „Kein TAM“. Die Auswahl liegt fest positioniert über der Tabelle (die Karte scrollt waagrecht und würde sie abschneiden). Farben nur
   über Tokens; Auswahl- und aktive Fläche wie Navigation (Frosted Breeze hell, Icy Blue dunkel, CD-05). */
.access-toolbar label.check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.access-toolbar label.check input {
  margin: 0;
}

.access-toolbar .count {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.access-toolbar .count[hidden] {
  display: none;
}

.message .small-action {
  margin-left: auto;
  border-color: currentColor;
  background: transparent;
  color: inherit;
}

.message .small-action:hover:not(:disabled) {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.portal-main .access-table .tam-cell {
  min-width: 11rem;
  padding: 0 var(--space-2);
}

.tam-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.portal-main .access-table .tam-pick {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  min-height: 28px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  background: var(--surface-field);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  text-align: left;
}

.portal-main .access-table .tam-pick:hover:not(:disabled) {
  border-color: var(--text-primary);
  background: var(--surface-field);
}

.portal-main .access-table .tam-pick:disabled {
  color: var(--text-secondary);
  cursor: not-allowed;
}

.tam-pick > span:not(.owner-avatar) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tam-pick .owner-avatar,
.picker-option .owner-avatar {
  width: 22px;
  height: 22px;
}

.tam-pick .pick-chevron,
.picker-search svg,
.tam-saved svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tam-pick .pick-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--text-secondary);
}

.tam-none {
  color: var(--text-secondary);
}

.tam-saved {
  display: inline-flex;
  align-items: center;
  color: var(--hs-status-success);
}

.tam-saved[hidden] {
  display: none;
}

.tam-saved svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.picker-pop {
  position: fixed;
  z-index: 20;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 16rem;
  padding: var(--space-1);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  text-align: left;
}

.picker-search {
  position: relative;
  margin-bottom: var(--space-1);
}

.picker-search svg {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.picker-search input {
  width: 100%;
  height: var(--control-height);
  padding-left: 28px;
  font-size: var(--text-sm);
}

.picker-list {
  min-height: 0;
  max-height: 15rem;
  overflow-y: auto;
}

.picker-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: var(--text-sm);
  cursor: pointer;
}

.picker-option:hover {
  background: var(--surface-hover);
}

.picker-option.is-active {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.picker-option.is-active .tam-none {
  color: inherit;
}

.picker-option.tam-clear {
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
}

.picker-foot {
  margin: var(--space-1) 0 0;
  padding: var(--space-1) var(--space-2) 2px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* ==== Menüs (Sprache, persönliches Menü) ================================================================================== */
.menu-container {
  position: relative;
}

.menu-container [role="menu"] {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  min-width: 12rem;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-base);
  z-index: 6;
}

.menu-container [role="menuitemradio"],
.menu-container [role="menuitem"],
.menu-container .menu-text {
  padding: 6px var(--space-2);
  border-radius: var(--radius-sm);
}

.menu-container [role="menuitemradio"],
.menu-container [role="menuitem"] {
  cursor: pointer;
}

.menu-container [role="menuitemradio"]:hover,
.menu-container [role="menuitem"]:hover,
.menu-container [role="menuitemradio"]:focus,
.menu-container [role="menuitem"]:focus {
  background: var(--surface-hover);
  outline-offset: -2px;
}

.menu-container [role="menuitemradio"]::before {
  content: "";
  display: inline-block;
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  margin-right: var(--space-2);
  border-radius: 50%;
  border: 1.5px solid currentColor;
  vertical-align: middle;
}

.menu-container [role="menuitemradio"][aria-checked="true"]::before {
  border-color: var(--text-link);
  background: var(--text-link);
}

/* Sprachflagge (SPEC-055-AC-06, Größe SPEC-055-AC-10, CHG-005): 24 × 16 px inklusive 1-px-Rand in der Rand-Rolle, Radius 2 px;
   Flaggenfarben unverändert in Hell und Dunkel (kein Filter, keine Deckkraft). Der Inhalt (22 × 14 px) wird ohne Verzerrung gefüllt. */
.lang-flag {
  box-sizing: border-box;
  flex: none;
  width: 24px;
  height: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-flag);
  object-fit: cover;
  vertical-align: middle;
}

.menu-container [role="menuitemradio"] .lang-flag {
  margin-right: var(--space-2);
}

.menu-text {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.menu-text strong {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

.menu-container .menu-text + [role="menuitem"] {
  margin-top: var(--space-1);
  border-top: 1px solid var(--border-subtle);
}

/* Persönliches Menü (SPEC-173): Avatar mit Initialen bzw. Profilbild (Auslöser 28 px, Menükopf 40 px), Kopf mit Name und E-Mail, Status-Zeile, Einträge mit Symbol. */
.pm-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hs-avatar-initials-bg);
  color: var(--hs-avatar-initials-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.pm-avatar-sm {
  width: 28px;
  height: 28px;
  margin-right: var(--space-2);
  font-size: 11px;
}

.pm-avatar > img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.pm-avatar > .user-icon {
  width: 60%;
  height: 60%;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-container .personal-menu {
  width: 18rem;
  padding: var(--space-1);
}

.personal-menu .pm-head {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2);
}

.pm-who {
  display: grid;
  min-width: 0;
}

.pm-who strong {
  overflow: hidden;
  color: var(--text-primary);
  font-weight: var(--weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-mail {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status: eigene Zeile unter dem Kopf; lange Texte umbrechen (höchstens 80 Zeichen). */
.personal-menu .pm-status {
  margin: 0 var(--space-2) var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-app);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.personal-menu .pm-status[hidden] {
  display: none;
}

.pm-status-empty {
  color: var(--text-secondary);
}

.personal-menu [role="menuitem"] {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.personal-menu [role="menuitem"] svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-secondary);
}

.personal-menu .pm-sep {
  height: 1px;
  margin: var(--space-1) 0;
  background: var(--border-subtle);
}

/* Dialog „Set status“ (SPEC-173): Zähler unter dem Feld, Vorschläge als Liste, „Status löschen“ links in der Fußzeile. */
.status-dialog .status-clear {
  margin-right: auto;
}

.status-counter {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.status-counter[data-over] {
  color: var(--field-error-text);
}

.status-suggestions-title {
  margin: var(--space-3) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.status-suggestions {
  display: grid;
  gap: 2px;
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.status-suggestions button {
  width: 100%;
  justify-content: flex-start;
  padding: 6px var(--space-2);
  border: 0;
  background: transparent;
  color: var(--text-body);
  font-weight: var(--weight-regular);
  text-align: left;
}

.status-suggestions button:hover {
  background: var(--surface-hover);
}

/* ==== Ticketdetail (SPEC-026) ============================================================================================= */
.pre-wrap {
  white-space: pre-wrap;
}

.back-link {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.ticket-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  max-width: 48rem;
  margin: 0 0 var(--space-4);
}

.ticket-meta dt {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.ticket-meta dd {
  margin: 0;
}

.ticket-history {
  margin: 0 0 var(--space-5);
  padding: 0;
  max-width: 64rem;
  list-style: none;
}

.ticket-history > li,
.ticket-post {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.ticket-post {
  max-width: 64rem;
  box-sizing: border-box;
  margin-bottom: var(--space-5);
}

.history-content {
  flex: 1;
  min-width: 0;
}

.history-content p {
  margin: 0 0 var(--space-2);
}

.history-content p:last-child {
  margin-bottom: 0;
}

/* Avatar im Ticketverlauf (SPEC-034): Kreis 40×40; Team-Logo 26×26 auf heller bzw. dunkler Fläche mit Rand, Initialen, Profilbild. */
.ticket-avatar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  user-select: none;
}

.ticket-avatar[data-avatar="logo"] {
  border: 1px solid var(--hs-border);
  background-color: var(--hs-avatar-logo-bg);
}

.ticket-avatar[data-avatar="logo"] img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.ticket-avatar[data-avatar="initials"] {
  background-color: var(--hs-avatar-initials-bg);
  color: var(--hs-avatar-initials-text);
}

.ticket-avatar[data-avatar="image"] img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ticket-avatar-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-meta {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.history-meta strong {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.attachments {
  margin: 0;
  padding-left: var(--space-5);
}

/* ==== Einstellungen / Profil (SPEC-028, SPEC-032) ========================================================================= */
.profile-email {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-4);
  align-items: center;
  justify-items: start;
  margin: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.profile-email-value { grid-area: 2 / 1; overflow-wrap: anywhere; }

.profile-email button {
  grid-area: 2 / 2;
  justify-self: end;
}

.profile-email-label {
  grid-area: 1 / 1;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

/* Profilbild (SPEC-032): Avatar als Kreis, Zuschnitt mit Rahmen und Vorschau, Kopfzeilen-Avatar 32 px. */
.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* Karte Profilbild (SPEC-042-AC-11): Bild, Text und Aktionen zentriert als Block mittig unter der Überschrift. */
.settings-avatar {
  display: flex;
  flex-direction: column;
}

.settings-avatar h2 {
  margin-bottom: 0;
}

.avatar-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin: auto 0 var(--space-4);
  padding-top: var(--space-4);
  text-align: center;
}

.avatar-current p {
  margin: 0;
  color: var(--text-secondary);
}

.avatar-placeholder {
  box-sizing: border-box;
  width: 112px;
  height: 112px;
  padding: var(--space-4);
  border-radius: 50%;
  background: var(--surface-app);
  color: var(--text-secondary);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.avatar-image {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: auto;
  padding-bottom: var(--space-4);
}

.crop {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-5);
  align-items: flex-start;
  margin-top: var(--space-4);
}

.crop-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  touch-action: none;
}

.crop-image {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Abdunkelung außerhalb des Rahmens: Funktion des Zuschnitts, kein Gestaltungsschatten (UI-07) */
.crop-frame {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid var(--focus-ring); /* Zuschnittrahmen muss auf Fotos sichtbar bleiben */
  box-shadow: 0 0 0 9999px var(--crop-shade);
  cursor: move;
  touch-action: none;
}

.crop-side {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
}

.crop-preview {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-app);
}

.crop-buttons {
  display: flex;
  gap: var(--space-2);
}

/* ==== Übersicht (SPEC-038, SPEC-039, SPEC-042) ============================================================================ */
/* Kopf mit Datum/Zeitraum rechts, vier gleich breite Kacheln, darunter ein Raster aus zwei Spalten (5 : 4) und zwei Zeilen.
   Kacheln und Karten sind die gemeinsame Karte (Fläche --surface-card, 1-px-Rand, 8 px Radius); Icons einfarbig ohne Fläche.
   Ohne Scrollen (SPEC-039-AC-12): Abstände, Innenabstände und Zeilenhöhen in zwei Stufen nach der Fensterhöhe, jeweils auf dem
   4-px-Raster (SPEC-042-AC-08); Schriftgrößen bleiben fest (SPEC-042-AC-04). */
.overview {
  --ov-gap: var(--space-2);
  --ov-pad: var(--space-3);
  --ov-tile-pad: var(--space-2);
  --ov-head-gap: var(--space-2);
  --ov-row: 28px;
  --ov-item: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--ov-gap);
}

@media (min-height: 800px) {
  .overview {
    --ov-gap: var(--space-4);
    --ov-pad: var(--space-4);
    --ov-tile-pad: var(--space-3);
    --ov-head-gap: var(--space-3);
    --ov-row: 36px;
    --ov-item: 28px;
  }
}

.overview svg {
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
}

.overview-title {
  margin: 0;
}

/* Winkende Hand hinter der Begrüßung (SPEC-054-AC-04, Entscheidung Tim): einfarbiges Inline-Symbol, verborgen für Hilfstechnik, gleiche Zeile */
.overview svg.overview-wave {
  width: 1em;
  height: 1em;
  margin-left: 0.3em;
  vertical-align: -0.125em;
}

.overview-subtitle,
.overview-card-subtitle,
.overview-tile-period,
.overview-entry-meta,
.overview-fact-label,
.overview-category-subtitle {
  margin: 0;
  color: var(--text-secondary);
}

.overview-subtitle {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  line-height: 1.4;
}

/* Datum und Zeitraum (Dummy): Datum mit Kalender, deaktivierte Schaltfläche als Umriss, Badge */
.overview-period {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.overview-period-date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

.overview-period-date svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.portal-main .overview-period-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.portal-main .overview-period-button:disabled {
  opacity: 1;
  cursor: default;
}

.overview-period-button svg {
  width: 14px;
  height: 14px;
}

.overview-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ov-gap);
}

/* Zeile 1: Support-Tickets | Wartungen über Vertragsübersicht; Zeile 2: Wissensdatenbank | Letzte Aktivitäten */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: var(--ov-gap);
}

.overview-side {
  display: flex;
  flex-direction: column;
  gap: var(--ov-gap);
  min-width: 0;
}

.overview-side > .overview-card:last-child {
  flex: 1;
}

.overview-tile,
.overview-card {
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-body);
  box-shadow: none;
}

/* Kachel: Bezeichnung, Wert, Trend in einer Zeile; das Icon klein oben rechts ohne eigene Fläche (UI-05) */
.overview-tile {
  position: relative;
  padding: var(--ov-tile-pad) var(--space-4);
}

.overview-tile-icon {
  position: absolute;
  top: var(--ov-tile-pad);
  right: var(--space-4);
  display: flex;
  color: var(--text-secondary);
}

.overview-tile-icon svg {
  width: 16px;
  height: 16px;
}

.overview-tile-body {
  min-width: 0;
}

.overview-tile-label {
  margin: 0;
  padding-right: var(--space-5);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 18px;
}

.overview-tile-value {
  margin: var(--space-1) 0 0;
  color: var(--text-primary);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-figure);
  line-height: 28px;
}

/* Trend (Dummy): „↑ +99 %“, „ggü. Vorperiode“ und das Badge in einer Zeile */
.overview-tile-trend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) 6px;
  margin-top: var(--space-1);
}

.overview-trend-row {
  display: contents;
}

.overview-trend-value {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.overview-trend-value svg {
  width: 12px;
  height: 12px;
}

.overview-tile-trend .dummy-badge {
  order: 2;
}

.overview-tile-period {
  order: 1;
  font-size: var(--text-xs);
  line-height: 18px;
  white-space: nowrap;
}

.overview-card {
  padding: var(--ov-pad);
}

/* Kopf der Karte als Raster: Icon | Titel mit Badge | Link, der Untertitel darunter über Titel- und Linkspalte */
.overview-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-2);
  margin-bottom: var(--ov-head-gap);
}

.overview-card-head > div {
  display: contents;
}

.overview-card-head > .overview-card-link {
  grid-column: 3;
  grid-row: 1;
}

.overview-card-subtitle {
  grid-column: 2 / span 2;
  margin-top: 2px;
  font-size: var(--text-sm);
  line-height: 1.4;
}

.overview-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}

.overview-card-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.overview-card h2 {
  margin: 0;
  font-size: var(--text-base);
  letter-spacing: normal;
  line-height: 20px;
}

/* Kartenlinks: echter Link („Alle Tickets“) und Link ohne Ziel sehen gleich aus; nur der echte ist bedienbar */
.overview-card-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-link);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
}

a.overview-card-link:hover {
  text-decoration: underline;
}

.overview-link-disabled {
  cursor: default;
}

.overview-card-link svg {
  width: 14px;
  height: 14px;
}

/* Elemente gesperrter Bereiche (SPEC-059): ausgegraut über die Nebentext-Farbe, Schloss statt Wert bzw. neben dem Titel, keine Daten;
   die ganze Fläche führt zur Sperrseite. */
.overview-tile.is-locked,
.overview-card.is-locked {
  cursor: pointer;
}

.overview-tile.is-locked:hover,
.overview-card.is-locked:hover {
  background: var(--surface-hover);
}

a.overview-tile-label {
  display: block;
  text-decoration: none;
}

a.overview-tile-label:hover {
  text-decoration: underline;
}

.overview-tile.is-locked .overview-tile-value {
  display: flex;
  align-items: center;
  height: 28px;
  color: var(--text-secondary);
}

.overview-tile.is-locked .overview-tile-value svg {
  width: 20px;
  height: 20px;
}

.overview-card.is-locked h2 {
  color: var(--text-secondary);
}

.overview svg.overview-lock {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.overview-locked-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.overview-card .message {
  max-width: none;
}

.overview-entry-title {
  margin: 0;
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 20px;
}

.overview-entry-meta {
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  line-height: 20px;
}

/* Anstehende Wartungen als Zeitleiste: Punkt je Eintrag, der erste gefüllt, verbunden durch eine feine Linie */
.overview-timeline {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.overview-timeline li {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-3);
  padding-left: var(--space-5);
}

.overview-timeline li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 2px;
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--text-secondary);
  border-radius: 50%;
  background: var(--surface-card);
}

.overview-timeline li:first-child::before {
  border-color: var(--text-link);
  background: var(--text-link);
}

.overview-timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 17px;
  bottom: -3px;
  left: 6px;
  width: 2px;
  background: var(--border-default);
}

/* Vertragsübersicht: drei Werte nebeneinander, getrennt durch feine Linien, ohne Farbfläche (UI-07) */
.overview-facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  margin: 0;
  padding: 0;
  list-style: none;
}

.overview-facts li {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 var(--space-3);
}

.overview-facts li:first-child {
  padding-left: 0;
}

.overview-facts li + li {
  border-left: 1px solid var(--border-default);
}

.overview-fact-value {
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-figure);
  line-height: 24px;
}

.overview-fact-label {
  font-size: var(--text-xs);
  line-height: 18px;
  white-space: nowrap;
}

/* Wissensdatenbank: vier Kategorien in einer Zeile als neutrale Navigationselemente (Rand, keine Fläche), nicht bedienbar */
.overview-categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.overview-category {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: default;
}

.overview-category svg {
  width: 16px;
  height: 16px;
  margin-bottom: var(--space-1);
  color: var(--text-secondary);
}

.overview-category-title {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 20px;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.overview-category-subtitle {
  font-size: var(--text-xs);
  line-height: 16px;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Letzte Aktivitäten: Icon, Text, Datum rechts; feine Trennlinien */
.overview-activities {
  margin: 0;
  padding: 0;
  list-style: none;
}

.overview-activities li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--ov-item);
  border-bottom: 1px solid var(--border-subtle);
}

.overview-activities li:last-child {
  border-bottom: 0;
}

.overview-activities svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.overview-activities .overview-entry-title {
  flex: 1;
  min-width: 0;
  font-weight: var(--weight-regular);
}

.overview-activities .overview-entry-meta {
  white-space: nowrap;
}

/* Reiter: gewählt in Icy Blue mit Deep-Teal-Text (CD-05), sonst Umriss; 6 px Radius wie Buttons */
.overview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--ov-head-gap);
}

.portal-main .overview-tab {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

.portal-main .overview-tab:hover:not(:disabled) {
  border-color: var(--border-default);
  background: var(--surface-hover);
}

.portal-main .overview-tab[aria-selected="true"],
.portal-main .overview-tab[aria-selected="true"]:hover {
  border-color: var(--surface-selected);
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.table-scroll {
  overflow-x: auto;
}

.portal-main .overview-table {
  width: 100%;
}

.portal-main .overview-table th,
.portal-main .overview-table td {
  height: var(--ov-row);
  padding: 0 var(--space-2);
}

.portal-main .overview-table th:first-child,
.portal-main .overview-table td:first-child {
  padding-left: 0;
}

.overview-table time {
  white-space: nowrap;
}

.overview-empty {
  margin: 0;
}

/* Höhen-Layout der Übersicht (SPEC-039-AC-12): Nur solange die Übersicht im Inhaltsbereich steht, ist die Seite genau so hoch wie
   das Fenster; der Inhaltsbereich füllt die Höhe unter der Kopfzeile, das Raster der Karten den Rest unter Kopf und Kacheln. Kein
   versteckter Überlauf: passt der Inhalt in kleineren Fenstern nicht, scrollt die Seite wie zuvor. Andere Bereiche scrollen weiter. */
@media (min-width: 1101px) {
  body:has(> .portal-main > .overview) {
    height: 100vh;
    height: 100dvh;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .portal-main:has(> .overview) {
    box-sizing: border-box;
    min-height: 0;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
  }

  .portal-main > .overview {
    box-sizing: border-box;
    height: 100%;
  }

  .overview-grid {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: auto auto;
  }
}

@media (min-width: 1101px) and (min-height: 800px) {
  .portal-main:has(> .overview) {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }
}

@media (min-width: 1101px) and (min-height: 1000px) {
  .portal-main:has(> .overview) {
    padding-top: var(--space-5);
    padding-bottom: var(--space-5);
  }
}

@media (max-width: 1100px) {
  .overview-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid,
  .overview-categories {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .overview-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==== Übersicht › Hero und Raster (SPEC-234, IDEA-035; Mockup customer-uebersicht) ============================================================ */
/* Feste App (UI-11): das Dokument scrollt nie, der Hero steht, es scrollt nur das Panel „Bereiche und Vorschau“ (Bereich mit Tastaturfokus). Notlösung für sehr kleine Fenster:
   dann scrollt der Inhaltsbereich. Hero hell Frosted Breeze, dunkel Deep Teal, ohne Muster; die Kartenreihen füllen SPEC-235 und SPEC-236. Nur Tokens (UI-01). */
body:has(.ov-page) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.portal-main:has(> .ov-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.ov-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 24rem;
}

.ov-hero {
  --ov-bg: var(--surface-card);
  --ov-border: var(--border-default);
  --ov-text: var(--text-primary);
  --ov-body: var(--text-body);
  --ov-muted: var(--text-secondary);
  --ov-accent: var(--text-link);
  --ov-hand: var(--action-primary);
  --ov-tile: var(--surface-card);
  --ov-tile-hover: var(--surface-hover);
  --ov-tile-border: var(--border-default);
  --ov-btn: var(--action-primary);
  --ov-btn-text: var(--action-primary-text);
  --ov-ring: var(--action-primary);
  --ov-portrait: var(--surface-hover);
  --ov-portrait-ink: var(--text-secondary);
  --ov-skeleton: var(--surface-hover);
  display: flex;
  flex: none;
  align-items: stretch;
  gap: var(--space-6);
  min-height: 15rem;
  padding: var(--space-6);
  border: 1px solid var(--ov-border);
  border-radius: var(--radius-md);
  background: var(--ov-bg);
  color: var(--ov-body);
  overflow: hidden;
}

.ov-hero-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.ov-date {
  margin: 0;
  color: var(--ov-accent);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ov-hero h1 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  color: var(--ov-text);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-h1);
  line-height: 1.1;
}

.ov-hand {
  display: inline-flex;
  color: var(--ov-hand);
  transform-origin: 70% 85%;
  animation: ov-wave 3s ease-in-out infinite;
}

.ov-hand svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

@keyframes ov-wave {
  0%, 45%, 100% { transform: rotate(0); }
  6% { transform: rotate(18deg); }
  13% { transform: rotate(-8deg); }
  20% { transform: rotate(16deg); }
  27% { transform: rotate(-4deg); }
  34% { transform: rotate(10deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ov-hand { animation: none; }
}

.ov-pulse {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--ov-text);
  font-size: var(--text-base);
}

.ov-pulse[hidden],
.ov-todo[hidden],
.ov-more[hidden],
.ov-loading[hidden] {
  display: none;
}

.ov-pulse b {
  font-weight: var(--weight-semibold);
}

.ov-sig {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ov-sig.todo {
  background: var(--hs-orange);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--hs-orange) 25%, transparent);
}

.ov-sig.calm {
  background: var(--ov-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ov-accent) 25%, transparent);
}

.ov-todo {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-width: 34rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ov-todo a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--ov-tile-border);
  border-radius: var(--radius-sm);
  background: var(--ov-tile);
  color: var(--ov-text);
  font-size: var(--text-sm);
  text-decoration: none;
}

.ov-todo a:hover {
  background: var(--ov-tile-hover);
}

.ov-todo svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--ov-hand);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ov-what {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-area-tag {
  flex: none;
  color: var(--ov-muted);
  font-size: var(--text-xs);
}

.ov-more {
  margin: 0;
  font-size: var(--text-xs);
}

.ov-more a {
  color: var(--ov-accent);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.ov-loading {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 34rem;
}

.ov-hero .skeleton {
  background: var(--ov-skeleton);
}

/* Kontaktkarten CSM und TAM im Hero (SPEC-237) */
.ov-people {
  display: flex;
  flex: none;
  align-self: stretch;
  gap: var(--space-3);
}

.ov-person {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 168px;
  padding: var(--space-4) var(--space-3) var(--space-3);
  border: 1px solid var(--ov-tile-border);
  border-radius: var(--radius-md);
  background: var(--ov-tile);
  text-align: center;
}

.ov-person .kind {
  margin: 0 0 6px;
  color: var(--ov-accent);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ov-person .portrait {
  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  outline: 2px solid var(--ov-ring);
  outline-offset: 3px;
  background: var(--ov-portrait);
  color: var(--ov-portrait-ink);
  overflow: hidden;
}

.ov-person .portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ov-person .portrait svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ov-person .portrait.initials {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.ov-person .portrait.skeleton {
  outline: 0;
  animation: none;
}

.ov-person .ov-name {
  margin: 10px 0 0;
  color: var(--ov-text);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ov-person .role {
  min-height: 2.6em;
  margin: 0;
  color: var(--ov-muted);
  font-size: var(--text-xs);
  line-height: 1.3;
}

.ov-person .contact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  margin-top: auto;
}

.ov-person .cbtn {
  display: grid;
  place-items: center;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--ov-btn);
  color: var(--ov-btn-text);
  cursor: pointer;
}

.ov-person .cbtn:hover:not([aria-disabled="true"]) {
  filter: brightness(1.08);
}

.ov-person .cbtn[aria-disabled="true"] {
  background: var(--ov-tile-hover);
  color: var(--ov-muted);
  cursor: not-allowed;
}

.ov-person .cbtn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ov-person .ov-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0;
  color: var(--ov-muted);
  font-size: 11px;
}

.ov-person .ov-hint svg {
  flex: none;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.ov-person.is-locked .portrait {
  outline: 1px dashed var(--ov-tile-border);
  outline-offset: 0;
  background: transparent;
}

.ov-person.is-locked .locked-text {
  margin: auto 0;
  color: var(--ov-muted);
  font-size: var(--text-sm);
}

.ov-person.is-upgrade .portrait {
  color: var(--ov-muted);
}

.ov-person.is-upgrade .portrait svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ov-person .ov-upgrade {
  align-self: center;
  height: 28px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.ov-person .ov-upgrade:hover {
  background: var(--ov-tile-hover);
}

.ov-person .tel-pop {
  position: absolute;
  right: 8px;
  bottom: 46px;
  left: 8px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-body);
}

.ov-person .tel-label {
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ov-person .tel-num {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.ov-person .tel-hint {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.ov-person .tel-copy {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-link);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
}

.ov-notice {
  align-self: flex-start;
  max-width: 34rem;
  margin: 0;
}

.ov-notice a {
  color: inherit;
  font-weight: var(--weight-semibold);
}

/* Empfängerzeile oben im Formular von New Issue (SPEC-237): Person, Rolle und „wird Owner dieses Issues“ */
.new-issue-page .recipient {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-brand-subtle);
}

.new-issue-page .recipient .portrait {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hs-avatar-initials-bg);
  color: var(--hs-avatar-initials-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.new-issue-page .recipient p {
  margin: 0;
  font-size: var(--text-sm);
}

.new-issue-page .recipient .who {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.new-issue-page .recipient .what {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.new-issue-page .recipient .remove {
  min-height: 32px;
  margin-left: auto;
  padding: 0 12px;
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
}

.new-issue-page .recipient .remove:hover:not(:disabled) {
  background: var(--surface-hover);
}

.ov-video-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

/* Panel „Bereiche und Vorschau“: scrollt als einziges, Raster aus vier Spalten für beide Kartenreihen (SPEC-235, SPEC-236) */
.ov-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  padding-bottom: var(--space-2);
  overflow: auto;
}

.ov-areas {
  display: grid;
  flex: 1 1 auto;
  grid-auto-rows: minmax(min-content, 1fr);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.ov-areas-lower .ov-span2 {
  grid-column: span 2;
}

.ov-area-placeholder {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

/* Bereichskarten der Übersicht (SPEC-235): Kopf, Kennzahl, Zustandsbalken mit Legende, Fußzeile; Palettenfarben nach CD-02 (nie die Fehlerfarbe), die Aussage trägt immer Zahl und Text */
.ov-area {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

a.ov-area:hover {
  border-color: var(--action-primary);
}

a.ov-area:hover .ov-go {
  color: var(--action-primary);
  transform: translateX(2px);
}

.ov-area-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ov-area-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.ov-area-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface-brand-subtle);
  color: var(--text-primary);
}

.ov-area-icon svg,
.ov-go {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ov-go {
  margin-left: auto;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}

.ov-kpi {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.ov-kpi b {
  color: var(--text-primary);
  font-size: 32px;
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-figure);
  line-height: 1;
}

.ov-kpi span {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.ov-kpi .ov-sep {
  color: var(--border-default);
}

.ov-bar {
  display: flex;
  gap: 2px;
  height: 8px;
}

.ov-bar i {
  display: block;
  min-width: 6px;
  border-radius: 4px;
}

.ov-tone-success {
  background: var(--hs-status-success);
}

.ov-tone-royal {
  background: var(--hs-royal-blue);
}

.ov-tone-icy {
  background: var(--hs-icy-blue);
}

.ov-tone-orange {
  background: var(--hs-orange);
}

.ov-tone-slate {
  background: var(--hs-slate-blue);
}

.ov-tone-muted {
  background: color-mix(in srgb, var(--hs-slate-blue) 45%, transparent);
}

.ov-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.ov-row-title {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.ov-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  color: var(--text-body);
  font-size: var(--text-xs);
  list-style: none;
}

.ov-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.ov-legend li i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.ov-legend b {
  font-weight: var(--weight-semibold);
}

.ov-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: auto 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.ov-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-meta .turn-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hs-orange);
}

.ov-meta .more {
  flex: none;
  margin-left: auto;
  color: var(--text-link);
  font-weight: var(--weight-medium);
}

.ov-area .next {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.ov-area .next p {
  min-width: 0;
  margin: 0;
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.ov-area .next small {
  display: block;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.ov-cal {
  flex: none;
  width: 52px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  text-align: center;
}

.ov-cal .m {
  display: block;
  padding: 2px 0;
  background: var(--hs-royal-blue);
  color: var(--hs-light-blue);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ov-cal .d {
  display: block;
  padding: 4px 0 5px;
  color: var(--text-primary);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  line-height: 1;
}

.ov-cal.asap .d {
  padding: 8px 0 9px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.ov-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hs-orange) 16%, transparent);
  color: var(--ink-orange);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.ov-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hs-orange);
}

.ov-area .note {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.ov-area .cta {
  margin-top: auto;
  color: var(--text-link);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.ov-area .message {
  margin: 0;
}

.ov-area.is-locked h2 {
  color: var(--text-secondary);
}

.ov-area.is-locked .ov-area-icon {
  border: 1px dashed var(--border-default);
  background: transparent;
  color: var(--text-secondary);
}

.ov-lock-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  text-align: center;
}

.ov-lock-body p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.ov-lock-big {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px dashed var(--border-default);
  border-radius: 50%;
  color: var(--text-secondary);
}

.ov-lock-big svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ov-area.is-locked .ov-meta {
  justify-content: center;
}

.ov-area.is-locked .ov-meta .more {
  margin-left: 0;
}

/* ==== Baustein: Dialog (SPEC-071) ========================================================================================== */
/* Modaler Dialog (native dialog, showModal): 8 px Radius, 1-px-Rand, keine Schatten (CD-05); Hintergrund abgedunkelt. Unterdialoge liegen
   über dem Detail-Pop-up. Sekundäre Aktionen als Umriss, die primäre in der Aktionsfarbe. */
/* Gerüst nach UI-11 (CHG-024): im sichtbaren Bereich (dvh/dvw), offen eine Flex-Spalte; Kopf und Fuß stehen, nur .dialog-body scrollt. */
dialog.hs-dialog {
  box-sizing: border-box;
  width: min(36rem, calc(100dvw - 2 * var(--space-5)));
  max-width: calc(100dvw - 2 * var(--space-5));
  max-height: calc(100dvh - 2 * var(--space-5));
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-body);
  box-shadow: none;
}

dialog.hs-dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog.hs-dialog.wide {
  width: min(46rem, calc(100dvw - 2 * var(--space-5)));
}

dialog.hs-dialog::backdrop {
  background: var(--crop-shade);
}

.dialog-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) 0;
}

.dialog-head h2 {
  margin: 0;
}

.dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.dialog-body > p {
  margin: 0 0 var(--space-3);
}

.dialog-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

dialog button.secondary,
.plan-page button.secondary,
dialog .copy-button,
.plan-page .copy-button,
dialog .icon-close,
.wizard-form button.secondary,
.wizard-step button.secondary,
.wizard-step .copy-button {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
}

dialog button.secondary:hover:not(:disabled),
.plan-page button.secondary:hover:not(:disabled),
dialog .copy-button:hover:not(:disabled),
dialog .icon-close:hover:not(:disabled),
.wizard-form button.secondary:hover:not(:disabled),
.wizard-step button.secondary:hover:not(:disabled),
.wizard-step .copy-button:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

dialog button:disabled,
.plan-page button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

dialog .icon-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border-color: transparent;
  color: var(--text-secondary);
}

dialog .icon-close svg,
.lock-note svg,
.readonly-value svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

dialog .message.inline,
.plan-page .message.inline,
.wizard-form .message.inline,
.wizard-step .message.inline {
  max-width: none;
  margin: 0 0 var(--space-3);
}

dialog code,
.plan-page code,
.wizard-step code {
  font-size: var(--text-sm);
}

/* ==== Detail eines Clusters (SPEC-071; Aufklappbereich unter der Zeile seit CHG-032) ===================================== */
/* Zeile unter dem Cluster: eine Zelle über alle Spalten, Höhe wächst per grid-template-rows (0fr → 1fr); kein eigener Scrollbereich, der Bereich
   scrollt mit der Karte der Umgebung (UI-11). Kopf mit Name, Zustand und Kennzeichen; darunter Karten je Abschnitt. */
.portal-main .cluster-table tbody tr.cluster-detail-row td.cluster-detail-cell {
  height: auto;
  padding: 0;
  overflow: visible;
  text-align: left;
  white-space: normal;
}

/* Bei Überbreite scrollt die Tabelle seitlich (SPEC-070-AC-09); der Aufklappbereich bleibt dabei links stehen und so breit wie der sichtbare Teil der Karte. */
.table-scroll:has(.cluster-detail-row) {
  container-type: inline-size;
}

.cluster-panel-clip {
  position: sticky;
  left: 0;
  box-sizing: border-box;
  width: 100cqw;
  display: grid;
  grid-template-rows: minmax(0, 0fr);
  transition: grid-template-rows var(--motion-panel);
}

.cluster-panel-clip.is-open {
  grid-template-rows: minmax(0, 1fr);
}

.cluster-panel-clip.no-motion {
  transition: none;
}

.cluster-panel-inner {
  min-height: 0;
  overflow: hidden;
}

.cluster-panel {
  box-sizing: border-box;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-app);
  color: var(--text-body);
  font-weight: var(--weight-regular);
}

.cluster-panel-head {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-card);
}

.cluster-panel-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.cluster-panel-body > .message,
.cluster-panel-body > .lock-note {
  max-width: none;
}

@media (prefers-reduced-motion: reduce) {
  .cluster-panel-clip,
  .row-toggle svg {
    transition: none;
  }
}

/* Bis CHG-032 als Dialog; Instanz- und App-Details nutzen die Klassen weiter. Groß und mittig mit eigenem Scrollbereich. */
dialog.detail-dialog {
  width: min(72rem, calc(100dvw - 2 * var(--space-6)));
  max-width: calc(100dvw - 2 * var(--space-6));
  max-height: calc(100dvh - 2 * var(--space-6));
  overflow: hidden;
  background: var(--surface-app);
}

dialog.detail-dialog[open] {
  display: flex;
  flex-direction: column;
}

.detail-head {
  flex: none;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-card);
}

.detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.detail-title h2 {
  margin: 0;
  font-size: var(--text-xl);
  overflow-wrap: anywhere;
}

.detail-scroll {
  position: relative; /* Bezugsrahmen für absolut positionierte Texte (.visually-hidden): sonst reichen sie über den Scrollbereich hinaus und das Pop-up läuft über (UI-11, SPEC-088-AC-14) */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.detail-scroll > .message,
.detail-scroll > .lock-note {
  max-width: none;
}

.detail-card {
  box-sizing: border-box;
  min-width: 0;
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.detail-card p {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  margin: 0 0 var(--space-3);
}

.section-head h3 {
  margin: 0;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-h2);
}

.section-note {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-4);
  align-items: start;
}

.detail-grid .detail-card,
.stack .detail-card {
  margin: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

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

.mono {
  font-family: var(--font-mono);
}

/* Fakten: Beschriftung (dt) klein in der Nebentextfarbe, Wert (dd) darunter. */
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4) var(--space-5);
  margin: 0;
}

.facts.facts-1 {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: var(--space-4);
}

.facts.facts-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.facts.facts-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.facts div {
  min-width: 0;
}

.facts dt {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.facts dd {
  margin: 2px 0 0;
  color: var(--text-body);
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

.facts dd.mono {
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
}

.facts dd .cell-sub {
  font-weight: var(--weight-regular);
}

/* BUG-005: Die Bausteine aus Tabellenzellen sind einzeilig, damit Tabellenzeilen niedrig bleiben; in einer Fakten-Spalte brechen sie in
   ihrer Spalte um, statt in die Nachbarspalte zu laufen. */
.facts dd .cell-main,
.facts dd .cell-sub,
.facts dd .with-logo {
  white-space: normal;
}

.fact-link {
  text-decoration: none;
}

.fact-link:hover {
  text-decoration: underline;
}

/* CHG-041: Kopieren und In neuem Tab öffnen hinter den URLs des Überblicks (SPEC-071-AC-19). Die Symbole stehen inline direkt hinter dem Link und bleiben
   zusammen; der Link bricht wie bisher um, die Spalte wächst nicht. */
.url-actions {
  display: inline-flex;
  gap: 2px;
  margin-inline-start: var(--space-1);
  vertical-align: middle;
  white-space: nowrap;
}

.url-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
}

.url-action:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
  color: var(--text-primary);
}

.url-action svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Kennzeichen: Umgebung als ruhiger Umriss (Prod kräftiger), Managed Service als inverse Markenfläche, Quelle der Historie als Umriss. */
.badge-env {
  border-color: var(--hs-slate-blue);
  background: transparent;
  color: var(--text-primary);
}

.badge-env-prod {
  border-color: var(--text-primary);
}

.badge-managed {
  gap: var(--space-1);
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
}

.badge-managed svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge-source {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-secondary);
}

.lock-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-brand-subtle);
  color: var(--text-body);
  font-size: var(--text-sm);
}

.lock-note svg {
  margin-top: 2px;
}

/* Gemeldete Probleme und Update-Historie: ruhige Listen mit Trennlinien. */
.issue-list,
.history-list {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.issue-list {
  border-top: 1px solid var(--border-subtle);
}

.history-list {
  margin-top: 0;
}

.issue-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.history-list li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.issue-list li:last-child,
.history-list li:last-child {
  border-bottom: 0;
}

.history-list time {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.history-change .with-logo {
  color: var(--text-body);
  font-weight: var(--weight-medium);
  white-space: normal;
}

.history-change .cell-sub {
  white-space: normal;
}

.logo-indent {
  padding-left: 24px;
}

/* Formulare im Dialog: Raster, Felder, Segment-Auswahl (Umgebung) und Kacheln (Distribution, Infrastruktur). */
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4) var(--space-5);
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--space-4) 0;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

/* `display: flex` oben überstimmt sonst die Regel des Browsers für [hidden]: im Assistenten bliebe beim manuellen Weg die Auswahl der
   Installations-Distribution sichtbar (SPEC-185-AC-04). */
.field[hidden] {
  display: none;
}

.field > label,
.field > .label {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.field .optional {
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
}

/* Nur Texteingaben (und Auswahllisten) füllen die Breite des Feldes und haben Feldhöhe; Kontrollkästchen und Auswahlpunkte in einem Feld behalten ihre Größe. :where() lässt die
   Spezifität der Regel unverändert. */
.field input:where(:not([type]), [type="text"], [type="email"], [type="url"], [type="tel"], [type="password"], [type="number"], [type="search"], [type="date"], [type="time"], [type="datetime-local"]),
.field select {
  width: 100%;
  height: 36px;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--hs-status-error);
}

.field .field-error {
  align-self: flex-start;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.section-messages:not(:empty) {
  margin-top: var(--space-3);
}

.section-messages .message {
  margin: 0;
}

.segmented {
  display: inline-flex;
  align-self: flex-start;
  padding: 2px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
}

.segmented label,
.choice-grid label {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.segmented label {
  height: 30px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: var(--space-2);
}

.choice-grid label {
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
}

/* Unsichtbare Auswahl auf 1 px: in Standardgröße lag sie über dem Anfang kurzer Beschriftungen („Prod“) und fing Klicks auf den Text ab. */
.segmented input,
.choice-grid input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.segmented label:has(input:checked),
.choice-grid label:has(input:checked) {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.choice-grid label:has(input:checked) {
  border-color: var(--text-primary);
}

.segmented label:has(input:focus-visible),
.choice-grid label:has(input:focus-visible) {
  outline: 2px solid var(--focus-ring);
}

.readonly-value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  color: var(--text-body);
}

.platform-form .field + .form-grid {
  margin-top: var(--space-4);
}

/* Token und Befehle: Festbreitenschrift, umbrechend; die Token-Box hebt sich mit dem Warnrand ab; „Kopieren“ klein als Umriss. */
.command-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: command;
}

.command-list > li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--space-3);
}

.command-list > li::before {
  counter-increment: command;
  content: counter(command);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-field);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

/* Umschalter „Kommandozeile“ oc | kubectl über den Befehlen (CHG-047): Schalter und Befehlsteil in einer Spalte, die Befehlsliste braucht dann keinen eigenen Abstand nach oben. */
.command-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.command-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.command-body .command-list {
  margin-top: 0;
}

.command-title {
  margin: 1px 0 var(--space-1);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.command,
.token-box {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-app);
}

.token-box {
  align-items: center;
  margin: 0 0 var(--space-3);
  border-color: var(--hs-status-warning);
}

.command code,
.token-box code {
  flex: 1;
  min-width: 0;
  color: var(--text-body);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

dialog .copy-button,
.plan-page .copy-button,
.wizard-step .copy-button {
  flex: none;
  min-height: 28px;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
}

dialog .copy-button svg,
.wizard-step .copy-button svg {
  width: 14px;
  height: 14px;
}

.full-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  text-align: center;
}

.full-state p {
  max-width: 34rem;
  margin: 0;
  color: var(--text-secondary);
}

.full-state .actions {
  margin-top: var(--space-3);
}

/* ==== Assistent „Cluster hinzufügen“ (SPEC-072) =========================================================================== */
/* Eigene Ansicht #cluster/neu: Rücklink, Seitenkopf mit Untertitel, Schrittanzeige (nur mit Agent) und je Schritt eine Karte (Baustein Karte).
   Auswahl und Fokus über die Auswahlfläche und den Fokusring (CD-05), erledigte Schritte mit ✓ auf der Erfolgsfarbe (Text immer dabei, CD-02);
   je Schritt höchstens eine primäre Aktion, kein Orange. */
.back-link.with-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.back-link svg,
.mode-title svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-head .page-sub {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
}

.stepper {
  display: flex;
  gap: var(--space-2);
  max-width: 64rem;
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.stepper[hidden] {
  display: none;
}

.stepper li {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.stepper .step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid var(--border-field);
  border-radius: 50%;
  font-size: var(--text-xs);
}

.stepper li[aria-current="step"] {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.stepper li[aria-current="step"] .step-no {
  border-color: var(--surface-selected);
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.stepper li.done {
  color: var(--text-primary);
}

.stepper li.done .step-no {
  border-color: var(--hs-status-success);
  background: var(--hs-status-success);
  color: var(--hs-on-status);
}

.wizard-form .form-grid,
.platform-fields {
  max-width: 44rem;
}

.mode-choice,
.platform-fields {
  min-width: 0;
  margin: 0 0 var(--space-5);
  padding: 0;
  border: 0;
}

.mode-choice legend,
.platform-fields legend {
  margin: 0 0 var(--space-2);
  padding: 0;
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.mode-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 22rem));
  gap: var(--space-3);
}

.mode-choice legend {
  grid-column: 1 / -1;
}

/* Der Baustein Formular setzt Beschriftungen im Inhaltsbereich als Block; Kacheln und Segmente im Assistenten bleiben Flex-Elemente. */
.portal-main .wizard-form .segmented label,
.portal-main .wizard-form .choice-grid label {
  display: inline-flex;
}

.portal-main .mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.mode-card input {
  position: absolute;
  opacity: 0;
}

/* Nicht wählbarer Weg (SPEC-185: Registry nicht ladbar): ohne Hand, Titel in Nebentextfarbe. */
.portal-main .mode-card:has(input:disabled) {
  cursor: not-allowed;
}

.mode-card:has(input:disabled) .mode-title {
  color: var(--text-secondary);
}

.mode-card:has(input:checked) {
  border-color: var(--text-primary);
  background: var(--surface-selected);
}

.mode-card:has(input:focus-visible) {
  outline: 2px solid var(--focus-ring);
}

.mode-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.mode-text {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.mode-card:has(input:checked) .mode-title,
.mode-card:has(input:checked) .mode-text {
  color: var(--text-on-selected);
}

.platform-fields {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.platform-fields .choice-grid {
  margin-top: var(--space-1);
}

.field .field-help {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.wizard-scroll > p {
  max-width: 64rem;
}

/* Feste App (UI-11, SPEC-157-AC-11): das Dokument ist nie höher als das Fenster; Rücklink, Seitenkopf, Schrittanzeige, Titel der Karte, Meldungen
   und die Aktionen der Karte stehen, nur der Inhalt der Karte („wizard-scroll“) scrollt, in allen drei Schritten und beim manuellen Weg.
   Die Karte (Baustein Karte, direktes Kind des Inhaltsbereichs) richtet sich nach ihrem Inhalt und schrumpft bis zur Resthöhe. Notlösung für sehr
   kleine Fenster: dann scrollt der Inhaltsbereich. */
body:has(.wizard-form, .wizard-step) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.portal-main:has(> .wizard-form, > .wizard-step) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.portal-main:has(> .wizard-form, > .wizard-step) > :not(.wizard-form, .wizard-step) {
  flex: none;
}

.portal-main:has(> .wizard-form, > .wizard-step) > .back-link {
  align-self: flex-start;
}

.wizard-form,
.wizard-step {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 0;
}

.wizard-form > :not(.wizard-scroll),
.wizard-step > :not(.wizard-scroll) {
  flex: none;
}

/* Innenabstand und gleich großer negativer Außenabstand lassen den Fokusring der Felder im Sichtbereich, ohne die Lage des Inhalts zu ändern. */
.wizard-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: calc(-1 * var(--space-1));
  padding: var(--space-1);
  overflow-y: auto;
}

.wizard-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.token-field {
  margin: 0 0 var(--space-5);
}

.token-field .token-box {
  margin: 0;
}

.wait-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.wait-row .wait-name {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.wait-row .wait-meta {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.facts.wizard-facts {
  margin-top: var(--space-4);
}

@media (max-width: 900px) {
  .detail-grid,
  .facts.facts-3,
  .facts.facts-5,
  .form-grid,
  .form-grid.three,
  .mode-choice {
    grid-template-columns: minmax(0, 1fr);
  }

  .stepper {
    flex-direction: column;
  }
}

/* ==== Versionsquellen (helvascale, SPEC-079) =============================================================================== */
/* Tabelle „Quellen je Distribution“: feste Spaltenaufteilung, Gruppen je Distribution mit Trennlinie, URL in Festbreitenschrift. Status immer
   mit Icon und Text (CD-02): ok auf der Erfolgsfarbe, Fehler auf der Fehlerfarbe, „nicht verfügbar“ und „noch nicht abgerufen“ gedämpft. */
.portal-main > .message-warning {
  max-width: none;
}

.portal-main .src-table {
  width: 100%;
  table-layout: fixed;
  min-width: 1080px;
}

.src-table col.s-dist { width: 13%; }
.src-table col.s-source { width: 30%; }
.src-table col.s-channel { width: 10%; }
.src-table col.s-last { width: 13%; }
.src-table col.s-result { width: 14%; }
.src-table col.s-status { width: 20%; }
.src-table col.s-edit { width: 56px; }

.portal-main .src-table th,
.portal-main .src-table td {
  height: auto;
  padding: var(--space-2) var(--space-2);
  vertical-align: top;
}

.portal-main .src-table th:first-child,
.portal-main .src-table td:first-child {
  padding-left: var(--space-4);
}

.portal-main .src-table th:last-child,
.portal-main .src-table td:last-child {
  padding-right: var(--space-4);
  text-align: right;
}

.portal-main .src-table tbody td {
  height: 56px;
}

.portal-main .src-table tr.group-start td {
  border-top: 1px solid var(--border-default);
}

.src-table time,
.src-table .cell-sub {
  display: block;
}

.src-url {
  display: block;
  overflow: hidden;
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.src-kind {
  display: block;
  margin-bottom: 2px;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.src-status {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-align: left;
}

.src-status svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
}

.src-status .state-fill {
  stroke: none;
}

.src-status-ok .state-fill {
  fill: var(--hs-status-success);
}

.src-status-ok .state-mark,
.src-status-error .state-mark {
  fill: none;
  stroke: var(--hs-on-status);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.src-status-error .state-fill {
  fill: var(--hs-status-error);
}

.src-status-na {
  color: var(--text-secondary);
}

.src-status-na svg {
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.src-status-text {
  display: flex;
  flex-direction: column;
}

.src-status .cell-sub {
  white-space: normal;
  font-weight: var(--weight-regular);
}

.badge-approx {
  height: 18px;
  margin-left: var(--space-1);
  padding: 0 6px;
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
}

.portal-main .src-table td .row-action svg {
  width: 15px;
  height: 15px;
}

.src-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.src-note svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==== Bereich Updates › Board (SPEC-089, IDEA-021) ========================================================================== */
/* Status-Badges (CD-02, Ausnahme „Update-Status und Umgebung“): immer Symbol und Text, Farben nur über die Tokens --upd-* aus brand.css;
   in Hell und Dunkel dieselben Flächen. Größe „small“ für Kalender und Zeilen (SPEC-090/091). */
.upd-badge {
  gap: 4px;
}

.upd-badge svg {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upd-planned {
  border-color: var(--upd-planned-border);
  background: transparent;
  color: var(--text-primary);
}

.upd-approved {
  background: var(--upd-approved-bg);
  color: var(--upd-approved-text);
}

.upd-ongoing {
  background: var(--upd-ongoing-bg);
  color: var(--upd-ongoing-text);
}

.upd-done {
  background: var(--upd-done-bg);
  color: var(--upd-done-text);
}

.upd-cancelled {
  border-color: var(--border-default);
  background: var(--surface-lane);
  color: color-mix(in srgb, var(--text-secondary) 75%, var(--text-body));
}

.upd-missed {
  background: var(--upd-missed-bg);
  color: var(--upd-missed-text);
}

.upd-badge.small {
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
}

.upd-badge.small svg {
  width: 11px;
  height: 11px;
}

/* Seitenkopf mit Untertitel, Werkzeugleiste (Umgebung, Suche, Zonenangabe). */
.page-head .page-sub {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
}

.page-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.page-tools[hidden] {
  display: none;
}

.page-tools .toolbar-spacer {
  flex: 1;
}

.page-tools .segmented label {
  height: 26px;
  padding: 0 var(--space-3);
}

.page-tools .search-input {
  position: relative;
  flex: 0 1 15rem;
}

.page-tools .search-input svg {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.page-tools input[type="search"] {
  width: 100%;
  height: var(--control-height);
  padding: 0 var(--space-2) 0 28px;
  font-size: var(--text-sm);
}

.page-tools input[type="search"]::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.tz-note {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.tz-note svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Board: sechs Spalten, nur Anzeige (kein Ziehen). Bei Überbreite scrollt das Board in seiner Fläche, die Seite nicht. */
.board-content {
  min-width: 0;
  overflow-x: auto;
}

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(11rem, 1fr));
  gap: var(--space-3);
  align-items: stretch;
}

/* Spaltenkopf (Badge, Anzahl, „letzte 30 Tage“) haftet am oberen Rand der Fläche des Boards (SPEC-089-AC-10, UI-11); die Spalten sind gleich hoch, damit jeder Kopf stehen bleibt. */
.lane-top {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-lane);
}

.lane {
  min-width: 0;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-lane);
}

.lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 28px;
  padding: 0 var(--space-1);
}

.lane-count {
  color: color-mix(in srgb, var(--text-secondary) 75%, var(--text-body));
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

.lane-note {
  margin: 0;
  padding: 0 var(--space-1);
  color: color-mix(in srgb, var(--text-secondary) 75%, var(--text-body));
  font-size: var(--text-xs);
}

.lane-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.lane-empty {
  margin: 0;
  padding: var(--space-3) var(--space-1);
  color: color-mix(in srgb, var(--text-secondary) 75%, var(--text-body));
  font-size: var(--text-sm);
  text-align: center;
}

.portal-main button.lane-more {
  display: block;
  min-height: 0;
  margin: var(--space-2) var(--space-1) 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-link);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-align: left;
}

.portal-main button.lane-more:hover:not(:disabled) {
  border: 0;
  background: transparent;
  text-decoration: underline;
}

.upd-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-xs);
  text-decoration: none;
}

a.upd-card:hover {
  border-color: var(--border-field);
}

a.upd-card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.upd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.upd-cluster {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upd-card .badge-env,
.upd-card-foot .badge-managed {
  flex: none;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
}

.upd-version {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.upd-version .brand-logo {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.upd-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.upd-line > svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upd-person .owner-avatar {
  width: 18px;
  height: 18px;
  font-size: 8px;
}

.upd-person > span:last-child {
  min-width: 0;
  overflow: hidden;
  color: var(--text-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upd-role {
  color: var(--text-secondary);
}

.skeleton-card {
  gap: var(--space-2);
}

/* Leerzustand und „nicht erreichbar“ wie bei den Clusters; „Zu den Clusters“ ist ein Link in der Form der primären Aktion. */
.board-content > .cluster-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  text-align: center;
}

.portal-main a.button {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--action-primary);
  border-radius: var(--radius-sm);
  background: var(--action-primary);
  color: var(--action-primary-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.portal-main a.button:hover {
  border-color: var(--action-primary-hover);
  background: var(--action-primary-hover);
}

/* ==== Update planen (SPEC-087, IDEA-021) =================================================================================== */
/* Spalte „Update“ am Zeilenende: offenes Update als Link (Badge und Termin) bzw. „Update planen“, danach der Pfeil (PO-Entscheidung E-16). */
.cluster-table.plan col.c-open { width: 164px; }
.cluster-table.plan col.c-last { width: 11.5%; }

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.row-update-slot {
  display: inline-flex;
  align-items: center;
}

.row-update-slot:empty {
  display: none;
}

/* Platzhalter der Box „Update planen“ im Cluster-Detail (SPEC-087-AC-18): ohne Aktion keine leere Box. */
.plan-box-slot:empty {
  display: none;
}

button.plan-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

button.plan-button:hover:not(:disabled) {
  border-color: var(--text-primary);
  background: var(--surface-hover);
}

button.plan-button:disabled,
dialog button.plan-button:disabled,
.plan-page button.plan-button:disabled {
  border-color: var(--border-default);
  background: var(--surface-card);
  color: var(--text-secondary);
  opacity: 1;
  cursor: not-allowed;
}

button.plan-button svg {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button.plan-button.detail-plan {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

dd .row-update-slot {
  display: flex;
  margin-top: var(--space-2);
}

.row-update {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  color: var(--text-link);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row-update:hover .row-update-when {
  text-decoration: underline;
}

.page-notices [hidden] {
  display: none;
}

.page-notices > .message,
.page-notices > .plan-success > .message {
  max-width: none;
  margin: 0 0 var(--space-4);
}

.page-notices .message a {
  margin-left: var(--space-2);
  color: inherit;
  font-weight: var(--weight-medium);
}

/* Ansicht „Update planen“ (CHG-033, SPEC-087-AC-15; ersetzt das Plan-Pop-up) – Feste App (UI-11): Kopf, Reiter und Auswahl stehen, in der Karte scrollt nur der
   Formularinhalt (.plan-page-body), der Fuß mit den Aktionen steht darunter. Notlösung für sehr kleine Fenster: dann scrollt der Inhaltsbereich. Farben nur über Tokens. */
body:has(.plan-page) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.portal-main:has(> .plan-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.plan-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 30rem;
}

.plan-page > * {
  flex: none;
}

.plan-page [hidden] {
  display: none;
}

.plan-page > .tabs {
  margin-bottom: var(--space-3);
}

.plan-page-top {
  padding-bottom: var(--space-3);
}

.plan-chooser-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: var(--space-3) var(--space-4);
}

.plan-chooser-row.with-tenant {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-chooser .field {
  margin: 0;
}

.plan-chooser .field-help {
  margin: var(--space-1) 0 0;
}

.plan-page > .plan-page-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.plan-page-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  overflow-y: auto;
}

.plan-page-body:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.plan-page-foot {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.plan-empty {
  margin: var(--space-3) 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.plan-sub:empty {
  display: none;
}

.plan-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-2) 0 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.plan-sub strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.plan-messages:not(:empty) {
  margin-top: var(--space-3);
}

.plan-section {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.plan-section:last-child {
  border-bottom: 0;
}

.plan-section .section-head h3 {
  font-size: var(--text-base);
}

.plan-section .lock-note {
  margin-bottom: var(--space-3);
}

.plan-section > .field-error,
.plan-help {
  margin: var(--space-2) 0 0;
}

.plan-section > .field + .field {
  margin-top: var(--space-3);
}

dialog .form-grid.plan-grid-4,
.plan-page .form-grid.plan-grid-4 {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
}

dialog .form-grid.plan-grid-2,
.plan-page .form-grid.plan-grid-2 {
  gap: var(--space-3) var(--space-4);
}

.target-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

dialog .target-grid label,
.plan-page .target-grid label {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
}

.target-main {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.target-sub {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}

dialog .target-grid label:has(input:checked) .target-main,
.plan-page .target-grid label:has(input:checked) .target-main,
dialog .target-grid label:has(input:checked) .target-sub,
.plan-page .target-grid label:has(input:checked) .target-sub {
  color: var(--text-on-selected);
}

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

.role-grid + .role-group {
  margin-top: var(--space-4);
}

.role-group {
  margin: 0 0 var(--space-3);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.role-group .optional {
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
}

.role-field {
  position: relative;
}

/* Weitere Approver (CHG-052): je Person eine Auswahl mit „−“, darunter „+ Weiteren Approver hinzufügen“. */
.extra-approvers {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.extra-approvers-list {
  display: grid;
  gap: var(--space-2);
}

.extra-approver-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-2);
}

.extra-approvers > button {
  justify-self: start;
}

.role-hs-box {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.lock-title {
  font-weight: var(--weight-semibold);
}

dialog textarea,
.plan-page textarea {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
}

/* Benutzerauswahl: wie ein Auswahlfeld, mit Avatar; die Liste liegt fest positioniert über dem Dialog (Muster TAM-Auswahl). */
dialog .user-pick,
.plan-page .user-pick {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  background: var(--surface-field);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  text-align: left;
}

dialog .user-pick:hover:not(:disabled),
.plan-page .user-pick:hover:not(:disabled) {
  border-color: var(--text-primary);
  background: var(--surface-field);
}

dialog .user-pick.empty,
.plan-page .user-pick.empty {
  color: var(--text-secondary);
}

dialog .user-pick.invalid,
.plan-page .user-pick.invalid {
  border-color: var(--hs-status-error);
}

.user-pick > span:not(.owner-avatar) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pick svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-pick .pick-chevron {
  margin-left: auto;
  color: var(--text-secondary);
}

.user-pick .owner-avatar {
  width: 22px;
  height: 22px;
}

.picker-option svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.picker-option.pick-clear {
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text-secondary);
}

.plan-foot {
  align-items: center;
}

.plan-foot-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 auto 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.plan-foot-note svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

@media (max-width: 720px) {
  dialog .form-grid.plan-grid-4,
  .plan-page .form-grid.plan-grid-4,
  .role-grid,
  .target-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==== Pop-up „Update-Details“ (SPEC-088) ===================================================================================== */
/* Aufbau wie das Detail-Pop-up eines Clusters: Kopf mit Titel und Badges, Überblick, darunter zwei Spalten (Plan und Kommentare links,
   Beteiligte und Verlauf rechts), Fuß mit Hinweis links und Knöpfen rechts. Farben nur über Tokens (CD-02, CD-06). */
.upd-detail .detail-head {
  align-items: flex-start;
}

.upd-detail .detail-title h2 {
  font-variant-numeric: tabular-nums;
}

.detail-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.upd-detail .facts.facts-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.upd-detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.count-inline {
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
}

.detail-card p.plan-text,
.detail-card p.comment-body {
  margin: 0;
  color: var(--text-body);
  font-size: var(--text-sm);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.role-list {
  margin: 0;
}

.role-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-height: 34px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.role-list .role-row:last-child {
  border-bottom: 0;
}

.role-row dt {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.role-row dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px var(--space-2);
  margin: 0;
  color: var(--text-body);
  font-size: var(--text-sm);
}

.role-sub {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.role-approved {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.role-approved svg,
.role-info svg,
.small-action svg,
.detail-note svg,
.new-version-form button svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.role-hs,
.role-open {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.role-info {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  box-sizing: border-box;
  align-self: center;
  max-width: 100%;
  margin: 0 0 0 auto;
  padding: 3px var(--space-2);
  border: 1px solid color-mix(in srgb, var(--status-info-icon) 35%, var(--border-default));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--status-info-icon) 8%, var(--surface-card));
  color: var(--text-primary);
  font-size: var(--text-xs);
}

.detail-card p.role-info {
  margin: 0 0 0 auto;
  font-size: var(--text-xs);
}

.role-info svg {
  color: var(--status-info-icon);
}

dialog button.small-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
}

dialog button.link-button {
  display: block;
  min-height: 0;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-link);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

dialog button.link-button:hover:not(:disabled) {
  border: 0;
  background: none;
  text-decoration: underline;
}

.reschedule-form {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.status-history li {
  grid-template-columns: 8.5rem minmax(0, 1fr);
}

.status-history .history-change {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.status-history .history-change .cell-sub {
  margin: 0;
  white-space: normal;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.comment {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--space-2);
}

.detail-card p.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-1);
  margin: 0;
  color: var(--text-body);
  font-size: var(--text-sm);
}

.comment-meta time {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.comment-meta .owner-logomark {
  vertical-align: middle;
}

.comment-form,
.new-version-form {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.comment-form textarea {
  flex: 1;
  min-width: 0;
  resize: vertical;
}

.new-version-form .field {
  flex: 1;
}

.new-version-form button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.detail-actions {
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--surface-card);
}

.detail-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.detail-note .message.inline {
  margin: 0;
}

.detail-buttons {
  display: flex;
  flex: none;
  gap: var(--space-2);
}

dialog .detail-buttons button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .upd-detail .facts.facts-4,
  .upd-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-actions {
    flex-wrap: wrap;
  }
}

/* Updates › Kalender (SPEC-090): Wochenzeilen Mo–So, Kopfzeile bleibt stehen, das Raster scrollt senkrecht in seiner Fläche. Umgebung als
   Randstreifen links und leichte Tönung (CD-02, Ausnahme „Update-Status und Umgebung“), immer mit Legende; Farben nur über Tokens. */
.page-tools button.secondary {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
}

.page-tools button.secondary:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ==== Updates im helvascale-Frontend (SPEC-091): Reiter Board/Kalender, Kontrollkästchen, Kunde auf Karte und Eintrag, Hinweis ==== */
/* Reiter: gewählt mit der Auswahlfläche (CD-05: hell Frosted Breeze, dunkel Icy Blue). */
.tabs {
  display: flex;
  gap: var(--space-1);
}

.portal-main .tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.portal-main .tabs .tab:hover:not(:disabled) {
  border-color: var(--border-default);
  background: var(--surface-hover);
}

.portal-main .tabs .tab[aria-selected="true"],
.portal-main .tabs .tab[aria-selected="true"]:hover {
  border-color: var(--surface-selected);
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.tabs .tab svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-tools label.check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.page-tools label.check:has(input:disabled) {
  color: var(--text-secondary);
}

.page-tools .legend[hidden] {
  display: none;
}

.upd-kunde {
  margin-top: -4px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.cal-kunde {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upd-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.upd-hint svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  color: var(--hs-status-warning);
}

.legend {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-body);
  font-size: var(--text-sm);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border-left: 3px solid var(--env-prod);
  border-radius: 3px;
  background: var(--env-prod-surface);
}

.legend-swatch.env-nonprod {
  border-left-color: var(--env-nonprod);
  background: var(--env-nonprod-surface);
}

.cal {
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.cal-scroll {
  position: relative;
  height: calc(100vh - 262px);
  min-height: 360px;
  overflow-y: auto;
}

.cal-head,
.cal-week {
  display: grid;
  grid-template-columns: 112px repeat(7, minmax(0, 1fr));
}

.cal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-card);
}

.cal-head > div {
  padding: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.cal-week {
  min-height: 116px;
  border-bottom: 1px solid var(--border-subtle);
}

.cal-asap {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-card);
}

.cal-asap-label {
  justify-content: center;
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.cal-asap-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  min-width: 0;
  padding: 6px;
}

.cal-asap-list .cal-entry {
  flex: 0 1 220px;
}

@media (max-width: 900px) {
  .cal-asap {
    grid-template-columns: 56px minmax(0, 1fr);
  }
}

.cal-week:last-child {
  border-bottom: 0;
}

.cal-head > .cal-corner {
  padding-left: var(--space-3);
}

.cal-weeklabel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.cal-kw {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.cal-range {
  font-size: var(--text-xs);
  line-height: 1.4;
}

.cal-week.current .cal-weeklabel {
  background: var(--surface-brand-subtle);
}

.cal-week.current .cal-day:not(.weekend) {
  background: color-mix(in srgb, var(--surface-brand-subtle) 45%, var(--surface-card));
}

.cal-week.current .cal-day.weekend {
  background: color-mix(in srgb, var(--surface-brand-subtle) 45%, var(--surface-app));
}

@media (max-width: 900px) {
  .cal-head,
  .cal-week {
    grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  }

  .cal-range {
    display: none;
  }
}

.cal-day {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  padding: 6px;
  border-right: 1px solid var(--border-subtle);
}

.cal-day:last-child {
  border-right: 0;
}

.cal-day.past {
  background: color-mix(in srgb, var(--surface-app) 50%, var(--surface-card));
}

.cal-day.weekend {
  background: var(--surface-app);
}

.cal-date {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding-left: 2px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

.cal-today-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--action-primary);
  color: var(--action-primary-text);
  font-weight: var(--weight-semibold);
}

.cal-today-label {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.cal-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 4px 6px 5px 7px;
  border-left: 3px solid var(--env-prod);
  border-radius: 4px;
  background: var(--env-prod-surface);
  color: var(--text-body);
  font-size: var(--text-xs);
  text-decoration: none;
}

.cal-entry.env-nonprod {
  border-left-color: var(--env-nonprod);
  background: var(--env-nonprod-surface);
}

a.cal-entry:hover .cal-cluster {
  text-decoration: underline;
}

a.cal-entry:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.cal-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cal-time {
  flex: none;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.cal-cluster {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-managed {
  display: inline-flex;
  color: var(--text-primary);
}

.cal-managed svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cal-entry.skeleton-entry {
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-default);
  background: var(--surface-card);
}

/* ==== Feste App für Board (und Kalender im helvascale-Frontend) der Updates (UI-11, SPEC-102-AC-15, SPEC-104-AC-11) ====================== */
/* Das Dokument ist nie höher als das Fenster; Kopf und Werkzeugleiste stehen, nur der Inhalt des Boards scrollt. */
body:has(.portal-main > .board-content) {
  height: 100vh;
  overflow: hidden;
}

.portal-main:has(> .board-content) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.portal-main:has(> .board-content) > * {
  flex: none;
}

.portal-main:has(> .board-content) > .board-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Der Kalender im Inhalt füllt den verbleibenden Platz, sein Raster scrollt für sich. */
.board-content:has(> .cal) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.board-content > .cal {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.board-content > .cal > .cal-scroll {
  flex: 1 1 auto;
  height: auto;
}

/* ==== Bereich AppCare › Apps (SPEC-099) ==================================================================================== */
/* Feste App (UI-11): das Dokument ist nie höher als das Fenster; Kopf, Werkzeugleiste und Hinweis stehen, nur der Bereich mit den Karten
   („Prod“, „Non-Prod“) scrollt, der Tabellenkopf bleibt stehen. Notlösung für sehr kleine Fenster: dann scrollt der Inhaltsbereich unter
   Kopfzeile und Navigation. */
body:has(.apps-page) {
  height: 100vh;
  overflow: hidden;
}

.portal-main:has(> .apps-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.apps-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.apps-page > .page-head,
.apps-page > .apps-slot,
.apps-page > .apps-hint-slot {
  flex: none;
}

.apps-page > .page-head {
  margin-bottom: var(--space-3);
}

.apps-page .page-head .page-sub {
  margin: var(--space-1) 0 0;
}

.apps-page .apps-slot:empty,
.apps-page .apps-hint-slot:empty {
  display: none;
}

.apps-page .apps-slot .toolbar {
  padding: 0 0 var(--space-3);
  border-bottom: 0;
}

/* Ein Scrollbereich für beide Karten; er scrollt auch waagrecht, wenn die Tabellen breiter sind als das Fenster. Die Karten behalten
   ihre Mindestbreite und schneiden mit overflow: clip (kein Scrollcontainer), damit der Tabellenkopf am Scrollbereich haftet. */
.apps-page .apps-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.apps-page .apps-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.apps-page .apps-scroll > section {
  min-width: 1100px;
}

.apps-page .apps-scroll > .table-card {
  overflow: clip;
}

.apps-page .apps-scroll > .cluster-state {
  min-width: 0;
}

.apps-page .table-scroll {
  overflow: visible;
}

.portal-main .apps-table {
  min-width: 1100px;
}

.apps-table col.a-app { width: 14%; }
.apps-table col.a-type { width: 8%; }
.apps-table col.a-cluster { width: 10%; }
.apps-table col.a-chart { width: 15%; }
.apps-table col.a-current { width: 12%; }
.apps-table col.a-latest { width: 18%; }
.apps-table col.a-last { width: 10%; }
.apps-table col.a-open { width: 40px; }
.apps-table col.a-update { width: 150px; }

.portal-main .apps-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-default);
}

.portal-main .apps-table td.update-cell {
  text-align: right;
}

.portal-main .apps-table td:nth-last-child(2) {
  padding-right: var(--space-2);
  text-align: right;
}

/* Typ: Logo (Helm, Operator Framework, Argo; CD-02 „Fremdmarken-Logos“) bzw. einfarbiges Strichsymbol in der Textfarbe (Selektor) plus Text. */
.type-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  white-space: nowrap;
}

/* In der App-Tabelle trägt das Symbol die Textfarbe der Zelle (SPEC-099-AC-16). */
.apps-table .type-tag {
  color: inherit;
}

.type-tag svg:not(.brand-logo) {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cell-quiet {
  color: var(--text-secondary);
}

/* Werkzeugleiste: Suche mit Symbol, Typ als Segmentschalter, Cluster-Auswahl, „Nur mit Update“. */
.apps-page .toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.apps-page .toolbar .search-input {
  position: relative;
  flex: 0 1 18rem;
}

.apps-page .toolbar .search-input svg {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
}

.apps-page .toolbar input[type="search"] {
  box-sizing: border-box;
  width: 100%;
  height: var(--control-height);
  padding-left: 28px;
  font-size: var(--text-sm);
}

.apps-page .toolbar .segmented {
  align-self: center;
}

.apps-page .toolbar select {
  height: var(--control-height);
  font-size: var(--text-sm);
}

.apps-page .toolbar label.check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

/* Hinweis „keine Repositories“: Info (Hinweisfarbe), nie Warnfarbe und nie Orange. */
.apps-hint {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--status-info-icon) 35%, var(--border-default));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--status-info-icon) 6%, var(--surface-card));
  color: var(--text-primary);
}

.apps-hint .ver-icon {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}

.apps-hint .upd-fill {
  fill: var(--status-info-icon);
  stroke: none;
}

.apps-hint .upd-mark {
  fill: none;
  stroke: var(--status-info-icon-mark);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.apps-hint a {
  margin-left: var(--space-2);
  white-space: nowrap;
}

/* Detail „App-Details“: Kopf mit Name, Badges und der Zeile „Typ · Cluster · Namespace“. */
.detail-head-main {
  min-width: 0;
}

.detail-head-main .detail-sub {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ==== Bereich AppCare › Repositories (SPEC-100) ============================================================================ */
/* Feste App (UI-11): das Dokument ist nie höher als das Fenster; Kopf, Meldungen und der Kopf der Karte stehen, nur der Tabellenkörper der Karte
   „Repositories“ scrollt (der Tabellenkopf haftet am Scrollbereich). Notlösung für sehr kleine Fenster: dann scrollt der Inhaltsbereich. */
body:has(.repos-page) {
  height: 100vh;
  overflow: hidden;
}

.portal-main:has(> .repos-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.repos-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.repos-page > .page-head,
.repos-page > .repos-notices {
  flex: none;
}

.repos-page > .page-head {
  margin-bottom: var(--space-3);
}

.repos-page .page-head .page-sub {
  margin: var(--space-1) 0 0;
}

.repos-notices > div:empty {
  display: none;
}

/* Meldungen über der Tabelle: getönte Fläche aus der Statusfarbe, Text in der Textfarbe, Symbol in der Statusfarbe (Rückmeldung, nie Aktion). */
.repos-notices .message {
  max-width: none;
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
}

.repos-notices .message-success {
  border-color: color-mix(in srgb, var(--hs-status-success) 40%, var(--border-default));
  background: color-mix(in srgb, var(--hs-status-success) 6%, var(--surface-card));
}

.repos-notices .message-success svg {
  stroke: var(--hs-status-success);
}

.repos-notices .message-error {
  border-color: color-mix(in srgb, var(--hs-status-error) 40%, var(--border-default));
  background: color-mix(in srgb, var(--hs-status-error) 6%, var(--surface-card));
}

.repos-notices .message-error svg {
  stroke: var(--hs-status-error);
}

.repos-notices .message-warning {
  border-color: color-mix(in srgb, var(--hs-orange) 45%, var(--border-default));
  background: color-mix(in srgb, var(--hs-orange) 7%, var(--surface-card));
}

.repos-notices .message-info {
  border-color: color-mix(in srgb, var(--status-info-icon) 35%, var(--border-default));
  background: color-mix(in srgb, var(--status-info-icon) 6%, var(--surface-card));
}

.repos-notices .message-info svg {
  stroke: var(--status-info-icon);
}

.repos-page .repos-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.repos-content > .table-card {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.repos-content > .cluster-state {
  margin-bottom: 0;
}

.repos-content .table-card .card-head {
  flex: none;
}

.repos-content .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.portal-main .repo-table {
  min-width: 900px;
}

.repo-table col.r-name { width: 19%; }
.repo-table col.r-url { width: 27%; }
.repo-table col.r-access { width: 15%; }
.repo-table col.r-status { width: 20%; }
.repo-table col.r-fetch { width: 12%; }
.repo-table col.r-actions { width: 120px; }

.portal-main .repo-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-default);
}

.portal-main .repo-table td {
  vertical-align: middle;
}

.portal-main .repo-table td:last-child {
  text-align: right;
}

.repo-table .cell-sub {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==== Repositories aufklappen: Pfeil, Panel „Charts in <Name>“ (SPEC-198) ============================================================ */
/* Die erste Spalte trägt den Pfeil; das Panel steht als volle Zeile unter dem Repository und fließt im Scrollbereich der Tabelle mit (UI-11). */
.repo-table.expandable col.r-toggle { width: 40px; }

.portal-main .repo-table.expandable td:first-child,
.portal-main .repo-table.expandable th:first-child {
  padding-right: 0;
}

.repo-toggle {
  display: inline-grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
}

.repo-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .15s;
}

.repo-toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
  .repo-toggle svg { transition: none; }
}

.portal-main .repo-table tr.repo-open > td {
  border-bottom: 0;
}

.portal-main .repo-table tr.repo-charts > td {
  height: auto;
  padding: 0 var(--space-4) var(--space-4) 52px;
  overflow: visible;
  text-align: left;
  vertical-align: top;
}

.portal-main .repo-table tr.repo-charts:hover > td {
  background: transparent;
}

.charts-panel {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.charts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.charts-head h3 {
  margin: 0;
  font-size: var(--text-sm);
}

.charts-head .count {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.charts-head .segmented {
  align-self: center;
}

.charts-head .search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 14rem;
  margin-left: auto;
}

.charts-head .search svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.portal-main .charts-head .search input {
  width: 100%;
  padding-left: 34px;
  font-size: var(--text-sm);
}

.charts-state {
  margin: 0;
  padding: var(--space-4);
  color: var(--text-secondary);
}

.charts-loading {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

.charts-devel-hint {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-default);
}

/* Die Tabelle im Panel erbt die Regeln der Repositories-Tabelle (Abstände, Kopf haftet, rechtsbündige letzte Spalte); hier zurückgesetzt. */
.portal-main .repo-table .charts-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.charts-table col.c-toggle { width: 40px; }
.charts-table col.c-chart { width: 22%; }
.charts-table col.c-latest { width: 16%; }
.charts-table col.c-app { width: 14%; }

.portal-main .repo-table .charts-table th,
.portal-main .repo-table .charts-table td,
.portal-main .repo-table .charts-table tbody td {
  height: auto;
  padding: var(--space-2) var(--space-3);
  overflow: hidden;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

.portal-main .repo-table .charts-table thead th {
  position: static;
  vertical-align: bottom;
}

.portal-main .repo-table .charts-table td:first-child,
.portal-main .repo-table .charts-table th:first-child {
  padding-left: var(--space-3);
  padding-right: 0;
}

.charts-table td .cell-main {
  display: block;
  font-weight: var(--weight-medium);
}

.charts-table td .cell-main.chart-description {
  font-weight: var(--weight-regular);
}

.charts-table td .cell-sub {
  display: block;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.portal-main .repo-table .charts-table tr.chart-versions > td {
  padding-top: 0;
  background: transparent;
  overflow: visible;
}

.ver-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--space-1) var(--space-3);
  margin: 0;
  padding: var(--space-2) 0 var(--space-2) 28px;
  list-style: none;
}

.ver-list li {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.ver-list .ver-date {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* Kennzeichen „devel“ (Vorabversion) und „deprecated“ (zurückgezogen): Text im Umriss, nie allein über Farbe (CD-02). */
.tag-devel {
  display: inline-block;
  padding: 0 6px;
  border: 1px dashed var(--border-field);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: var(--weight-medium);
}

/* Adresse in Festbreitenschrift, bei Überlänge gekürzt (die vollständige Adresse steht im Tooltip); nie ein Link. */
.repo-url {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status: Symbol und Text (CD-02: Statusfarben nur als Rückmeldung, Zustand nie allein über Farbe). */
.repo-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: var(--weight-medium);
}

.repo-status svg,
.access-tag svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.repo-status.ok svg {
  stroke: var(--hs-status-success);
}

.repo-status.error svg {
  stroke: var(--hs-status-error);
}

.repo-status.pending svg {
  stroke: var(--text-secondary);
}

.access-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.access-tag svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* Aktionen: drei Symbolknöpfe als Umriss (leiser als die primäre Aktion), „Jetzt abrufen“ zeigt beim Abruf einen Ladekreis. */
.icon-actions {
  display: inline-flex;
  gap: var(--space-1);
}

.icon-actions button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
}

.icon-actions button:hover:not(:disabled) {
  background: var(--surface-hover);
}

.icon-actions button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-actions .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-default);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: repo-spin 0.9s linear infinite;
}

@keyframes repo-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .icon-actions .spinner { animation: none; }
}

/* Dialog Repository: Felder untereinander, Zugangsdaten als eigene Gruppe mit Benutzername und Passwort nebeneinander. */
.repo-credentials {
  min-width: 0;
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.repo-credentials legend {
  padding: 0 var(--space-1);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.repo-credentials .cred-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr 1fr;
}

.repo-credentials .repo-note {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.check-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.check-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
}

dialog .section-messages:not(:empty),
.plan-page .section-messages:not(:empty) {
  margin-top: var(--space-3);
}

@media (max-width: 600px) {
  .repo-credentials .cred-grid {
    grid-template-columns: 1fr;
  }
}

/* ==== App-Updates auf Board, Kalender, Pop-up (SPEC-102) ===================================================================== */
/* Karte: Typ-Symbol statt Distributions-Logo in der Textfarbe, Untertitel „{Typ} · {Cluster}“ und Kanalwechsel. */
.upd-version > svg {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upd-card .upd-sub,
.upd-card .upd-chan {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* Kalender: kleines Typ-Symbol vor dem Namen in der Farbe der Umgebung (Prod Royal Blue, Dunkelmodus Icy Blue; Non-Prod Slate Blue). */
.cal-entry .cal-type {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--env-prod);
}

.cal-entry.env-nonprod .cal-type {
  color: var(--env-nonprod);
}

.cal-line > .cal-type {
  align-self: center;
  margin-right: -2px;
}

/* Zieloptionen mit Kanal (Operator): Kanal gedämpft, „Kanalwechsel“ als Pille. */
.target-main .chan {
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
}

.target-grid .target-tag {
  display: inline-block;
  margin-left: var(--space-1);
  padding: 0 6px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: var(--weight-medium);
}

dialog .target-grid label:has(input:checked) .target-main .chan,
.plan-page .target-grid label:has(input:checked) .target-main .chan,
dialog .target-grid label:has(input:checked) .target-tag,
.plan-page .target-grid label:has(input:checked) .target-tag {
  color: var(--text-on-selected);
}

.plan-sub .type-tag {
  font-weight: var(--weight-semibold);
}

/* Zusammenfassungsbox unter der Schrittleiste (CHG-059, SPEC-087-AC-24): Kopfzeile und Kacheln über die volle Breite, Tokens wie die Karten. */
.plan-summary {
  margin: var(--space-3) 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.plan-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: var(--text-base);
}

.plan-summary-head strong {
  font-weight: var(--weight-semibold);
}

.plan-summary-customer {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.plan-summary-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.plan-summary-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 1px solid var(--border-subtle);
}

.plan-summary-tile:first-child {
  border-left: 0;
}

.plan-summary-key {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.plan-summary-value {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-width: 0;
}

.reschedule-target:empty {
  display: none;
}

/* ==== helvascale › AppCare (SPEC-103) ======================================================================================= */
/* Reiter „Apps“ | „Repositories“ unter dem Seitenkopf (Navigation „Ansicht“); der aktive trägt aria-current="page". Auswahl in Frosted Breeze bzw. im
   Dunkelmodus Icy Blue über die Auswahl-Tokens (CD-05), sonst Umriss. */
.apps-page > .view-tabs,
.repos-page > .view-tabs {
  flex: none;
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0 0 var(--space-3);
}

.portal-main .view-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.portal-main .view-tabs a:hover {
  background: var(--surface-hover);
}

.portal-main .view-tabs a[aria-current="page"],
.portal-main .view-tabs a[aria-current="page"]:hover {
  border-color: var(--surface-selected);
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.portal-main .view-tabs a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Mit der Spalte „Kunde“ (helvascale) sind die Tabellen breiter; die Spaltenbreiten bleiben in beiden Karten gleich. */
.apps-page .apps-scroll > section:has(.apps-table.with-customer) {
  min-width: 1260px;
}

.portal-main .apps-table.with-customer {
  min-width: 1260px;
}

.apps-table.with-customer col.a-customer { width: 12%; }
.apps-table.with-customer col.a-app { width: 13%; }
.apps-table.with-customer col.a-type { width: 8%; }
.apps-table.with-customer col.a-cluster { width: 10%; }
.apps-table.with-customer col.a-chart { width: 13%; }
.apps-table.with-customer col.a-current { width: 11%; }
.apps-table.with-customer col.a-latest { width: 13%; }
.apps-table.with-customer col.a-last { width: 9%; }

.portal-main .repo-table.with-customer {
  min-width: 1060px;
}

.repo-table.with-customer col.r-customer { width: 13%; }
.repo-table.with-customer col.r-name { width: 17%; }
.repo-table.with-customer col.r-url { width: 22%; }
.repo-table.with-customer col.r-access { width: 13%; }
.repo-table.with-customer col.r-status { width: 17%; }
.repo-table.with-customer col.r-fetch { width: 10%; }

/* Auswahl „Kunde“ in der Karte „Repositories“ rechts im Kopf; Hinweis unter dem Feld Kunde im Dialog. */
.repos-content .table-card .card-head select {
  margin-left: auto;
}

.field-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* Formatierter Text (SPEC-111, ADR-026): Darstellung des sicheren Renderers, Vorlage docs/mockups/IDEA-023/customer-issue-detail.html. */
.md {
  color: var(--text-body);
  font-size: var(--text-base);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.md p,
.md ul,
.md ol {
  max-width: 90ch;
}

.md p {
  margin: 0 0 var(--space-2);
}

.md > :last-child {
  margin-bottom: 0;
}

.md ul,
.md ol {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-5);
}

.md a {
  color: var(--text-link);
}

.md code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-hover);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.md .code {
  margin: 0 0 var(--space-3);
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-app);
}

.md .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 4px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md .code pre {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.md .code code {
  padding: 0;
  background: none;
  overflow-wrap: normal;
}

.md .tok-key {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.md .tok-str {
  color: var(--text-link);
}

.md .tok-com {
  color: var(--text-secondary);
  font-style: italic;
}

.md .copy-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.md .copy-code:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.md .copy-code svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==== Support › Settings (SPEC-121, IDEA-023; helvascale-Frontend) ========================================================= */
/* Feste App (UI-11): das Dokument scrollt nie, Kopf und Karte stehen; Notlösung für sehr kleine Fenster: dann scrollt der Inhaltsbereich.
   Eine Karte „Leiter Support“ (Baustein Karte, 40 rem breit): Erklärung, Meldungen, Feld „Person“ mit Hinweis zur letzten Änderung, „Speichern“. */
body:has(.support-settings-page) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.portal-main:has(> .support-settings-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.support-settings-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.support-settings-page > * {
  flex: none;
}

.page-crumbs {
  margin: 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.page-crumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.page-crumbs a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.settings-section.support-settings-card {
  max-width: 40rem;
  padding: calc(var(--space-4) + var(--space-2));
}

.support-settings-intro {
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
  font-size: var(--text-sm);
}

.support-settings-card .section-messages:not(:empty) {
  margin: 0 0 var(--space-4);
}

.support-settings-field {
  margin: 0 0 var(--space-4);
}

.support-settings-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.support-settings-hint svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-settings-card .form-actions {
  margin-top: 0;
}

/* ==== Übersicht › Wartungsmodus für Kunden und Band (SPEC-163, IDEA-026; helvascale-Frontend) ====================================== */
/* Feste App (UI-11): das Dokument scrollt nie, die Ansicht hat keine scrollenden Panels; Notlösung für sehr kleine Fenster: dann scrollt der Inhaltsbereich.
   Eine Karte (Baustein Karte, 40 rem breit) mit zwei Zeilen: Schalter mit Zustand, Voraussichtliches Ende (bei „Ein“ mit dem Knopf „Ende ändern“). Das Band ist der
   Baustein Meldung (Warnung) in der Zeile „hint“ des Rahmens, in jeder Ansicht, solange der Modus an ist; liegt der Sprachhinweis daneben, stehen beide untereinander. */
body:has(.overview-page) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.portal-main:has(> .overview-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.overview-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.overview-page > * {
  flex: none;
}

.settings-section.maintenance-mode {
  max-width: 40rem;
  padding: var(--space-5);
}

.maintenance-mode [hidden] {
  display: none;
}

.maintenance-mode-intro {
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
}

.maintenance-mode-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-subtle);
}

.maintenance-mode-row:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

.maintenance-mode-label {
  min-width: 11rem;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.maintenance-mode-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-variant-numeric: tabular-nums;
}

.maintenance-mode-value strong {
  font-weight: var(--weight-medium);
}

.maintenance-mode .maintenance-mode-hint,
.maintenance-mode .message {
  margin: var(--space-4) 0 0;
}

.maintenance-end-field input {
  max-width: 16rem;
}

.portal-hints {
  grid-area: hint;
}

.maintenance-band {
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

/* ==== Support › Issue-Tabelle der Overview (SPEC-126, IDEA-023) ===================================================================== */
/* Feste App (UI-11): das Dokument ist nie höher als das Fenster; Kopf, Hinweis und Filterzeile stehen, in der Karte scrollt nur der
   Tabellenkörper („issues-scroll“), der Tabellenkopf bleibt stehen, die Seitenzahlen liegen unter dem Scrollbereich. Notlösung für sehr kleine
   Fenster: dann scrollt der Inhaltsbereich unter Kopfzeile und Navigation. Farben nur über Tokens (CD-02 „Erweiterung Issues“, brand.css):
   getönte Pillen = Palettenfarbe in --tint auf der Kartenfläche, Severity als Punkt mit Text. */
body:has(.issues-page) {
  height: 100vh;
  overflow: hidden;
}

.portal-main:has(> .issues-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.issues-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.issues-page > * {
  flex: none;
}

.issues-page > .overview-work {
  flex: 1 1 auto;
  min-height: 0;
}

.issues-page [hidden] {
  display: none;
}

.issues-page > .page-head {
  margin-bottom: var(--space-3);
}

/* Filterzeile mit Beschriftung über den Feldern */
.issues-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(10rem, 1fr)) minmax(16rem, 2fr);
  align-items: end;
  gap: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4);
}

.issues-filters .fl {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.issues-filters .fl > label,
.issues-filters .fl > .label {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.portal-main .issues-filters select,
.portal-main .issues-filters input {
  width: 100%;
  min-height: 38px;
  border-color: var(--border-field);
  background-color: var(--surface-card);
  font-size: var(--text-sm);
}

.issues-filters .search {
  position: relative;
  display: flex;
  align-items: center;
}

.issues-filters .search svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.portal-main .issues-filters .search input {
  padding-left: 34px;
}

/* Raster neben der Tabelle: eine Spalte; mit einer zweiten Karte (Recent Activity, SPEC-125) rechts daneben. */
.overview-work {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-5);
}

.overview-work:has(> :nth-child(2)) {
  grid-template-columns: minmax(0, 3fr) minmax(20rem, 1fr);
}

.issues-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.issues-card.issues-error {
  align-self: start;
}

.issues-card-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 18px 20px 0;
  margin-bottom: var(--space-3);
}

.portal-main .issues-card-head h2 {
  margin: 0;
}

.issues-card .count {
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
  font-variant-numeric: tabular-nums;
}

.issues-card-head .quiet-action {
  min-height: 28px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.issues-card-head .quiet-action:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
  color: var(--text-primary);
}

.issues-note {
  flex: none;
  padding: var(--space-2) 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-app);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.issues-body,
.issues-table-wrap {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.issues-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.issues-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.issues-state-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.issues-card .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  text-align: center;
}

.portal-main .issues-card .empty-state h2 {
  margin: var(--space-2) 0 0;
}

.issues-card .empty-state p {
  max-width: 34rem;
  margin: 0;
  color: var(--text-secondary);
}

/* Tabelle: kompakt (UI-06), Kopf haftet am Scrollbereich */
.portal-main .issues-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.portal-main .issues-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 40px;
  padding: 0 var(--space-3);
  background: var(--surface-app);
  font-size: var(--text-xs);
}

.portal-main .issues-table td {
  height: 60px;
  padding: 8px var(--space-3);
}

.portal-main .issues-table th:first-child,
.portal-main .issues-table td:first-child {
  padding-left: 20px;
}

.portal-main .issues-table th:last-child,
.portal-main .issues-table td:last-child {
  padding-right: 20px;
}

.portal-main .issues-table tbody tr {
  cursor: pointer;
}

.portal-main .issues-table tbody[aria-busy="true"] tr {
  cursor: default;
}

.portal-main .issues-table tbody[aria-busy="true"] td {
  height: 52px;
}

.issues-table .ttl {
  min-width: 15rem;
}

.portal-main .issues-table .ttl a {
  color: var(--text-link);
  font-weight: var(--weight-medium);
}

.issues-table .id-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.issues-table .quiet {
  color: var(--text-secondary);
  white-space: nowrap;
}

.portal-main .issues-table th .sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.portal-main .issues-table th .sort:hover:not(:disabled) {
  border: 0;
  background: none;
  color: var(--text-primary);
}

.portal-main .issues-table th .sort.on {
  color: var(--text-primary);
}

.issues-table th .sort svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.issues-table .cell-v {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.issues-table .row-i {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* Pillen (Status, Type, Escalated): getönt, Text in der Variante der Farbe, immer mit Text */
.issue-pill {
  --c: var(--hs-slate-blue);
  --t: var(--ink-default);
  --s: var(--tint);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-sizing: border-box;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--c) var(--s), var(--surface-card));
  color: var(--t);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}

.issue-pill svg {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.issue-pill[data-tone="open"] { --c: var(--hs-royal-blue); --t: var(--ink-open); }
.issue-pill[data-tone="progress"] { --c: var(--hs-icy-blue); --s: var(--tint-strong); }
.issue-pill[data-tone="wfc"] { --c: var(--hs-orange); --t: var(--ink-orange); }
/* Eskalation in der Warnfarbe (CD-02, CHG-018) */
.issue-pill[data-tone="escalated"] { --c: var(--hs-status-warning); --t: var(--ink-warning); }
.issue-pill[data-tone="wfh"] { --c: var(--hs-slate-blue); }
.issue-pill[data-tone="resolved"] { --c: var(--hs-status-success); --t: var(--ink-success); }
.issue-pill[data-tone="closed"] { --c: var(--hs-slate-blue); --s: 6%; --t: var(--text-secondary); }
.issue-pill[data-tone="type"] { --c: var(--hs-slate-blue); --s: 7%; --t: var(--ink-type); }

/* Severity: Farbpunkt mit Text */
.issue-sev {
  --c: var(--hs-slate-blue);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-body);
  white-space: nowrap;
}

.issue-sev .dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.issue-sev[data-tone="critical"] { --c: var(--hs-status-error); }
.issue-sev[data-tone="high"] { --c: var(--hs-orange); }
.issue-sev[data-tone="medium"] { --c: var(--hs-peach); }
.issue-sev[data-tone="low"] { --c: var(--hs-slate-blue); }

/* „Your turn“: oranger Punkt mit Text */
.issue-turn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-orange);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.issue-turn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hs-orange);
}

.issue-owner {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.issue-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hs-icy-blue) 35%, var(--surface-card));
  color: var(--ink-default);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
}

.issue-owner .who {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.issue-owner .who small {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* Latest Activity: Name und Auszug, höchstens zwei Zeilen */
.issues-table .latest {
  display: -webkit-box;
  min-width: 11rem;
  max-width: 22rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.issues-table .latest strong {
  color: var(--text-body);
  font-weight: var(--weight-medium);
}

/* Seitenzahlen unter dem Scrollbereich */
.issues-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 20px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.issues-foot .pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.portal-main .issues-foot .pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.portal-main .issues-foot .pager button:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
}

.portal-main .issues-foot .pager button.nav {
  border-color: var(--border-default);
}

.portal-main .issues-foot .pager button[aria-current="page"] {
  border-color: var(--action-primary);
  background: var(--action-primary);
  color: var(--action-primary-text);
}

.issues-foot .pager svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==== Support › Kopfzeile, Kennzahlen, SLA und Recent Activity der Overview (SPEC-125, IDEA-023) ======================================= */
/* Titel links, Kennzahlenkarte rechts in einer Zeile; unter 1500 px Fensterbreite steht die Karte unter dem Titel. Zahlen in der Farbe ihres Status,
   SLA-Ampel nach CD-02 „Ausnahme SLA-Quote“ (ab 90 % grün getönt, 70–89 % Peach, 30–69 % Orange, darunter rot; immer Prozentwert und Symbol).
   Recent Activity steht als zweite Karte neben der Tabelle (.overview-work) und scrollt für sich. Farben nur über Tokens (CD-06). */
.issues-page > .support-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-3);
}

.support-head > .head-text {
  flex: 0 1 30rem;
  min-width: 14rem;
}

.support-head > .kpi-strip {
  flex: 1 1 auto;
  min-width: 0;
}

.support-head .crumbs {
  margin: 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.support-head h1 {
  margin: 0;
}

.support-head .sub {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

@media (max-width: 1499px) {
  .issues-page > .support-head {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .support-head > .head-text {
    flex: 1 1 100%;
  }
}

.kpi-strip {
  display: grid;
  grid-template-columns: minmax(10rem, 1.25fr) repeat(5, minmax(5.5rem, 1fr)) auto;
  align-items: stretch;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.kpi-strip .kpi-loading {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  min-height: 64px;
  padding: 0 var(--space-3);
}

.portal-main .kpi-strip button.kpi,
.portal-main .kpi-strip button.kpi-your {
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.portal-main .kpi-strip button.kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px 14px;
  border-left: 1px solid var(--border-subtle);
  border-radius: 0;
}

.portal-main .kpi-strip button.kpi:hover:not(:disabled) {
  border-left-color: var(--border-subtle);
  background: var(--surface-hover);
}

.portal-main .kpi-strip button.kpi-your {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-brand-subtle);
}

.portal-main .kpi-strip button.kpi-your:hover:not(:disabled) {
  background: color-mix(in srgb, var(--hs-icy-blue) 30%, var(--surface-card));
}

.portal-main .kpi-strip button.kpi-your[aria-pressed="true"] {
  outline: 1.5px solid var(--action-primary);
  outline-offset: -1.5px;
}

.portal-main .kpi-strip button.kpi-your[aria-pressed="true"]:focus-visible,
.portal-main .kpi-strip button.kpi:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.kpi-your .kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-card);
  color: var(--text-primary);
}

.kpi-your svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-your .kpi-arrow {
  color: var(--text-secondary);
}

.kpi-your[aria-pressed="true"] .kpi-arrow-open,
.kpi-your[aria-pressed="false"] .kpi-arrow-close {
  display: none;
}

.kpi-label {
  display: block;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.3;
}

.kpi-value {
  display: block;
  color: var(--text-primary);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-figure);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi[data-tone="progress"] .kpi-value { color: var(--ink-open); }
.kpi[data-tone="wfc"] .kpi-value { color: var(--ink-orange); }
.kpi[data-tone="wfh"] .kpi-value { color: var(--hs-slate-blue); }
.kpi[data-tone="closed"] .kpi-value { color: var(--ink-success); }

.kpi-sub {
  display: block;
  margin-top: 2px;
  color: var(--ink-orange);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.kpi-sla {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  margin-left: var(--space-2);
  padding: 6px 12px 6px 18px;
  border-left: 1px solid var(--border-default);
}

.sla-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.sla-meta .sla-level {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.portal-main .kpi-sla select {
  min-height: 22px;
  padding: 0 2px;
  border-color: transparent;
  background-color: transparent;
  color: var(--text-link);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

/* SLA-Pille: Fläche und Text je Stufe (CD-02 „Ausnahme SLA-Quote“); ohne Quote neutral */
.sla-pill {
  --bg: color-mix(in srgb, var(--hs-slate-blue) 6%, var(--surface-card));
  --fg: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background-color: var(--bg);
  color: var(--fg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}

.sla-pill svg,
.sla-hint svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sla-pill[data-sla="good"] {
  --bg: color-mix(in srgb, var(--hs-status-success) var(--tint), var(--surface-card));
  --fg: var(--ink-success);
}

.sla-pill[data-sla="mid"] {
  --bg: var(--hs-peach);
  --fg: var(--hs-deep-teal);
}

.sla-pill[data-sla="warn"] {
  --bg: var(--hs-orange);
  --fg: var(--hs-deep-teal);
}

.sla-pill[data-sla="bad"] {
  --bg: var(--hs-status-error);
  --fg: var(--hs-on-status);
}

.sla-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* Recent Activity: zweite Karte neben der Tabelle, Liste scrollt für sich */
.activity-card .activity-scroll {
  padding: 0 20px;
}

.activity-card .activity-quiet {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.activity-card .issues-card-head .meta {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list > li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: var(--space-3);
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
}

.activity-list > li:first-child {
  border-top: 0;
  padding-top: 0;
}

.activity-avatar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
  user-select: none;
}

.activity-avatar[data-side="customer"] {
  background-color: var(--hs-avatar-initials-bg);
  color: var(--hs-avatar-initials-text);
}

.activity-avatar[data-side="staff"],
.activity-avatar[data-side="system"] {
  border: 1px solid var(--border-default);
  background-color: var(--hs-avatar-logo-bg);
  color: var(--text-primary);
}

.activity-avatar img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.activity-avatar svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.activity-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.activity-what {
  min-width: 0;
  color: var(--text-body);
}

.activity-what strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.activity-what .tag {
  color: var(--text-secondary);
}

.activity-what a {
  color: var(--text-link);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.activity-what a:hover {
  text-decoration: underline;
}

.activity-line time {
  flex: none;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.activity-excerpt {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-app);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-style: italic;
  line-height: 1.5;
  overflow-wrap: anywhere;
  quotes: "„" "“";
}

.activity-excerpt:lang(en) { quotes: "“" "”"; }
.activity-excerpt:lang(fr) { quotes: "« " " »"; }
.activity-excerpt:lang(it) { quotes: "«" "»"; }

.activity-excerpt::before { content: open-quote; }
.activity-excerpt::after { content: close-quote; }

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.activity-meta svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.activity-meta .file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-body);
  overflow-wrap: anywhere;
}

.activity-more {
  margin: var(--space-2) 0 var(--space-4);
  text-align: center;
}

.portal-main .activity-more button {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-xs);
}

.portal-main .activity-more button:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

.activity-loading {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ==== Support › Issue Detail (SPEC-127, IDEA-023) ====================================================================================== */
/* Feste App (UI-11): das Dokument scrollt nie; Brotkrume, Kopf, Textfeld und Seitenleiste stehen, nur der Verlauf („feed-scroll“) scrollt. Die Seitenleiste
   scrollt nur als Notlösung, wenn sie in einem kleinen Fenster nicht passt; sehr kleine Fenster scrollen den Inhaltsbereich unter Kopfzeile und Navigation.
   Farben nur über Tokens (CD-06); Vorlage docs/mockups/IDEA-023/customer-issue-detail.html (Aufbau, Inhalte, Zustände verbindlich, Pixel Richtwert). */
body:has(.issue-detail) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.portal-main:has(> .issue-detail) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.issue-detail {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 34rem;
}

.issue-detail > * {
  flex: none;
}

.issue-detail svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.issue-detail .muted {
  color: var(--text-secondary);
}

.issue-detail .small {
  font-size: var(--text-xs);
}

.issue-detail .num {
  font-variant-numeric: tabular-nums;
}

/* Brotkrume */
.issue-detail .crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.issue-detail .crumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.issue-detail .crumbs a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.issue-detail .crumbs .sep {
  color: var(--border-field);
}

/* Kopf */
.issue-detail .issue-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
}

.issue-detail .issue-top h1 {
  margin: 0 0 var(--space-3);
  overflow-wrap: anywhere;
}

.issue-detail .issue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.issue-detail .vr {
  width: 1px;
  height: 16px;
  background: var(--border-default);
}

.issue-detail .id-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 9px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

.issue-detail button.id-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.issue-detail button.id-copy:hover:not(:disabled) {
  border: 0;
  background: var(--surface-hover);
}

.issue-detail button.id-copy[data-copied="true"] {
  color: var(--ink-success);
}

.issue-detail .id-copy svg,
.issue-detail .org svg {
  width: 14px;
  height: 14px;
}

.issue-detail .org {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-body);
  white-space: nowrap;
}

.issue-detail .issue-pills {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.issue-pill.large {
  height: 26px;
  padding: 0 11px;
  font-size: var(--text-sm);
}

.issue-pill[data-tone="critical"] { --c: var(--hs-status-error); --t: var(--ink-error); }
.issue-pill[data-tone="high"] { --c: var(--hs-orange); --t: var(--ink-orange); }
.issue-pill[data-tone="medium"] { --c: var(--hs-peach); --s: var(--tint-strong); }
.issue-pill[data-tone="low"] { --c: var(--hs-slate-blue); }

/* Aktionen im Kopf: „Issue schließen“ als Text-Button, die Request-Knöpfe als ruhige Umriss-Buttons ohne Signalfarbe (AC-17) */
.issue-detail .head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.issue-detail button.issue-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  white-space: nowrap;
}

.issue-detail button.issue-action svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.issue-detail button.issue-action.outline {
  border-color: var(--border-field);
}

.issue-detail button.issue-action.ghost {
  border: 0;
}

.issue-detail button.issue-action:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
  color: var(--text-primary);
}

.issue-detail button.issue-action.outline:hover:not(:disabled) {
  border-color: var(--border-field);
}

.issue-detail button.issue-action.ghost:hover:not(:disabled) {
  border: 0;
}

/* Spalten: Verlauf mit Textfeld links, Seitenleiste rechts; das Raster hat genau eine Zeile in Resthöhe */
.issue-detail > .detail {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) clamp(21rem, 24vw, 28rem);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-5);
  min-height: 0;
}

.issue-detail .main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.issue-detail .main-col > * {
  flex: none;
}

.issue-detail .main-col > .feed-scroll {
  flex: 1 1 auto;
  min-height: 6rem;
  margin-bottom: var(--space-3);
  overflow-y: auto;
}

.issue-detail .feed-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.issue-detail .side {
  min-height: 0;
  overflow-y: auto;
}

.issue-detail .feed-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
}

.issue-detail .feed-head h2 {
  margin: 0;
}

/* Verlauf als Zeitstrahl: Linie durch die Mitte der Avatare und Symbolkreise (Avatar 40 px, SPEC-034) */
.issue-detail .tl {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.issue-detail .tl::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 19px;
  width: 2px;
  background: var(--border-default);
}

.issue-detail .tl > li {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 var(--space-4);
}

.issue-detail .tl > li > .ticket-avatar,
.issue-detail .tl > li > .ic {
  position: relative;
  z-index: 1;
  outline: 4px solid var(--surface-app);
}

.issue-detail .ic {
  --c: var(--hs-slate-blue);
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  align-self: start;
  justify-self: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface-card));
  color: var(--text-primary);
}

.issue-detail .ic svg {
  width: 16px;
  height: 16px;
}

.issue-detail .ic-status,
.issue-detail .ic-remote { --c: var(--hs-icy-blue); --tint: var(--tint-strong); }
.issue-detail .ic-escalation { --c: var(--hs-status-warning); color: var(--ink-warning); }
.issue-detail .ic-closed { --c: var(--hs-status-success); color: var(--ink-success); }
.issue-detail .ic-system { color: var(--text-secondary); }

.issue-detail .tl-card {
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.issue-detail .tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px var(--space-2);
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.issue-detail .tl-head .who {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.issue-detail .tl-head time,
.issue-detail .tl-event time {
  font-variant-numeric: tabular-nums;
}

.issue-detail .tl-tag {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: 18px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hs-icy-blue) 30%, var(--surface-card));
  color: var(--ink-default);
  font-size: 11px;
  font-weight: var(--weight-medium);
  line-height: 1;
}

.issue-detail .tl-tag.customer {
  background: color-mix(in srgb, var(--hs-slate-blue) var(--tint), var(--surface-card));
  color: var(--ink-type);
}

.issue-detail .tl-event {
  align-self: center;
  min-width: 0;
  padding: 6px 0;
  font-size: var(--text-sm);
}

.issue-detail .tl-event .line1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--space-2);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.issue-detail .tl-event .line1 time {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}

.issue-detail .tl-event .line2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--text-secondary);
}

.issue-detail .icon-16 {
  width: 16px;
  height: 16px;
  flex: none;
}

.issue-detail .tl-object {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.issue-detail .tl-object.escalation {
  border-color: color-mix(in srgb, var(--hs-status-warning) 35%, var(--surface-card));
  background: color-mix(in srgb, var(--hs-status-warning) 6%, var(--surface-card));
}

.issue-detail .tl-object > svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.issue-detail .tl-object .push {
  margin-left: auto;
}

.issue-detail .link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-link);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.issue-detail .link-arrow:hover {
  text-decoration: underline;
}

.issue-detail .link-arrow svg {
  width: 14px;
  height: 14px;
}

/* Anhänge */
.issue-detail .files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.issue-detail .file {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.issue-detail a.file:hover {
  border-color: var(--border-field);
}

.issue-detail .file .size {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.issue-detail .file > svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.issue-detail .file .dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-height: 22px;
  color: var(--text-secondary);
}

.issue-detail .file .dl svg {
  width: 15px;
  height: 15px;
}

/* Textfeld: Eingabe, Werkzeugleiste unten, Umschalter und „Antworten“ rechts. Der Rahmen ist das Eingabefeld: 6 px wie alle Eingaben (CD, UI-03, SPEC-042-AC-09). */
.issue-detail .composer {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.issue-detail .composer:hover {
  border-color: var(--border-field);
}

.issue-detail .composer:focus-within {
  border-color: var(--action-primary);
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.issue-detail .composer textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  font-size: var(--text-base);
  line-height: 1.55;
  resize: vertical;
}

.issue-detail .composer textarea:focus {
  outline: none;
}

/* In der Vorschau ist das Textfeld verborgen (hidden); `display: block` oben überstimmt sonst die Regel des Browsers für [hidden] (wie .staff-detail). */
.issue-detail .composer textarea[hidden] {
  display: none;
}

.issue-detail .composer .preview {
  min-height: 76px;
  padding: 12px 14px;
}

.issue-detail .composer-files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0 12px 10px;
  list-style: none;
}

.issue-detail .composer-files[hidden] {
  display: none;
}

.issue-detail .composer-files button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.issue-detail .composer-files button:hover:not(:disabled) {
  border: 0;
  background: var(--surface-hover);
}

.issue-detail .composer-files button svg {
  width: 14px;
  height: 14px;
}

.issue-detail .composer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 10px;
  border-top: 1px solid var(--border-subtle);
}

.issue-detail .composer-bar .tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.issue-detail .composer-bar .end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.issue-detail .composer-bar button.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.issue-detail .composer-bar button.tool:hover:not(:disabled) {
  border: 0;
  background: var(--surface-hover);
  color: var(--text-primary);
}

.issue-detail .composer-bar button.tool svg {
  width: 16px;
  height: 16px;
}

.issue-detail .composer-bar .tools .vr {
  margin: 0 4px;
  height: 18px;
}

.issue-detail .composer-bar .tools select {
  min-height: 28px;
  padding: 0 4px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.issue-detail .seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.issue-detail .seg button {
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.issue-detail .seg button:hover:not(:disabled) {
  border: 0;
  background: var(--surface-hover);
  color: var(--text-primary);
}

.issue-detail .seg button[aria-pressed="true"] {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.issue-detail .composer-area > .message {
  margin: 0 0 var(--space-2);
}

/* Hinweisleiste an Stelle des Textfelds bei einem geschlossenen Issue */
.issue-detail .banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-sm);
}

.issue-detail .banner svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--text-secondary);
}

/* Seitenleiste: Karten mit Begriff/Wert-Zeilen und Trennlinien */
.issue-detail .side > .card {
  box-sizing: border-box;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.issue-detail .side > .card + .card {
  margin-top: var(--space-4);
}

.issue-detail .side h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
}

.issue-detail .kv {
  margin: 0;
}

.issue-detail .kv > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-height: 40px;
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.issue-detail .kv > div:first-child {
  border-top: 0;
}

.issue-detail .kv dt {
  color: var(--text-secondary);
}

.issue-detail .kv dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px var(--space-2);
  min-width: 0;
  margin: 0;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.issue-detail .kv dd:has(> svg.lead) {
  flex-wrap: nowrap;
  align-items: flex-start;
}

.issue-detail .kv dd > svg.lead {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 2px;
  stroke: var(--text-secondary);
}

.issue-detail .kv .stack-v {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.issue-detail .kv .ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-detail .kv .ok-mark {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  stroke: var(--ink-success);
  stroke-width: 2.4;
}

.issue-detail .kv .person {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.issue-detail .kv a {
  color: var(--text-link);
}

.issue-detail .kv .link-arrow svg {
  width: 14px;
  height: 14px;
}

.issue-detail button.change-link {
  min-height: 28px;
  margin-left: auto;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.issue-detail button.change-link:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Severity für Kunden: getönte Auswahl in der Farbe der Severity, immer mit Text */
.issue-detail .pill-select {
  position: relative;
  display: inline-flex;
}

.issue-detail .pill-select select {
  --c: var(--hs-slate-blue);
  --t: var(--ink-default);
  --s: var(--tint);
  appearance: none;
  height: 26px;
  padding: 0 26px 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--c) var(--s), var(--surface-card));
  color: var(--t);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.issue-detail .pill-select select:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--c) 45%, var(--surface-card));
}

.issue-detail .pill-select select[data-tone="critical"] { --c: var(--hs-status-error); --t: var(--ink-error); }
.issue-detail .pill-select select[data-tone="high"] { --c: var(--hs-orange); --t: var(--ink-orange); }
.issue-detail .pill-select select[data-tone="medium"] { --c: var(--hs-peach); --s: var(--tint-strong); }

.issue-detail .pill-select svg {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  color: var(--text-secondary);
  stroke-width: 2.2;
  pointer-events: none;
}

/* Zustandsflächen: „nicht gefunden“ und Fehler (ohne Inhalt des Issues) */
.issue-state .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  text-align: center;
}

.issue-state .empty-state h2 {
  margin: var(--space-2) 0 0;
}

.issue-state .empty-state p {
  max-width: 34rem;
  margin: 0;
  color: var(--text-secondary);
}

.issue-state a.link-button {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.issue-state a.link-button:hover {
  background: var(--surface-hover);
}

.issue-state button {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
}

.issue-state button:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

@media (max-width: 1100px) {
  /* Schmale Fenster: untereinander, dann scrollt der Inhaltsbereich (keine feste App unter 1101 px) */
  .issue-detail > .detail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .issue-detail .main-col > .feed-scroll {
    max-height: 28rem;
  }

  .issue-detail .side {
    overflow: visible;
  }
}

/* ==== Support › Issue Detail für Mitarbeitende (SPEC-130, IDEA-023) ====================================================================== */
/* Ergänzt den Aufbau des Kundenportals (.issue-detail, SPEC-127) um das, was nur Mitarbeitende sehen: interne Einträge und bei der internen Notiz das ganze Textfeld in
   Peach-Tönung (Palettenfarbe in --tint-strong Deckkraft, Pille „Intern“ mit Schloss; Zustand nie allein über Farbe), Umschalter „Antwort an Kunden / Interne Notiz“,
   Split-Button „Antworten“ mit Menü, Hinweisleiste der Eskalation, getönte Auswahl für Status und Type und die Karte „Remote Session“. Farben nur über Tokens (CD-06);
   Vorlage docs/mockups/IDEA-023/helvascale-issue-detail.html (Aufbau, Inhalte, Zustände verbindlich, Pixel Richtwert). */
.staff-detail {
  --internal-tint: color-mix(in srgb, var(--hs-peach) var(--tint-strong), var(--surface-card));
  --internal-line: color-mix(in srgb, var(--hs-peach) 55%, var(--surface-card));
}

/* Kopf: „Im Issue-Tracker öffnen“ als ruhiger Umriss-Link (Ausnahme nach ADR-025, nur für Mitarbeitende) */
.staff-detail a.issue-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-sizing: border-box;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  text-decoration: none;
  white-space: nowrap;
}

.staff-detail a.issue-action:hover {
  background: var(--surface-hover);
}

.staff-detail a.issue-action svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.staff-detail .main-col > .message {
  margin: 0 0 var(--space-2);
}

/* Interne Einträge: Peach-Tönung, Pille „Intern“ mit Schloss, Kreis in Peach */
.issue-pill[data-tone="internal"] { --c: var(--hs-peach); --s: var(--tint-strong); }
.staff-detail .ic-internal { --c: var(--hs-peach); --tint: var(--tint-strong); }

.staff-detail .tl-card.internal {
  border-color: var(--internal-line);
  background: var(--internal-tint);
}

.staff-detail .tl-head .issue-pill {
  height: 18px;
  padding: 0 7px;
  font-size: 11px;
}

.staff-detail .tl-event .line1 .issue-pill {
  height: 18px;
  padding: 0 7px;
  font-size: 11px;
}

.staff-detail .stars-inline {
  color: var(--ink-rating);
  letter-spacing: 1px;
}

/* Hinweis mit Symbol (Textfeld, Seitenleiste) */
.staff-detail .hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.staff-detail .hint svg {
  width: 13px;
  height: 13px;
  flex: none;
}

/* Hinweisleiste „Eskalation offen“ über dem Verlauf */
.staff-detail .bar-slot:empty {
  display: none;
}

.staff-detail .banner.attention {
  margin: 0 0 var(--space-3);
  border-color: color-mix(in srgb, var(--hs-orange) 35%, var(--surface-card));
  background: color-mix(in srgb, var(--hs-orange) 7%, var(--surface-card));
}

.staff-detail .banner.attention > svg {
  color: var(--ink-orange);
}

.staff-detail .banner .push {
  margin-left: auto;
}

.staff-detail .composer-slot > .banner {
  margin: 0;
}

/* Textfeld: Umschalter oben, bei der internen Notiz in Peach-Tönung */
.staff-detail .composer textarea[hidden] {
  display: none;
}

.staff-detail .composer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.staff-detail .composer.internal {
  border-color: var(--internal-line);
  background: var(--internal-tint);
}

.staff-detail .composer.internal .composer-top,
.staff-detail .composer.internal .composer-bar {
  border-color: var(--internal-line);
}

.staff-detail .seg button.internal[aria-pressed="true"] {
  background: color-mix(in srgb, var(--hs-peach) 45%, var(--surface-card));
  color: var(--ink-default);
}

.staff-detail .audience {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.staff-detail .audience svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.staff-detail .composer.internal .audience {
  color: var(--ink-default);
  font-weight: var(--weight-medium);
}

/* Split-Button „Antworten“ mit Menü „Antworten und Status setzen auf“ (öffnet nach oben, das Textfeld steht unten) */
.staff-detail .split {
  position: relative;
  display: inline-flex;
}

.staff-detail .split > button[type="submit"] {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.staff-detail .split > .split-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 0 6px;
  border-left-color: color-mix(in srgb, var(--action-primary-text) 35%, var(--action-primary));
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.staff-detail .split-toggle svg {
  width: 16px;
  height: 16px;
}

.staff-detail .follow-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 5;
  box-sizing: border-box;
  min-width: 15rem;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  list-style: none;
}

.staff-detail .follow-menu[hidden] {
  display: none;
}

.staff-detail .follow-menu .menu-label {
  padding: 4px 8px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.staff-detail .follow-menu [role="menuitem"] {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.staff-detail .follow-menu [role="menuitem"]:hover,
.staff-detail .follow-menu [role="menuitem"]:focus-visible {
  background: var(--surface-hover);
}

/* Seitenleiste: Status und Type als getönte Auswahl in der Farbe des Werts (wie die Pillen), kleine Aktionen der Remote Session */
.issue-detail .pill-select select[data-tone="open"] { --c: var(--hs-royal-blue); --t: var(--ink-open); }
.issue-detail .pill-select select[data-tone="progress"] { --c: var(--hs-icy-blue); --s: var(--tint-strong); }
.issue-detail .pill-select select[data-tone="wfc"] { --c: var(--hs-orange); --t: var(--ink-orange); }
.issue-detail .pill-select select[data-tone="wfh"] { --c: var(--hs-slate-blue); }
.issue-detail .pill-select select[data-tone="resolved"] { --c: var(--hs-status-success); --t: var(--ink-success); }
.issue-detail .pill-select select[data-tone="closed"] { --c: var(--hs-slate-blue); --s: 6%; --t: var(--text-secondary); }
.issue-detail .pill-select select[data-tone="type"] { --c: var(--hs-slate-blue); --s: 7%; --t: var(--ink-type); }

.staff-detail .kv .issue-pill {
  height: 24px;
}

.staff-detail button.side-btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: var(--text-xs);
}

.staff-detail button.side-btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-primary);
}

.staff-detail button.side-btn.ghost:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
}

.staff-detail .side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* Zusammenfassung der Anfrage im Pop-up „Remote Session bestätigen“ */
dialog.issue-dialog .request-summary {
  margin: 0 0 var(--space-3);
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-app);
  color: var(--text-body);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

dialog.issue-dialog .f input[type="url"],
dialog.issue-dialog .f input[type="number"] {
  width: 100%;
}

/* Pop-ups des Issue Details (Schließen, Bewertung, Eskalation, Remote Session, Betrifft) */
dialog.issue-dialog .f {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

dialog.issue-dialog .f label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

dialog.issue-dialog .f .opt {
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
}

dialog.issue-dialog .f .req {
  color: var(--ink-error);
}

dialog.issue-dialog .f textarea,
dialog.issue-dialog .f select,
dialog.issue-dialog .f input[type="datetime-local"] {
  width: 100%;
}

dialog.issue-dialog .f textarea {
  min-height: 6rem;
  resize: vertical;
}

dialog.issue-dialog .f[hidden],
dialog.issue-dialog [hidden] {
  display: none;
}

dialog.issue-dialog .counter {
  align-self: flex-end;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

dialog.issue-dialog .muted {
  color: var(--text-secondary);
}

dialog.issue-dialog .small {
  font-size: var(--text-xs);
}

dialog.issue-dialog .stars {
  display: inline-flex;
  gap: 2px;
  margin: 0 0 var(--space-4);
}

dialog.issue-dialog .stars button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--border-field);
}

dialog.issue-dialog .stars button:hover:not(:disabled) {
  border: 0;
  background: var(--surface-hover);
}

dialog.issue-dialog .stars button[data-filled="true"] {
  color: var(--ink-rating);
}

dialog.issue-dialog .stars svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

dialog.issue-dialog .stars button[data-filled="true"] svg {
  fill: currentColor;
}

dialog.issue-dialog .choice {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

dialog.issue-dialog .choice label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  cursor: pointer;
}

dialog.issue-dialog .choice label.on {
  border-color: var(--action-primary);
  background: var(--surface-brand-subtle);
}

dialog.issue-dialog .choice label > span {
  display: grid;
  gap: 2px;
}

dialog.issue-dialog .choice label small {
  color: var(--text-secondary);
}

/* ==== Support › New Issue (SPEC-128, IDEA-023) ======================================================================================= */
/* Feste App (UI-11): das Dokument scrollt nie; Kopf und Aktionen („Cancel“, „Create Issue“) stehen, nur die Felder („form-body“) und die Hinweis-Karte
   scrollen je für sich, wenn sie nicht ins Fenster passen. Unter 1101 px stehen Formular und Hinweise untereinander, dann scrollt der Inhaltsbereich.
   Farben nur über Tokens (CD-06); Vorlage docs/mockups/IDEA-023/customer-new-issue.html (Aufbau, Inhalte, Zustände verbindlich, Pixel Richtwert). */
body:has(.new-issue-page) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.portal-main:has(> .new-issue-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.new-issue-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 34rem;
}

.new-issue-page > * {
  flex: none;
}

.new-issue-page [hidden] {
  display: none;
}

.new-issue-page svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Kopf */
.new-issue-page .ni-head {
  margin: 0 0 var(--space-4);
}

.new-issue-page .crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.new-issue-page .crumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.new-issue-page .crumbs a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.new-issue-page .crumbs .sep {
  color: var(--border-field);
}

.new-issue-page .ni-head h1 {
  margin: 0;
}

.new-issue-page .ni-head .sub {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.new-issue-page > .message {
  margin: 0 0 var(--space-3);
}

/* Raster: Formular links, Hinweise rechts; genau eine Zeile in Resthöhe */
.new-issue-page > .ni-grid {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) clamp(20rem, 26vw, 30rem);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-5);
  min-height: 0;
}

.new-issue-page .ni-card {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.new-issue-page .ni-form {
  display: flex;
  flex-direction: column;
}

.new-issue-page .ni-form > .form-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px 24px 4px;
  overflow-y: auto;
}

.new-issue-page .panel-body:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.new-issue-page .ni-actions {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
}

.new-issue-page .ni-actions button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 16px;
}

.new-issue-page .ni-actions button.outline {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
}

.new-issue-page .ni-actions button.outline:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

.new-issue-page .ni-actions button svg {
  width: 16px;
  height: 16px;
}

/* Felder */
.new-issue-page .ni-slot:empty {
  display: none;
}

.new-issue-page .f {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 20px;
}

.new-issue-page .f > label,
.new-issue-page .f > .label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.new-issue-page .f .req {
  color: var(--hs-status-error);
}

.new-issue-page .f .opt {
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
}

.new-issue-page .f input[type="text"],
.new-issue-page .f select,
.new-issue-page .f textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 6px 12px;
  border-color: var(--border-default);
  font-size: var(--text-base);
}

.new-issue-page .f input[type="text"]:hover:not(:disabled, [aria-invalid="true"]),
.new-issue-page .f select:hover:not(:disabled, [aria-invalid="true"]) {
  border-color: var(--border-field);
}

.new-issue-page .f [aria-invalid="true"],
.new-issue-page .f .composer:has([aria-invalid="true"]) {
  border-color: var(--hs-status-error);
}

.new-issue-page .f .field-error {
  align-self: flex-start;
}

.new-issue-page .f-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
}

.new-issue-page .form-hint {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* Auswahl mit Symbol bzw. Farbpunkt vor dem Wert */
.new-issue-page .select-icon,
.new-issue-page .select-dot {
  position: relative;
  display: flex;
}

.new-issue-page .select-icon > svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  color: var(--text-secondary);
  pointer-events: none;
}

.new-issue-page .select-icon select {
  padding-left: 36px;
}

.new-issue-page .select-dot {
  --c: var(--hs-peach);
}

.new-issue-page .select-dot[data-tone="critical"] { --c: var(--hs-status-error); }
.new-issue-page .select-dot[data-tone="high"] { --c: var(--hs-orange); }
.new-issue-page .select-dot[data-tone="medium"] { --c: var(--hs-peach); }
.new-issue-page .select-dot[data-tone="low"] { --c: var(--hs-slate-blue); }

.new-issue-page .select-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 12px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--c);
  pointer-events: none;
}

.new-issue-page .select-dot select {
  padding-left: 28px;
}

/* Betrifft: Art (App | Operator | Cluster) und Eintrag */
.new-issue-page .link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.new-issue-page .link-row > .select-icon {
  flex: 1 1 16rem;
}

.new-issue-page .seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.new-issue-page .seg button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.new-issue-page .seg button:hover:not(:disabled) {
  border: 0;
  background: var(--surface-hover);
  color: var(--text-primary);
}

.new-issue-page .seg button[aria-pressed="true"] {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.new-issue-page .seg.kind {
  flex: none;
  padding: 3px;
}

.new-issue-page .seg.kind button {
  min-height: 30px;
  padding: 0 12px;
  font-size: var(--text-sm);
}

.new-issue-page .seg.kind button svg {
  width: 14px;
  height: 14px;
}

.new-issue-page .f .hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.new-issue-page .f .hint svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* Description: Werkzeugleiste oben, „Schreiben / Vorschau“ rechts. Der Rahmen ist das Eingabefeld: 6 px wie alle Eingaben (CD, UI-03, SPEC-042-AC-09). */
.new-issue-page .composer {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.new-issue-page .composer:hover {
  border-color: var(--border-field);
}

.new-issue-page .composer:focus-within {
  border-color: var(--action-primary);
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.new-issue-page .composer textarea {
  display: block;
  min-height: 76px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: transparent;
  line-height: 1.55;
  resize: vertical;
}

/* In der Vorschau ist das Textfeld verborgen (hidden); `display: block` oben überstimmt sonst die Browserregel (wie .issue-detail). */
.new-issue-page .composer textarea[hidden] {
  display: none;
}

.new-issue-page .composer textarea:focus {
  outline: none;
}

.new-issue-page .composer .preview {
  min-height: 76px;
  padding: 12px 14px;
}

.new-issue-page .composer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.new-issue-page .composer-bar .tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.new-issue-page .composer-bar .end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.new-issue-page .composer-bar button.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.new-issue-page .composer-bar button.tool:hover:not(:disabled) {
  border: 0;
  background: var(--surface-hover);
  color: var(--text-primary);
}

.new-issue-page .composer-bar button.tool svg {
  width: 16px;
  height: 16px;
}

.new-issue-page .composer-bar .vr {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--border-default);
}

.new-issue-page .composer-bar .tools select {
  width: auto;
  min-height: 28px;
  padding: 0 4px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* Attachments: große Ablagefläche, gewählte Dateien als Einträge */
.new-issue-page .drop-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 16px;
  border: 1.5px dashed var(--border-field);
  border-radius: var(--radius-md);
  background: var(--surface-app);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-align: center;
}

.new-issue-page .drop-lg[role="button"] {
  cursor: pointer;
}

.new-issue-page .drop-lg[role="button"]:hover:not([aria-disabled="true"]) {
  border-color: var(--action-primary);
}

.new-issue-page .drop-lg[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.new-issue-page .drop-lg svg {
  width: 26px;
  height: 26px;
  color: var(--text-primary);
  stroke-width: 1.6;
}

.new-issue-page .drop-lg strong {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.new-issue-page .files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.new-issue-page .files:not([hidden]) {
  margin-top: var(--space-1);
}

.new-issue-page .files .file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 30px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-sm);
}

.new-issue-page .files .file > svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--text-secondary);
}

.new-issue-page .files .file .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-issue-page .files .file .size {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.new-issue-page .files .file button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.new-issue-page .files .file button:hover:not(:disabled) {
  border: 0;
  background: var(--surface-hover);
  color: var(--text-primary);
}

.new-issue-page .files .file button svg {
  width: 14px;
  height: 14px;
}

/* Hinweis-Karte */
.new-issue-page .ni-help {
  display: flex;
  flex-direction: column;
  align-self: start;
  max-height: 100%;
}

.new-issue-page .ni-help > .panel-body {
  min-height: 0;
  padding: 16px 20px;
  overflow-y: auto;
}

.new-issue-page .help-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  margin: 0 0 var(--space-3);
}

.new-issue-page .help-head h2 {
  margin: 0;
  font-size: var(--text-lg);
}

.new-issue-page .help-head p {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.new-issue-page .ni-ic {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  color: var(--text-primary);
}

.new-issue-page .ni-ic svg {
  width: 15px;
  height: 15px;
}

.new-issue-page .ni-ic.big {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface-brand-subtle);
}

.new-issue-page .ni-ic.big svg {
  width: 20px;
  height: 20px;
}

.new-issue-page .checklist {
  display: grid;
  gap: 8px;
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.new-issue-page .checklist li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: var(--space-2);
}

.new-issue-page .checklist svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--hs-status-success);
  stroke-width: 2.2;
}

.new-issue-page .help-section {
  margin: 0;
  padding: var(--space-3) 0 0;
  border-top: 1px solid var(--border-subtle);
}

.new-issue-page .help-section + .help-section {
  margin-top: var(--space-3);
}

.new-issue-page .help-section h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
}

.new-issue-page .def-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.new-issue-page .def-list > li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.new-issue-page .def-list > li.sev-row {
  grid-template-columns: 12px minmax(0, 1fr);
}

.new-issue-page .def-list > li[aria-current="true"] {
  background: var(--surface-brand-subtle);
}

.new-issue-page .def-list .dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--hs-slate-blue);
}

.new-issue-page .def-list .dot[data-tone="critical"] { background: var(--hs-status-error); }
.new-issue-page .def-list .dot[data-tone="high"] { background: var(--hs-orange); }
.new-issue-page .def-list .dot[data-tone="medium"] { background: var(--hs-peach); }
.new-issue-page .def-list .dot[data-tone="low"] { background: var(--hs-slate-blue); }

.new-issue-page .def-list .txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.35;
}

.new-issue-page .def-list .txt > strong {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.new-issue-page .def-list .txt > span {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.new-issue-page .def-list .txt > .ctx {
  margin-top: 3px;
  color: var(--text-body);
}

@media (max-width: 1100px) {
  /* Schmale Fenster: untereinander, dann scrollt der Inhaltsbereich (keine feste App unter 1101 px) */
  .new-issue-page > .ni-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .new-issue-page .ni-form > .form-body {
    overflow: visible;
  }

  .new-issue-page .ni-help {
    align-self: stretch;
    max-height: none;
  }

  .new-issue-page .ni-help > .panel-body {
    overflow: visible;
  }
}

/* ==== helvascale-Frontend › Support › Overview und Issues (SPEC-129, IDEA-023) ====================================================== */
/* Baut auf den Bausteinen der Issue-Tabelle des Kundenportals auf (.issues-page, .issues-card, .issues-table, .issue-pill, .issue-sev, .sla-pill, .kpi-strip):
   feste App (UI-11), in der Overview scrollt nur die Tabelle „SLA je Kunde“, in der Arbeitsliste nur die Tabelle, der Kopf bleibt stehen. Farben nur über
   Tokens (CD-06); SLA-Ampel nach CD-02 „Ausnahme SLA-Quote“ (Pille und Balken: ab 90 % grün, 70–89 % Peach, 30–69 % Orange, darunter rot). */
.staff-page .page-head {
  align-items: center;
  flex-wrap: wrap;
}

.staff-page .page-head .sub {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.staff-head-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.staff-sla-slot {
  display: inline-flex;
  align-items: center;
}

.staff-sla-slot .skeleton {
  width: 7rem;
  height: 28px;
  border-radius: var(--radius-pill);
}

.staff-head-tools .sla-hint {
  font-size: var(--text-sm);
}

/* Zeitraum: Segmente mit gedrücktem Zustand (aria-pressed) */
.staff-seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.portal-main .staff-seg button {
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.portal-main .staff-seg button:hover:not(:disabled) {
  border: 0;
  background: var(--surface-hover);
  color: var(--text-primary);
}

.portal-main .staff-seg button[aria-pressed="true"] {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

/* Kennzahlen: fünf Links in einer Karte, Farbpunkt vor der Beschriftung, Zahl in der Farbe ihres Status */
.issues-page > .kpi-strip.staff-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: var(--space-4);
}

.portal-main .kpi-strip a.kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px 14px;
  border-left: 1px solid var(--border-subtle);
  border-radius: 0;
  color: inherit;
  text-decoration: none;
}

.portal-main .kpi-strip a.kpi:first-child {
  border-left: 0;
}

.portal-main .kpi-strip a.kpi:hover {
  background: var(--surface-hover);
  text-decoration: none;
}

.portal-main .kpi-strip a.kpi:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.staff-kpis .kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.kpi-dot {
  --c: var(--ink-open);
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.kpi[data-tone="escalated"] .kpi-dot { --c: var(--hs-status-warning); }
.kpi[data-tone="wfc"] .kpi-dot { --c: var(--hs-orange); }
.kpi[data-tone="wfh"] .kpi-dot { --c: var(--hs-slate-blue); }
.kpi[data-tone="resolved"] .kpi-dot { --c: var(--hs-status-success); }
.kpi[data-tone="escalated"] .kpi-value { color: var(--ink-warning); }
.kpi[data-tone="resolved"] .kpi-value { color: var(--ink-success); }

/* Karten: Meta neben der Überschrift, Zustandsflächen und Platzhalter */
.staff-card-meta {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.staff-page .card-state {
  padding: var(--space-4) 20px var(--space-5);
}

.staff-busy {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 20px 20px;
}

/* Tabellen: kompakt (UI-06); die Zeilen der Arbeitsliste öffnen das Detail, die der Tabelle „SLA je Kunde“ nicht */
.portal-main .issues-table.staff-table td {
  height: 48px;
  white-space: nowrap;
}

.portal-main .issues-table.staff-table td:has(> .staff-ttl) {
  white-space: normal;
}

.portal-main .issues-table.static tbody tr {
  cursor: default;
}

.portal-main .issues-table.staff-table .ttl {
  min-width: 12rem;
}

.staff-table td.num,
.staff-table td.id {
  font-variant-numeric: tabular-nums;
}

.staff-table td.id {
  color: var(--text-secondary);
}

.staff-table .staff-ttl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

/* SLA je Kunde: Balken (deckend in der Farbe der Stufe) und Quote als Pille */
.sla-meter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 11rem;
}

.sla-meter-bar {
  position: relative;
  flex: 1 1 auto;
  min-width: 5rem;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
}

.sla-meter-fill {
  --c: var(--hs-status-success);
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--radius-pill);
  background: var(--c);
}

.sla-meter-fill[data-sla-bar="mid"] { --c: var(--hs-peach); }
.sla-meter-fill[data-sla-bar="warn"] { --c: var(--hs-orange); }
.sla-meter-fill[data-sla-bar="bad"] { --c: var(--hs-status-error); }

/* Clusterzeilen unter dem Kunden (SPEC-206): eingerückt mit Pfeil, Nebentext in Sekundärfarbe */
.staff-table tr[data-row="cluster"] td.sub-arrow {
  padding-left: 52px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.sla-pill.compact {
  justify-content: center;
  min-width: 3.5rem;
  height: 22px;
  padding: 0 9px;
  font-size: var(--text-xs);
}

/* Reaktionsfrist: laufend mit Uhr, überfällig in Fehlerfarbe mit Symbol; der Zustand steht immer auch im Text */
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-body);
  white-space: nowrap;
}

.reaction.overdue {
  color: var(--ink-error);
  font-weight: var(--weight-medium);
}

.reaction svg,
.staff-note svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Arbeitsliste: Schnellfilter, Suche und Auswahlfelder über der Tabelle */
.staff-toolbar {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) 20px;
  border-bottom: 1px solid var(--border-default);
}

.staff-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.staff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.portal-main .staff-chips .chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.portal-main .staff-chips .chip:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
  color: var(--text-primary);
}

.portal-main .staff-chips .chip[aria-selected="true"] {
  border-color: transparent;
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.staff-search {
  position: relative;
  display: flex;
  flex: 1 1 16rem;
  align-items: center;
  max-width: 24rem;
}

.staff-search svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.portal-main .staff-search input {
  width: 100%;
  min-height: 36px;
  padding-left: 34px;
  border-color: var(--border-default);
  font-size: var(--text-sm);
}

.portal-main .staff-toolbar select {
  min-height: 36px;
  max-width: 16rem;
  border-color: var(--border-default);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.staff-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.portal-main .staff-more {
  min-height: 28px;
  padding: 0 var(--space-3);
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-xs);
}

.portal-main .staff-more:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

/* ==== Einstellungen › Organisation (SPEC-149, IDEA-024; Mockup docs/mockups/IDEA-024/customer-einstellungen-organisation.html) ================= */
/* Volle Breite (AC-20, Entscheidung Tim 2026-11-06): Die Karten rechts der Unternavigation reichen bis zum rechten Seitenabstand, es gibt keine Höchstbreite;
   die Anordnung der Karten (SPEC-042-AC-11) bleibt. „Organisation“ und „Protokoll“ sind eine Karte über beide Spalten. */
.settings-content {
  max-width: none;
}

.settings-content > .settings-wide {
  grid-column: 1 / -1;
}

/* Feste App (UI-11, AC-21): das Dokument scrollt nie; Kopf und Unternavigation stehen, nur der Inhalt rechts der Unternavigation scrollt (Benutzereinstellungen). In
   „Organisation“ (und „Protokoll“) füllt die Karte die Resthöhe: Organisationskopf, Meldungen und Werkzeugleiste stehen, nur die Tabelle scrollt, ihr Kopf bleibt stehen.
   Notlösung für sehr kleine Fenster: dann scrollt der Inhaltsbereich (.portal-main), nie das Fenster. */
body:has(.portal-main > .settings-layout) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.portal-main:has(> .settings-layout) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.portal-main:has(> .settings-layout) > :not(.settings-layout) {
  flex: none;
}

.portal-main > .settings-layout {
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 24rem;
}

.portal-main > .settings-layout > .settings-content {
  align-content: start;
  min-height: 0;
  overflow-y: auto;
}

.portal-main > .settings-layout > .settings-content:focus-visible,
.settings-section.panel > .table-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.settings-content.panel-host {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-content.panel-host > .panel {
  flex: 1 1 auto;
  min-height: 0;
}

.settings-section.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.settings-section.panel > * {
  flex: none;
}

/* Tabelle bis an die Kartenränder: der Scrollbereich liegt am Rand der Karte, der Inhalt bleibt im Innenabstand. */
.settings-section.panel > .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 calc(-1 * (var(--space-4) + var(--space-1)));
  padding: 0 calc(var(--space-4) + var(--space-1));
  overflow: auto;
}

/* ---- Organisationskopf: Name, Umbenennen, Kürzel -------------------------------------------------------------------------------------------------- */
.org-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-4);
}

.org-identity[hidden],
.org-identity [hidden] {
  display: none;
}

.org-identity .org-name {
  min-width: 8rem;
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.org-identity form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.org-identity form input {
  width: 20rem;
  max-width: 100%;
}

.org-identity .field-error {
  flex-basis: 100%;
  margin: 0;
}

/* Das Kürzel-Etikett `.short-tag` ist ein gemeinsamer Baustein und steht beim Abschnitt „Kundenorganisation“ (SPEC-153). */

/* Text-Knopf mit Symbol (Stift „Umbenennen“) */
.text-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 28px;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-link);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.text-action:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
}

.text-action svg,
.row-menu-button svg,
.row-menu [role="menuitem"] svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-action svg {
  width: 14px;
  height: 14px;
}

/* ---- Meldungen über der Werkzeugleiste ------------------------------------------------------------------------------------------------------------ */
.org-notices:empty {
  display: none;
}

.org-notices .message {
  max-width: none;
  margin: 0 0 var(--space-3);
}

/* ---- Mitgliedertabelle ---------------------------------------------------------------------------------------------------------------------------- */
/* Grundform (Zeilen 44 px, Kürzen mit „…“), Rollenhinweis `.role-hint` und Statusabzeichen `.mstat` stehen beim Abschnitt „Kundenorganisation“ (SPEC-153) und gelten für beide
   Frontends. Die Tabelle mit Zeilenmenü (`.with-actions`, Einstellungen › Organisation) weicht in Layout und Rändern ab. */
.portal-main .member-table.with-actions {
  min-width: 720px;
  table-layout: auto;
}

/* Spaltenbreiten (automatisches Layout): Name und E-Mail-Adresse bekommen einen Anteil und kürzen mit „…“ (der volle Text steht im Tooltip), Rolle, Status und Letzte
   Anmeldung zeigen sich in der Breite ihres Inhalts, in jeder Sprache ungekürzt (die Zeit der letzten Anmeldung darf umbrechen); darunter scrollt der Bereich seitlich. */
.member-table.with-actions col.m-name { width: 16%; }
.member-table.with-actions col.m-mail { width: 22%; }
.member-table.with-actions col.m-role,
.member-table.with-actions col.m-state,
.member-table.with-actions col.m-last,
.member-table.with-actions col.m-act { width: auto; }

.portal-main .member-table.with-actions td:nth-child(-n + 2) {
  max-width: 0;
}

.portal-main .member-table.with-actions thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-card);
}

.portal-main .member-table.with-actions th,
.portal-main .member-table.with-actions td {
  padding: 0 var(--space-2);
}

/* Erste und letzte Spalte schließen mit dem Innenabstand der Karte ab (Überschrift und Werkzeugleiste fluchten mit dem Text, „⋯“ mit „Mitglied einladen“). */
.portal-main .member-table.with-actions th:first-child,
.portal-main .member-table.with-actions td:first-child {
  padding-left: 0;
}

.portal-main .member-table.with-actions th:last-child,
.portal-main .member-table.with-actions td:last-child {
  padding-right: 0;
}

.portal-main .member-table.with-actions td:last-child {
  overflow: visible;
  text-align: right;
}

.portal-main .member-table.with-actions td:nth-child(5) {
  white-space: normal;
}

.member-table .member-name {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  min-width: 0;
}

.member-table .member-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-table .me-tag {
  flex: none;
  color: var(--text-secondary);
}

.member-table tr.is-busy td {
  opacity: 0.55;
}

.member-table tr.is-new td {
  background: var(--surface-brand-subtle);
}

.empty-hint {
  margin: var(--space-3) 0 var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.empty-hint[hidden] {
  display: none;
}

/* ---- Zeilenmenü „⋯“: Schaltfläche in der Zeile, ein Menü am Dokument (nicht im Scrollbereich der Tabelle) ---------------------------------------------- */
.row-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
}

.row-menu-button:hover:not(:disabled),
.row-menu-button[aria-expanded="true"] {
  border-color: transparent;
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.row-menu-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

.row-menu {
  position: fixed;
  z-index: 8;
  box-sizing: border-box;
  min-width: 13rem;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.row-menu .menu-label {
  padding: 6px var(--space-2) 2px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.row-menu .menu-sep {
  height: 1px;
  margin: var(--space-1) 0;
  background: var(--border-subtle);
}

.row-menu [role="menuitem"],
.row-menu [role="menuitemradio"] {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.row-menu [role="menuitem"]:hover,
.row-menu [role="menuitemradio"]:hover,
.row-menu [role="menuitem"]:focus,
.row-menu [role="menuitemradio"]:focus {
  background: var(--surface-hover);
  outline-offset: -2px;
}

.row-menu [role="menuitem"] svg {
  width: 14px;
  height: 14px;
}

.row-menu [role="menuitemradio"]::before {
  content: "";
  display: inline-block;
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.row-menu [role="menuitemradio"][aria-checked="true"]::before {
  border-color: var(--text-link);
  background: var(--text-link);
}

/* ==== Rollen im Kundenportal (SPEC-136, IDEA-024) ========================================================================== */
/* Eigene Rolle in den Benutzereinstellungen: ruhige Textzeile unter der E-Mail-Adresse. */
.profile-role {
  margin: var(--space-3) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* Ohne Schreibaktionen bleibt keine leere Knopfleiste im Kopf des Issues (display: flex darf hidden nicht überstimmen). */
.issue-detail .head-actions[hidden] {
  display: none;
}

/* Meldung „Für diese Aktion fehlt dir die Berechtigung …“ im Textfeld, unter der Eingabe (der Text bleibt erhalten). */
.issue-detail .composer > .message {
  max-width: none;
  margin: 0 12px 10px;
}

/* ==== Customer Access › Kundenorganisation (SPEC-153, IDEA-024; Mockup helvascale-kundenorganisation) ================================== */
/* Feste App (UI-11): das Dokument ist nie höher als das Fenster; Brotkrume, Titel und Register stehen, im gewählten Register scrollt nur die Tabelle
   „Mitglieder“ (Tabellenkopf bleibt stehen) bzw. die Liste „Protokoll“ (Filter und Fuß mit den Seitenknöpfen stehen). Notlösung für sehr kleine Fenster: dann
   scrollt der Inhaltsbereich unter Kopfzeile und Navigation. Nur Tokens (CD-06); Zustand immer Symbol und Text (CD-02). */
body:has(.org-page) {
  height: 100vh;
  overflow: hidden;
}

.portal-main:has(> .org-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.org-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 22rem;
}

.org-page > * {
  flex: none;
}

.org-page > .org-panel {
  flex: 1 1 auto;
  min-height: 0;
}

.org-page > .overview-tabs {
  margin: 0 0 var(--space-3);
}

/* Kopf: Brotkrume, Titel mit Kürzel-Etikett, bei Einzelkunden die E-Mail-Adresse */
.org-head {
  margin: 0 0 var(--space-4);
}

.org-head .crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.org-head .crumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.org-head .crumbs a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.org-head .crumbs .sep {
  color: var(--border-field);
}

.org-head h1.org-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
}

.org-head .sub {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
}

.org-head .sub[hidden],
.short-tag[hidden] {
  display: none;
}

/* Kürzel als ruhiges Etikett: Umriss im Rand-Ton, Großbuchstaben, nicht bedienbar */
.short-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  cursor: default;
}

/* Karte des Registers: Kopf (Hinweise, Meldung, Filter) und Fuß stehen, dazwischen scrollt ein Bereich */
.org-panel {
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.org-panel[hidden] {
  display: none;
}

.org-panel > * {
  flex: none;
}

.org-panel-head {
  padding: var(--space-4) 20px 0;
}

.org-panel-head .message {
  max-width: none;
  margin: 0 0 var(--space-3);
}

.org-panel-head .page-tools {
  margin-bottom: var(--space-3);
}

.org-panel-head .page-tools select {
  height: var(--control-height);
  font-size: var(--text-sm);
}

.org-panel > .org-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 20px;
  overflow: auto;
}

.org-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.org-scroll[hidden] {
  display: none;
}

.org-panel > .org-foot-slot:empty {
  display: none;
}

/* Hinweiszeile über der Tabelle (Nur Ansicht, erste Admin eingeladen) */
.view-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.view-note svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.org-admin-note {
  margin: 0 0 var(--space-3);
}

.org-admin-note[hidden],
.view-note[hidden] {
  display: none;
}

/* Warnung nur als Etikett in der Warnfarbe, mit Symbol und Text */
.warn-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--hs-status-warning);
  color: var(--message-on-warning);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.warn-tag svg {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Zustand „unbekannte Organisation“: die Karte richtet sich nach ihrem Inhalt */
.org-page > .org-notfound {
  flex: 0 1 auto;
}

.org-state {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6) 20px;
}

.org-state h2,
.org-state p {
  margin: 0;
}

/* Mitgliedertabelle: Tabellenkopf bleibt stehen, Zeilen 44 px, Rolle mit Hinweis darunter */
.org-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-card);
}

.portal-main .member-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.member-table col.m-name { width: 20%; }
.member-table col.m-mail { width: 22%; }
.member-table col.m-role { width: 18%; }
.member-table col.m-state { width: 18%; }
.member-table col.m-last { width: 22%; }

.portal-main .member-table td {
  height: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-main .member-table td:has(.role-hint) {
  white-space: normal;
}

.member-table .role-hint {
  display: block;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.2;
}

/* Mitgliederstatus: neutrales Badge mit Symbol und Text (keine Statusfarbe, CD-02); gesperrt gedämpft */
.mstat {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 20px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.mstat svg {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mstat.locked {
  border-style: dashed;
  color: var(--text-secondary);
}

.mstat.invited {
  border-color: var(--hs-slate-blue);
}

/* ==== Customer Access › Neue Organisation und Schritte des Onboardings (SPEC-152, IDEA-024; Mockup helvascale-neue-organisation) ==================== */
/* Feste App (UI-11) wie das Detail einer Kundenorganisation (.org-page, .org-head, .org-panel): Brotkrume, Titel und Aktionen stehen; im Formular scrollt nur der Bereich mit den
   Feldern (.org-scroll), in der Ergebnisansicht nur die Liste der Schritte. Abschnitte trennen Linien statt weiterer Karten (UI-07). Zustand immer Symbol und Text (CD-02);
   Farben nur über Tokens (CD-06). Die Hervorhebung der neuen Organisation in Customer Access steht am Ende. */
.org-head h1 {
  margin: 0;
}

.org-head h1[tabindex="-1"]:focus {
  outline: none;
}

.org-panel.wizard > .org-scroll {
  padding-top: var(--space-4);
  padding-bottom: var(--space-2);
}

.org-panel.wizard > .wizard-foot {
  padding: var(--space-3) 20px;
  border-top: 1px solid var(--border-subtle);
}

.wizard-foot > .message {
  max-width: none;
  margin: 0 0 var(--space-3);
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* „Organisation anlegen“ ist die eine orange Hauptaktion (.primary-action); „Abbrechen“, „Zu Customer Access“ und „Weitere Organisation anlegen“ sind leiser (Umriss). */
.wizard-actions button.secondary {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
}

.wizard-actions button.secondary:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

/* Abschnitte des Formulars: Organisation, Erste Organization Admin, Vertrag */
.wizard-body > fieldset {
  min-width: 0;
  max-width: 48rem;
  margin: 0;
  padding: var(--space-4) 0;
  border: 0;
  border-top: 1px solid var(--border-subtle);
}

.wizard-body > fieldset:first-child {
  padding-top: 0;
  border-top: 0;
}

.wizard legend {
  float: left;
  width: 100%;
  margin: 0 0 var(--space-3);
  padding: 0;
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.wizard legend + * {
  clear: both;
}

/* Felder: der gemeinsame Baustein .field (Beschriftung, Eingabe, Fehlerfarbe) mit Abstand nach unten; Meldungen am Feld stehen im Platz .field-slot */
.wizard .field {
  margin: 0 0 var(--space-3);
}

.wizard .field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-4);
}

.wizard .field-slot:empty {
  display: none;
}

.wizard .field .message {
  max-width: none;
  margin: var(--space-1) 0 0;
}

.wizard .form-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* Kürzel: kurzes Feld in Großbuchstaben, daneben das Ergebnis der Prüfung */
.wizard .field .short-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.wizard .field .short-input input {
  width: 7rem;
  flex: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.check-state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.check-state:empty,
.text-action[hidden] {
  display: none;
}

.check-state svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.check-state.ok {
  color: var(--ink-success);
}

.check-state.bad {
  color: var(--ink-error);
}

.check-state.busy {
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
}

/* Bereiche: ein Kontrollkästchen je sperrbarem Bereich in der Reihenfolge der Kundennavigation */
.area-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-main .area-checks label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
}

.wizard .area-checks input {
  flex: none;
  margin: 0;
}

/* Ergebnis: die fünf Schritte mit Zustand (erledigt, übersprungen, fehlgeschlagen) – immer Symbol und Text */
.steps {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 40px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.step:last-child {
  border-bottom: 0;
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  color: var(--text-secondary);
}

.step-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step.done .step-icon {
  border-color: var(--hs-status-success);
  background: var(--hs-status-success);
  color: var(--hs-on-status);
}

.step.failed .step-icon {
  border-color: var(--hs-status-error);
  background: var(--hs-status-error);
  color: var(--hs-on-status);
}

.step-text {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--text-body);
  overflow-wrap: anywhere;
}

.step-state {
  flex: none;
  color: var(--text-secondary);
}

.step.failed .step-state {
  color: var(--ink-error);
  font-weight: var(--weight-medium);
}

@media (max-width: 900px) {
  .wizard .field-row,
  .area-checks {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Die zuletzt angelegte Organisation steht in Customer Access hervorgehoben (Mockup „Nach dem Anlegen“). */
.portal-main .access-table tr.is-new td {
  background: var(--surface-brand-subtle);
}

/* ---- Einstellungen › Protokoll (SPEC-150, IDEA-024; Mockup docs/mockups/IDEA-024/customer-einstellungen-protokoll.html) ---------------------------------------------- */
/* Die Karte „Protokoll“ liegt wie „Organisation“ in der Fläche rechts der Unternavigation (feste App, UI-11): Überschrift, Text, Filter und Fuß stehen, nur die Liste scrollt
   (`.table-scroll`, siehe oben). Zeilen (.audit-list, .audit-actor, .actor-avatar) und Fuß (.issues-foot) sind gemeinsame Bausteine mit dem Abschnitt „Kundenorganisation“. */
.settings-protokoll .page-tools select {
  height: var(--control-height);
  max-width: 20rem;
  font-size: var(--text-sm);
}

.settings-protokoll > .message {
  max-width: none;
  margin: 0 0 var(--space-3);
}

/* Fuß bis an die Kartenränder und die Unterkante (Innenabstand der Karte), wie die Liste darüber */
.settings-section.panel > .issues-foot {
  margin: 0 calc(-1 * (var(--space-4) + var(--space-1))) calc(-1 * (var(--space-4) + var(--space-1)));
}

/* Protokoll: Zeitpunkt, Person, Satz */
.audit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-list li {
  display: grid;
  grid-template-columns: 9.5rem minmax(9rem, 13rem) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.audit-list li:last-child {
  border-bottom: 0;
}

.audit-list time {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.audit-actor {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.audit-actor .actor-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-actor .actor-org {
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
}

.audit-sentence {
  color: var(--text-body);
  overflow-wrap: anywhere;
}

/* Person: Kunde mit Initialen, helvascale mit Logomark, System mit Symbol – unterscheidbar ohne zusätzliche Farbflächen */
.actor-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--hs-avatar-initials-bg);
  color: var(--hs-avatar-initials-text);
  font-size: 10px;
  font-weight: var(--weight-semibold);
}

.actor-avatar.hs {
  border: 1px solid var(--border-default);
  background: var(--hs-avatar-logo-bg);
}

.actor-avatar.hs img {
  width: 14px;
  height: 14px;
}

.actor-avatar.sys {
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
}

.actor-avatar.sys svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 900px) {
  .audit-list li {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}

/* ==== Baustein: Wartungsseite (SPEC-160, IDEA-026; CHG-001) =============================================================== */
/* Ebene über der ganzen Seite (natives dialog mit showModal: oberste Ebene, auch über offenen Dialogen), Seitenhintergrund, die Karte waagerecht und
   senkrecht mittig im Fenster (Baustein Karte: 1-px-Rand, 8 px Radius, keine Schatten), ihr Inhalt zentriert; oben rechts Hell/Dunkel und Sprache wie in
   der Kopfzeile. Gilt für alle Zustände (zählt, prüft, geplant, wieder verbunden), beim Start wie in der Sitzung und in beiden Frontends. Keine scrollenden
   Panels; nur in sehr kleinen Fenstern scrollt die Ebene selbst (Notlösung UI-11). Oben pulsiert das Logomark wie im Ladebild (CHG-060; der frühere Ring
   neben dem Countdown entfällt). Mockup (Aufbau): docs/mockups/IDEA-026/customer-wartung.html. */
dialog.maintenance-layer {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: var(--space-6) var(--space-4);
  overflow: auto;
  border: 0;
  background: var(--surface-app);
  color: var(--text-body);
}

dialog.maintenance-layer[open] {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
}

dialog.maintenance-layer::backdrop {
  background: var(--surface-app);
}

.maintenance-tools {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.maintenance-card {
  box-sizing: border-box;
  width: min(100%, 30rem);
  margin: auto;
  padding: var(--space-6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  text-align: center;
}

.maintenance-mark {
  display: flex;
  justify-content: center;
  margin: 0 0 var(--space-6);
}

/* Pulsierendes Logomark wie im Ladebild (CHG-060): dieselbe Bewegung (app-loader-pulse), bei reduzierter Bewegung ruhig. */
.maintenance-mark img {
  width: 48px;
  height: 48px;
  animation: app-loader-pulse 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .maintenance-mark img { animation: none; opacity: 1; }
}

.maintenance-card h1 {
  margin: 0 0 var(--space-2);
}

.maintenance-card h1:focus {
  outline: none;
}

.maintenance-text {
  margin: 0;
  font-size: var(--text-lg);
}

.maintenance-until {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.maintenance-retry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-5) 0 0;
}

.maintenance-retry[hidden] {
  display: none;
}

.maintenance-countdown {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.maintenance-countdown strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.maintenance-actions {
  margin: var(--space-5) 0 0;
}

.maintenance-actions button[aria-disabled="true"] {
  cursor: progress;
}

.maintenance-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-5) 0 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--message-success-bg);
  color: var(--message-on-status);
  font-weight: var(--weight-medium);
}

.maintenance-success[hidden] {
  display: none;
}

.maintenance-success svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ==== Bereich Dein Bereich (SPEC-169, IDEA-027; Mockup customer-dein-bereich, Baustein arbeitsliste.css) ================================== */
/* Feste App (UI-11): das Dokument ist nie höher als das Fenster; Kopf mit Datum und Zahlenzeile steht, es scrollen nur die beiden Karten „Deine Aufgaben“ (links) und
   „Zur Info“ (rechts), je als Bereich mit Tastaturfokus. Notlösung für sehr kleine Fenster: dann scrollt der Inhaltsbereich unter Kopfzeile und Navigation. Nur Tokens (UI-01);
   Frist und Zustand immer mit Wort (nie nur Farbe, CD-02). */
body:has(.ws-page) {
  height: 100vh;
  overflow: hidden;
}

.portal-main:has(> .ws-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.ws-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 24rem;
}

.ws-page > * {
  flex: none;
}

.ws-page > .ws-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.ws-page > .page-head {
  margin-bottom: var(--space-4);
}

.ws-page .page-head .page-sub {
  margin: var(--space-1) 0 0;
}

.ws-page [hidden] {
  display: none;
}

.ws-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.ws-summary strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

/* Raster: links die Aufgaben, rechts „Zur Info“ */
.ws-grid {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 2fr) minmax(20rem, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--space-4);
  min-height: 0;
}

.ws-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.ws-card-head {
  display: flex;
  flex: none;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 18px 20px 12px;
}

.portal-main .ws-card-head h2 {
  margin: 0;
}

.ws-card-head .meta {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.ws-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  /* Die Position bleibt bei der Aktualisierung, auch wenn darüber Zeilen verschwinden (die Ansicht stellt sie selbst wieder her). */
  overflow-anchor: none;
}

.ws-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.ws-unavailable {
  max-width: none;
  margin: 0 20px var(--space-2);
}

.ws-hint {
  margin: 0;
  padding: var(--space-3) 20px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.ws-loading {
  margin: 0;
  padding: 18px 20px 0;
  color: var(--text-secondary);
}

.ws-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) 20px;
}

/* Gruppen */
.ws-group {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-4) 20px var(--space-2);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.ws-group .ws-group-count {
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
  font-variant-numeric: tabular-nums;
}

.ws-group .ws-group-note {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}

.ws-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Eintrag: Bereichs-Icon, Titel mit Badges und Kontextzeile, Frist, Absprung */
.ws-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 132px 112px;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 20px;
  border-top: 1px solid var(--border-subtle);
}

.ws-item:hover,
.ws-info:hover {
  background: var(--surface-hover);
}

.ws-area {
  display: inline-flex;
  color: var(--text-secondary);
}

.ws-area svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ws-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ws-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: var(--text-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

.ws-title > a {
  color: var(--text-body);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ws-title > a:hover {
  color: var(--text-link);
  text-decoration: underline;
}

.ws-meta {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* Grund der Aufgabe („Du bist …“) in der Kontextzeile: wie im Mockup in der Textfarbe des Inhalts, nicht gedämpft */
.ws-why {
  color: var(--text-body);
}

/* Frist: Beschriftung und Wert; überfällig bzw. „seit …“ in der Fehler- bzw. Warnfarbe, immer mit Wort */
.ws-due {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.ws-due-label {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.ws-due-value {
  color: var(--text-body);
  font-weight: var(--weight-medium);
}

.ws-due.is-over .ws-due-value {
  color: var(--hs-status-error);
}

:root[data-theme="dark"] .ws-due.is-over .ws-due-value {
  color: color-mix(in srgb, var(--hs-status-error) 55%, var(--hs-light-blue));
}

.ws-due.is-stale .ws-due-value {
  color: var(--ink-orange);
}

/* Absprung-Link mit dem Namen der Aufgabe; kein Knopf, die Ansicht führt keine Aktion aus */
.ws-go {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 4px;
  color: var(--text-link);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  white-space: nowrap;
}

a.ws-go:hover {
  text-decoration: underline;
}

.ws-go svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ws-title .upd-badge,
.ws-title .issue-pill,
.ws-title .state {
  font-size: var(--text-xs);
}

/* Zur Info (rechte Karte) */
.ws-info {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
  padding: 10px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.ws-info .ws-area {
  padding-top: 1px;
}

.ws-info p {
  margin: 0;
  color: var(--text-body);
  overflow-wrap: anywhere;
}

.ws-info p a {
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.ws-info p a:hover {
  text-decoration: underline;
}

.ws-info time {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Alles erledigt: ruhige Karte statt der Listen */
.ws-empty {
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  text-align: center;
}

.portal-main .ws-empty h2 {
  margin: var(--space-2) 0 0;
}

.ws-empty p {
  max-width: 34rem;
  margin: 0;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .ws-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .ws-item {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .ws-item .ws-due,
  .ws-item .ws-go {
    grid-column: 2;
    justify-self: start;
  }
}

/* Status bei Kollegen (SPEC-177): zweite Zeile unter dem Namen in der Mitgliederliste, gekürzt (ganzer Text im Tooltip) */
.member-table .member-status {
  display: block;
  max-width: 22rem;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Name eines Kollegen mit Karte (Issue-Verlauf, Owner; SPEC-177): gepunktet unterstrichen, Karte mit Avatar, Name, Organisation und Status beim Darüberfahren oder Fokus. Die Karte
   steht fest im Fenster (Koordinaten setzt person-card.js), damit der Scrollbereich des Verlaufs sie nicht abschneidet. */
.person-card-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.person-card-anchor .who {
  text-decoration: underline dotted var(--text-secondary);
  text-underline-offset: 3px;
  cursor: default;
}

.person-card {
  display: none;
  position: fixed;
  z-index: 20;
  box-sizing: border-box;
  gap: var(--space-3);
  width: 17rem;
  max-width: calc(100vw - var(--space-4));
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  line-height: 1.4;
  text-align: left;
  white-space: normal;
}

.person-card-anchor[data-open]:not([data-dismissed]) > .person-card {
  display: flex;
}

.person-card strong {
  display: block;
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.person-card .muted {
  display: block;
}

.person-card .pm-status-text {
  display: block;
  margin-top: var(--space-1);
  overflow-wrap: anywhere;
}

/* ==== Connector-Einstellungen (SPEC-186, IDEA-030; helvascale-Frontend) ======================================================== */
/* Feste App (UI-11): das Dokument scrollt nie; Seitenkopf, Titel der Karte und „Speichern“ stehen, nur der Inhalt der Karte (agent-settings-scroll) scrollt,
   wenn er nicht passt. Eine Karte (Baustein Karte, 40 rem breit) mit dem Feld „Registry-Adresse“, der Zeile „Aktuell“ und „Speichern“. Notlösung für sehr kleine
   Fenster: dann scrollt der Inhaltsbereich. */
body:has(.agent-settings-page) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.portal-main:has(> .agent-settings-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.agent-settings-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.agent-settings-page > * {
  flex: none;
}

.agent-settings-page > .agent-settings-card {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 0;
  max-width: 40rem;
  padding: calc(var(--space-4) + var(--space-2));
}

/* Innenabstand und gleich großer negativer Außenabstand lassen den Fokusring der Felder im Sichtbereich, ohne die Lage des Inhalts zu ändern. */
.agent-settings-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: calc(-1 * var(--space-1));
  padding: var(--space-1);
  overflow-y: auto;
}

.agent-settings-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.agent-settings-card .section-messages:not(:empty) {
  margin: 0 0 var(--space-4);
}

.agent-settings-card .field,
.agent-settings-card .ac-switch-line {
  margin: 0 0 var(--space-3);
}

.agent-settings-current {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.agent-settings-card .form-actions {
  flex: none;
  margin-top: var(--space-4);
}

.agent-settings-card .skeleton {
  margin: 0 0 var(--space-3);
}

.agent-settings-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  text-align: center;
}

/* ==== Bereich AppCare › Applications (SPEC-196, IDEA-031) =================================================================== */
/* Links die Liste der Apps, rechts die gewählte App mit ihren Instanzen. Feste App (UI-11): nur die Liste (.panel-body) und die Tabelle der Instanzen
   (.ac-table-region) scrollen; Kopf, Meldungen und Reiter stehen. Farben nur über Tokens. */
.ac-page > .ac-notices,
.ac-page > .ac-tabs-slot {
  flex: none;
}

.ac-tabs-slot:empty {
  display: none;
}

.ac-tabs {
  display: flex;
  gap: var(--space-1);
  margin: 0 0 var(--space-3);
}

.ac-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.ac-tabs .tab[aria-selected="true"] {
  border-color: var(--surface-selected);
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.ac-tabs .tab[aria-disabled="true"] {
  cursor: default;
  color: var(--text-secondary);
}

.ac-tabs .tab .count {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.ac-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.ac-split {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(14rem, 20rem) minmax(0, 1fr);
  gap: var(--space-4);
  min-height: 0;
}

.ac-list-card,
.ac-app-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.ac-list-head {
  flex: none;
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-default);
}

.ac-list-head .search-input {
  position: relative;
}

.ac-list-head .search-input svg {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
}

.ac-list-head input[type="search"] {
  box-sizing: border-box;
  width: 100%;
  height: var(--control-height);
  padding-left: 28px;
  font-size: var(--text-sm);
}

.ac-list-card .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.ac-list-card .panel-body:focus-visible,
.ac-table-region:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.ac-list {
  margin: 0;
  padding: var(--space-1);
  list-style: none;
}

.ac-list a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  text-decoration: none;
}

.ac-list a:hover {
  background: var(--surface-hover);
}

.ac-list a[aria-current="true"] {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.ac-list a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.ac-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ac-groups > .ac-list + .ac-group {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.ac-group .owner-logomark {
  width: 16px;
  height: 16px;
  flex: none;
}

.ac-group-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-regular);
}

.ac-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-medium);
}

.ac-meta {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.ac-list a[aria-current="true"] .ac-meta {
  color: inherit;
}

.ac-empty {
  padding: var(--space-3);
  color: var(--text-secondary);
}

.care-mark svg,
.ac-dot svg,
.badge-care svg,
.ac-readonly svg,
.ac-care a svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.care-mark {
  display: inline-flex;
  color: inherit;
}

.ac-dot {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.ac-dot-not-found svg {
  stroke: var(--hs-status-warning);
}

.badge-care {
  gap: var(--space-1);
  border-color: var(--hs-slate-blue);
  background: transparent;
  color: var(--text-primary);
}

.ac-app-head {
  flex: none;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.ac-app-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.ac-app-title h2 {
  margin: 0;
}

.ac-app-title .page-actions {
  margin-left: auto;
}

.ac-desc {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
}

.ac-care {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.ac-care div {
  display: flex;
  gap: var(--space-2);
}

.ac-care dt {
  color: var(--text-secondary);
}

.ac-care dd {
  margin: 0;
}

.ac-care a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.ac-readonly {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.ac-inst-head {
  display: flex;
  flex: none;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-2);
}

.ac-inst-head h3 {
  margin: 0;
}

.ac-inst-head .count {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.ac-table-region {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.ac-empty-instances {
  margin: 0;
  padding: var(--space-4);
  color: var(--text-secondary);
}

.portal-main .instance-table {
  min-width: 920px;
}

.instance-table col.i-name { width: 16%; }
.instance-table col.i-cluster { width: 10%; }
.instance-table col.i-binding { width: 14%; }
.instance-table col.i-current { width: 13%; }
.instance-table col.i-latest { width: 13%; }
.instance-table col.i-state { width: 15%; }
.instance-table col.i-update { width: 176px; }

.portal-main .instance-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-default);
}

.portal-main .instance-table td.update-cell {
  text-align: right;
}

.portal-main .instance-table .env-row th,
.portal-main .instance-table .env-row th:last-child {
  padding: var(--space-2) var(--space-4);
  background: var(--surface-app);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-align: left;
  position: static;
}

.instance-table .type-tag {
  color: inherit;
}

.cell-sub-inline {
  margin-left: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.state-unknown-text svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
}

.ac-sync-line {
  display: block;
}

.ac-sync {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ac-sync svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ac-sync.warn {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.ac-sync.warn svg {
  stroke: var(--hs-status-warning);
}

.ac-mono,
.ac-image {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.ac-image {
  display: block;
}

.ac-bindings {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ac-bindings li {
  display: grid;
  grid-template-columns: minmax(9rem, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-default);
}

.ac-bindings li:last-child {
  border-bottom: 0;
}

.ac-bindings .cell-sub {
  display: block;
}

.detail-scroll .message .secondary {
  margin-left: auto;
}

/* Formulare (App, Instanz) */
.ac-form {
  display: grid;
  gap: var(--space-4);
}

.ac-form .form-row,
.ac-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.ac-form .field-errors:empty {
  display: none;
}

.ac-form .field-errors {
  display: grid;
  gap: var(--space-1);
}

.ac-namespace-row {
  display: flex;
  gap: var(--space-2);
}

.ac-namespace-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.ac-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ac-chips:empty {
  display: none;
}

.ac-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 4px 2px var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.ac-chip.invalid {
  border-color: var(--hs-status-error);
}

.chip-remove {
  display: inline-grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.chip-remove svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.ac-selector-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  align-items: end;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.ac-selector-row .field {
  margin: 0;
}

.ac-offers {
  margin-top: var(--space-2);
}

button.small {
  height: 28px;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
}

.ac-source-hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

@media (max-width: 900px) {
  .ac-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(8rem, 12rem) minmax(0, 1fr);
  }

  .ac-form .form-row,
  .ac-source-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.workload-table {
  min-width: 0;
  width: 100%;
  table-layout: auto;
}

.workload-table th,
.workload-table td {
  height: auto;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
}

.workload-table th:first-child,
.workload-table td:first-child {
  padding-left: 0;
}

/* Formulardialoge (App, Instanz): Kopf und Knöpfe stehen, nur der Inhalt scrollt (UI-11). */
dialog.hs-dialog.ac-dialog {
  overflow: hidden;
}

dialog.hs-dialog.ac-dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog.ac-dialog .dialog-head,
dialog.ac-dialog .dialog-foot {
  flex: none;
}

dialog.ac-dialog .dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* ==== Bereich AppCare › Erkannt (SPEC-197, IDEA-031) ========================================================================= */
/* Eine Karte mit Werkzeugleiste, Band „Argo CD“, Hinweis und Tabelle; feste App (UI-11): nur die Tabelle (.table-scroll) scrollt. */
.ac-found {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.ac-found > .toolbar,
.ac-found > .filter-note {
  flex: none;
}

.ac-found > .toolbar {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-default);
}

.ac-found .toolbar-row {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.ac-found .search-input {
  position: relative;
  flex: 0 1 18rem;
}

.ac-found .search-input svg {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
}

.ac-found input[type="search"] {
  box-sizing: border-box;
  width: 100%;
  height: var(--control-height);
  padding-left: 28px;
  font-size: var(--text-sm);
}

.ac-found select {
  height: var(--control-height);
  font-size: var(--text-sm);
}

.ac-muted {
  color: var(--text-secondary);
}

.filter-note svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.ac-found-table {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.ac-found .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.ac-found .table-scroll:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.portal-main .found-table {
  min-width: 900px;
}

.found-table col.f-name { width: 17%; }
.found-table col.f-type { width: 9%; }
.found-table col.f-cluster { width: 12%; }
.found-table col.f-source { width: 20%; }
.found-table col.f-version { width: 12%; }
.found-table col.f-actions { width: 300px; }

.portal-main .found-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-default);
}

.portal-main .found-table td.found-actions {
  text-align: right;
}

.found-table .type-tag {
  color: inherit;
}

.row-actions-inline {
  display: inline-flex;
  gap: var(--space-2);
}

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

.ac-remote svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.ac-found-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6);
  color: var(--text-secondary);
}

.ac-found-empty svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Leere Tabelle (CHG-043): die einzige Zeile „Keine Einträge“ über alle Spalten, ruhig und ohne Hover. */
.portal-main .cluster-table tbody tr.empty-row td {
  height: auto;
  padding: var(--space-6) var(--space-4);
  background: transparent;
  color: var(--text-secondary);
  text-align: center;
}

.found-table button.secondary {
  border-color: var(--border-field);
  background: transparent;
  color: var(--text-primary);
  white-space: nowrap;
}

.found-table button.secondary:hover:not(:disabled) {
  border-color: var(--border-field);
  background: var(--surface-hover);
}

/* ==== helvascale › AppCare (SPEC-199, IDEA-031) ============================================================================= */
/* Reiter, Applications aller Kunden, Erkannt und Repositories teilen die Seite `.ac-page`; die Tabellen scrollen, Kopf und Reiter stehen (UI-11). */
.ac-content > .repos-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.apps-all {
  min-width: 960px;
}

.apps-all col.k-customer { width: 14%; }
.apps-all col.k-app { width: 20%; }
.apps-all col.k-inst { width: 14%; }
.apps-all col.k-care { width: 18%; }
.apps-all col.k-updates { width: 14%; }
.apps-all col.k-state { width: 14%; }
.apps-all col.k-go { width: 48px; }

.found-table.with-customer col.f-customer { width: 10%; }
.found-table.with-customer col.f-name { width: 15%; }
.found-table.with-customer col.f-type { width: 8%; }
.found-table.with-customer col.f-cluster { width: 10%; }
.found-table.with-customer col.f-source { width: 17%; }
.found-table.with-customer col.f-version { width: 10%; }

.ac-switch-line {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.ac-switch-line > span {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.detail-scroll .ac-table-region {
  overflow: visible;
}

.ac-content > .ac-actions {
  display: flex;
  flex: none;
  justify-content: flex-end;
  margin-bottom: var(--space-3);
}

.ac-content > .ac-actions[hidden] {
  display: none;
}

/* Repositories aller Kunden mit aufklappbaren Charts: Kunde, Pfeil und Aktionen zusammen brauchen mehr feste Breite (SPEC-199). */
.portal-main .repo-table.with-customer.expandable {
  min-width: 1160px;
}

.repo-table.with-customer.expandable col.r-customer { width: 11%; }
.repo-table.with-customer.expandable col.r-name { width: 15%; }
.repo-table.with-customer.expandable col.r-url { width: 19%; }
.repo-table.with-customer.expandable col.r-access { width: 11%; }
.repo-table.with-customer.expandable col.r-status { width: 15%; }
.repo-table.with-customer.expandable col.r-fetch { width: 12%; }

/* ==== Clusters › Dashboard (SPEC-211, IDEA-033): Kennzahlkacheln, Kapazität und Distribution ====================================
   Kacheln und Karten sind .overview-tile und .overview-card (Übersicht); nur Tokens (UI-01). Die Ansicht füllt die Fensterhöhe, es scrollt nur die Liste Distribution
   innerhalb ihrer Karte (UI-11); in kleinen Fenstern scrollt der Inhaltsbereich (.portal-main). */
.cluster-dash {
  --ov-gap: var(--space-3);
  --ov-pad: var(--space-4);
  --ov-tile-pad: var(--space-3);
  --ov-head-gap: var(--space-3);
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
}

.cluster-dash-tiles {
  display: grid;
  flex: none;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: var(--ov-gap);
}

.cluster-dash-grid {
  display: grid;
  flex: 0 1 auto;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-rows: minmax(0, auto);
  gap: var(--ov-gap);
  min-height: 0;
}

.cluster-dash svg {
  flex: none;
}

.cluster-dash-split {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.cluster-dash-split a {
  color: var(--text-link);
  text-decoration: none;
}

.cluster-dash-split a:hover,
.cluster-dash-split a:focus-visible {
  text-decoration: underline;
}

.cluster-dash-states {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: var(--space-1) var(--space-3);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}

.cluster-dash-states li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cluster-dash-states .num,
.cluster-dash-dist .num {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.cluster-dash-capacity {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.cluster-dash-capacity > div {
  padding: 0 var(--space-4);
  border-left: 1px solid var(--border-default);
}

.cluster-dash-capacity > div:first-child {
  padding-left: 0;
  border-left: none;
}

.cluster-dash-capacity dt {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.cluster-dash-capacity dd {
  margin: 0;
}

.cluster-dash-capacity .value {
  display: block;
  margin-top: var(--space-1);
  color: var(--text-primary);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-figure);
  line-height: 28px;
}

.cluster-dash-capacity .value small {
  margin-left: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
}

.cluster-dash-env {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.cluster-dash-env li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  border-top: 1px solid var(--border-default);
  white-space: nowrap;
}

.cluster-dash-env li span:first-child {
  color: var(--text-secondary);
}

.cluster-dash-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.cluster-dash-note svg {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.cluster-dash-dist-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cluster-dash-dist-card .overview-card-head {
  flex: none;
}

.cluster-dash-dist-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.cluster-dash-dist {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}

.cluster-dash-dist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border-default);
}

.cluster-dash-dist li:first-child {
  border-top: none;
}

@media (max-height: 719px) {
  .cluster-dash-grid {
    flex: none;
  }

  .cluster-dash-dist-scroll {
    overflow-y: visible;
  }
}

/* ---- CHG-039: Schrittleiste, Mini-Kalender, Stunde/Minute, „Andere Version“, Beteiligte und Freigaben -------------------------------------------- */
.upd-steps {
  display: flex;
  gap: 0;
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.upd-step {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 30px var(--space-1) 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  text-align: center;
}

.upd-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  transform: translateX(-50%);
}

.upd-step::after {
  content: "";
  position: absolute;
  top: 10px;
  left: calc(50% + 15px);
  right: calc(-50% + 15px);
  height: 2px;
  background: var(--border-default);
}

.upd-step:last-child::after {
  display: none;
}

.upd-step-name {
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.upd-step-note {
  overflow-wrap: anywhere;
}

.upd-step.is-done::before {
  border-color: var(--action-primary);
  background: var(--action-primary);
}

.upd-step.is-done::after {
  background: var(--action-primary);
}

.upd-step.is-current::before {
  border-color: var(--action-primary);
  box-shadow: inset 0 0 0 4px var(--surface-card);
  background: var(--action-primary);
}

.upd-step.is-current .upd-step-name {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.dp-field {
  position: relative;
}

.dp-input {
  display: flex;
  gap: var(--space-1);
}

.dp-input input {
  flex: 1 1 auto;
  min-width: 0;
}

.dp-pop {
  position: fixed;
  z-index: 20;
  box-sizing: border-box;
  width: 17.5rem;
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.dp-title {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.dp-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.dp-grid th {
  padding: var(--space-1) 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.dp-day {
  padding: 6px 0;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: var(--text-sm);
  cursor: pointer;
}

.dp-day:hover:not([aria-disabled="true"]) {
  background: var(--surface-hover);
}

.dp-day:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.dp-day.is-today {
  box-shadow: inset 0 0 0 1px var(--action-primary);
}

.dp-day[aria-selected="true"] {
  background: var(--surface-selected);
  color: var(--text-on-selected);
  font-weight: var(--weight-semibold);
}

.dp-day[aria-disabled="true"] {
  color: var(--text-secondary);
  opacity: 0.5;
  cursor: default;
}

.time-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.ver-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
  align-items: start;
}

.other-version {
  margin: 0;
}

.appr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.appr-table th {
  padding: var(--space-2);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-align: left;
}

.appr-table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.appr-table tr:last-child td {
  border-bottom: none;
}

.appr-role {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.appr-person {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.appr-state .role-wait {
  color: var(--text-secondary);
}

.appr-actions {
  margin-top: var(--space-3);
}

@media (max-width: 720px) {
  .ver-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.role-grid + .role-grid,
.role-grid + .lock-note {
  margin-top: var(--space-3);
}

/* Ladebild beim ersten Laden und Reload (CHG-045, SPEC-037-AC-35…37): im HTML vor dem Rahmen; solange html.app-loading steht, ist alles andere ausgeblendet
   (Wartungsseite = dialog bleibt). Das Logomark pulsiert wie ein Herzschlag; bei reduzierter Bewegung ruhig. Ende: Klasse entfernt (app-loader.js), 0,25 s Ausblenden. */
html.app-loading body > :not(.app-loader, dialog, script) {
  display: none !important;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: var(--surface-app);
  color: var(--text-secondary);
  opacity: 1;
  transition: opacity 0.25s ease, visibility 0s;
}

html:not(.app-loading) .app-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s 0.25s;
}

.app-loader img {
  width: min(74px, calc(100vw - 32px));
  height: min(74px, calc(100vw - 32px));
  animation: app-loader-pulse 1.4s ease-in-out infinite;
}

.app-loader-slow {
  margin: 0;
  max-width: 32ch;
  text-align: center;
  font-size: var(--text-sm);
}

@keyframes app-loader-pulse {
  0% { transform: scale(1); opacity: 0.85; }
  14% { transform: scale(1.12); opacity: 1; }
  28% { transform: scale(1); opacity: 0.85; }
  42% { transform: scale(1.07); opacity: 1; }
  70%, 100% { transform: scale(1); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .app-loader { transition: none; }
  html:not(.app-loading) .app-loader { transition: none; }
  .app-loader img { animation: none; opacity: 1; }
}

/* Standard-CSM im Seitenkopf von Customer Access und gedämpfte Standardanzeige der Spalte „CSM“ (SPEC-233, IDEA-035) */
.std-csm {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.std-csm .tam-pick {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-2);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  background: var(--surface-field);
  color: var(--text-body);
  font: inherit;
  text-align: left;
}

.std-csm .tam-pick:hover:not(:disabled) {
  border-color: var(--text-primary);
}

.std-csm .tam-pick:disabled {
  color: var(--text-secondary);
  cursor: not-allowed;
}

.std-csm .tam-pick .owner-avatar {
  width: 22px;
  height: 22px;
}

.std-csm .tam-pick .pick-chevron {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  color: var(--text-secondary);
}

.access-table .std-text {
  color: var(--text-secondary);
}

.access-table .owner-avatar.std {
  opacity: 0.6;
}

/* ==== Eigenes Dropdown (SPEC-037-AC-38 … AC-41, CHG-056) ====================================================================== */
/* Das <select> bleibt das Feld: überall derselbe Pfeil aus Tokens statt des Systemzeichens; die Liste zeichnet select-field.js. */
select:not([multiple], [size]) {
  appearance: none;
  padding-right: 32px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
  cursor: pointer;
}

select:not([multiple], [size]):disabled {
  cursor: not-allowed;
}

.hs-select-list {
  position: fixed;
  inset: auto;
  margin: 0;
  box-sizing: border-box;
  overflow-y: auto;
  padding: var(--space-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-body);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--hs-deep-teal) 18%, transparent);
  font-size: var(--text-base);
  line-height: var(--leading-tight);
}

.hs-select-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3) 0 var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.hs-select-option .hs-select-check {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  visibility: hidden;
}

.hs-select-option[aria-selected="true"] .hs-select-check {
  visibility: visible;
}

.hs-select-option[aria-selected="true"] {
  font-weight: var(--weight-medium);
}

.hs-select-option .hs-select-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hs-select-option.hs-select-active {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}

.hs-select-option[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.hs-select-group-title {
  padding: var(--space-2) var(--space-2) var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

@media (pointer: coarse) {
  .hs-select-option {
    min-height: 44px;
  }
}

/* Kompakte Auswahlfelder ohne Rahmen (Werkzeugleiste der Eingabe, SLA-Auswahl) setzen Fläche und Innenabstand selbst: Pfeil und Platz dafür bleiben. */
.issue-detail .composer-bar .tools select,
.new-issue-page .composer-bar .tools select,
.portal-main .kpi-sla select {
  padding-right: 20px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 9px) calc(50% + 1px), calc(100% - 4px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
