/* Organisationsneutrale UI-Komponenten für alle Verwaltungsprodukte.
   Bestehende Klassen bleiben als kompatible Varianten erhalten. */
:root { --ui-control: 2.15rem; --ui-gap: .75rem; --ui-row: .6rem; }
/* Gemeinsame Kopfsuche: die geöffnete Fläche liegt unter allen Kopfaktionen. */
.app-shell .topbar { position:relative; }
.app-shell .topbar .ui-page-heading { flex:1 1 14rem; max-width:100%; }
.app-shell .topbar :is(h1,.eyebrow) {
 white-space:nowrap; overflow-wrap:normal; word-break:normal; hyphens:none;
 overflow:hidden; text-overflow:ellipsis;
}
.app-shell .topbar .topbar-actions { min-width:0; max-width:100%; }
.app-shell .topbar :is(.button,button) {
 white-space:nowrap; overflow-wrap:normal; word-break:normal; hyphens:none; flex-shrink:0;
}
.app-shell .ui-header-search { flex:0 0 auto; order:100; max-width:100%; }
.app-shell .ui-header-search [hidden] { display:none!important; }
.app-shell .ui-header-search .ui-search-toggle {
 width:2.8rem; height:2.8rem; min-height:2.8rem; padding:.6rem;
}
.app-shell .ui-search-toggle svg {
 width:1.25rem; height:1.25rem; fill:none; stroke:currentColor; stroke-width:1.8;
}
.app-shell .ui-search-toggle[aria-expanded=true] {
 background:var(--surface-soft); border-color:var(--primary); color:var(--primary);
}
.app-shell .ui-context-search {
 display:flex; align-items:center; gap:.5rem; margin:0; min-width:0;
 width:25rem; max-width:100%; box-sizing:border-box;
}
.app-shell .ui-context-search input {
 flex:1 1 0; width:100%; min-width:0; min-height:2.8rem; font-size:1rem;
 box-sizing:border-box; background:var(--surface-soft);
}
.app-shell .ui-context-search .button { min-height:2.8rem; }
.app-shell [data-ui-search-ready] .ui-context-search {
 position:absolute; z-index:1; top:100%; right:1rem;
 width:min(25rem,calc(100% - 2rem)); max-width:none; padding:.75rem;
 background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
 box-shadow:var(--shadow);
}
.app-shell { --primary-soft:color-mix(in srgb,var(--primary) 9%,#fff); font-size:.875rem; }
.app-shell .sidebar { padding:.75rem .5rem; }
.app-shell .brand { gap:.6rem; padding:.25rem .5rem 1rem; }
.app-shell .brand-mark { flex-shrink:0; background:var(--primary-soft); color:var(--text); }
.app-shell .sidebar :is(.nav-item,.portal-nav-group-toggle,.portal-nav-subitem) {
 color:var(--text); border-radius:5px; min-height:2.15rem; padding:.4rem .6rem;
}
.app-shell .sidebar :is(.nav-item,.portal-nav-group-toggle,.portal-nav-subitem):hover { background:var(--sidebar-soft); }
.app-shell .sidebar :is(.nav-item,.portal-nav-group-toggle,.portal-nav-subitem).active {
 background:var(--primary-soft); color:var(--text); font-weight:600;
 box-shadow:inset 3px 0 var(--primary);
}
.app-shell .sidebar .portal-nav-subitems { margin-left:1.2rem; padding-left:.5rem; border-color:var(--border); }
.app-shell .sidebar-footer { padding:.5rem .5rem 0; }
.app-shell .sidebar-footer .user-name { margin-bottom:.5rem; overflow-wrap:anywhere; }
.app-shell .topbar { gap:.75rem; }
.app-shell .ui-page-heading { min-width:0; }
@media (pointer:coarse), (max-width:900px) {
 .app-shell .sidebar :is(.nav-item,.portal-nav-group-toggle,.portal-nav-subitem) { min-height:2.8rem; }
}
/* Nur die Menüpunkte scrollen; Marke und Konto bleiben im Viewport. */
.app-shell .sidebar > .navigation {
 min-height:0; min-width:0; overflow-y:auto; overflow-x:hidden;
 overscroll-behavior-y:contain; scrollbar-gutter:stable;
 padding:6px; /* Platz für den gemeinsamen Tastaturfokus. */
}
.app-shell .sidebar > .navigation > * { flex-shrink:0; }
.app-shell .sidebar > :is(.brand,.sidebar-footer) { flex-shrink:0; min-width:0; overflow-wrap:anywhere; }
.app-shell .sidebar .brand > div { min-width:0; }
html[data-ui-density="comfort"] { --ui-control: 2.8rem; --ui-gap: 1rem; --ui-row: .85rem; }
:is(.app-shell,.ui-auth) :where(.button,.portal-button,.portal-edit-save,.portal-edit-cancel,.portal-filter-reset,.portal-filter-actions button,.form-actions button) {
 display:inline-flex; align-items:center; justify-content:center; gap:.4rem;
 min-height:var(--ui-control); padding:.4rem .8rem; border:1px solid var(--border);
 border-radius:6px; background:var(--surface,#fff); color:var(--text); text-decoration:none;
 font:inherit; font-weight:600; cursor:pointer; line-height:1.25;
}
:is(.app-shell,.ui-auth) :is(.button-primary,.portal-button-primary,.portal-edit-save) { background:var(--primary); color:var(--ui-primary-text,#fff); border-color:var(--primary); }
:is(.app-shell,.ui-auth) :is(.button-danger,.portal-button-danger) { background:#b42318; color:#fff; border-color:#b42318; }
.app-shell :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {
 min-height:var(--ui-control); max-width:100%; padding:.4rem .6rem; border:1px solid var(--border); border-radius:6px; font:inherit;
}
.app-shell :is(.form-grid,.portal-form-grid) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--ui-gap); }
.app-shell :is(.field,.portal-form-field) { min-width:0; display:flex; flex-direction:column; gap:.25rem; }
.app-shell :is(.field,.portal-form-field) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { width:100%; }
.app-shell :is(.portal-edit-page,.platform-form) { max-width:1200px; width:100%; }
.app-shell :is(.form-actions,.portal-edit-actions,.topbar-actions,.panel-actions,.ui-action-group) { display:flex; flex-wrap:wrap; align-items:center; gap:var(--ui-gap); }
.app-shell :is(th,td) { padding:var(--ui-row) .75rem; vertical-align:top; }
.app-shell :is(.panel,.portal-form-section) { padding:1rem; margin-bottom:1rem; }
.app-shell :is(.errorlist,.field-error,.form-errors) { color:#b42318; }
:is(.app-shell,.ui-auth) :is(a,button,input,select,textarea,summary):focus-visible { outline:3px solid var(--primary); outline-offset:3px; }
.app-shell button:disabled { opacity:.6; cursor:wait; }
.ui-density { display:flex; align-items:center; gap:.4rem; font-size:.85rem; }
.ui-menu-toggle { display:none!important; }
.ui-position .portal-form-grid { grid-template-columns:minmax(90px,1fr) 2fr 2fr repeat(4,minmax(70px,1fr)) auto; align-items:start; }
.ui-position textarea { min-height:var(--ui-control); height:var(--ui-control); }
.ui-totals { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:1rem; padding:1rem; background:var(--surface-soft); }
@media (max-width:900px), (pointer:coarse) {
 html:not([data-ui-density="compact"]) { --ui-control:2.8rem; --ui-gap:1rem; }
}
@media (max-width:900px) {
 .app-shell :is(.form-grid,.portal-form-grid), .ui-position .portal-form-grid { grid-template-columns:minmax(0,1fr); }
 .app-shell .field-wide { grid-column:auto; }
 .app-shell .topbar { flex-wrap:wrap; gap:.75rem; }
 .app-shell .content { min-width:0; }
 .app-shell:not(.vereins-shell) { display:block; }
 .app-shell:not(.vereins-shell) .sidebar { display:none; height:auto; position:static; }
 .app-shell.ui-menu-open .sidebar { display:flex; }
 .ui-menu-toggle { display:inline-flex!important; margin:.75rem; }
 .app-shell :is(.table-wrap,.table-wrapper,.portal-listenrahmen) { overflow-x:auto; max-width:100%; }
 .app-shell table { max-width:100%; }
}

/* Gemeinsame kompakte Filter und lesbare Detailangaben. */
.app-shell .ui-filter { display:grid; grid-template-columns:minmax(14rem,2fr) minmax(10rem,1fr) auto; align-items:end; gap:var(--ui-gap); }
.app-shell .ui-filter-members { grid-template-columns:minmax(10rem,1.5fr) minmax(0,3fr) auto; }
.app-shell .ui-filter label { margin:0; }
.app-shell .ui-filter :is(input,select) { box-sizing:border-box; width:100%; }
.app-shell .field-wide { grid-column:1 / -1; }
.app-shell .ui-facts { margin:0; }
.app-shell .ui-facts dt { color:var(--text-soft); font-size:.875rem; }
.app-shell .ui-facts dd { margin:.2rem 0 0; overflow-wrap:anywhere; }
.app-shell .ui-work-table td { overflow-wrap:anywhere; }
/* Filter bleiben ohne JavaScript vollständig bedienbar. */
.app-shell .ui-filter-more { min-width:0; }
.app-shell .ui-filter-more > summary { cursor:pointer; padding:.6rem; min-height:var(--ui-control); box-sizing:border-box; }
.app-shell .ui-filter-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ui-gap); }
@media (min-width:1200px) {
}
.app-shell .ui-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:var(--ui-gap); margin:.5rem 0; }
.app-shell .ui-toolbar :is(.form-actions,.portal-export-actions,.portal-result-count) { margin:0; }
.app-shell .ui-toolbar .portal-export-actions { margin-left:auto; }
.app-shell .ui-tabs { display:flex; flex-wrap:wrap; gap:.35rem; margin-bottom:1rem; border-bottom:1px solid var(--border); padding-bottom:.4rem; }
.app-shell .ui-tabs .button { border-radius:6px 6px 0 0; }
.app-shell .ui-tabs [aria-current=page] { box-shadow:inset 0 -3px 0 currentColor; }
.app-shell .ui-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--ui-gap); align-items:start; }
.app-shell .ui-detail-grid > .panel { min-width:0; margin:0; }
.app-shell .ui-detail-grid { margin-bottom:1rem; }
.app-shell .ui-work-table :is(table,th,td) { min-width:0; }
.app-shell .ui-work-table table { width:100%; table-layout:fixed; }
@media (max-width:1199px) and (min-width:651px) {
 .app-shell .ui-filter { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .app-shell .ui-filter-members { grid-template-columns:minmax(0,1fr) minmax(0,2fr); }
 .app-shell .ui-filter > .form-actions { grid-column:1 / -1; }
}
@media (max-width:900px) {
 .app-shell .ui-detail-grid { grid-template-columns:minmax(0,1fr); }
}
@media (pointer:coarse), (max-width:650px) {
 .app-shell :is(.ui-tabs,.ui-toolbar,.ui-work-table,.portal-member-list,.ui-filter) :is(.button,input,select,summary) { min-height:2.8rem; }
 .app-shell .portal-member-list input[type=checkbox] { width:1.5rem; min-height:1.5rem; margin:.65rem; }
}
@media (max-width:650px) {
 .app-shell :is(.ui-filter,.ui-filter-members) { grid-template-columns:minmax(0,1fr); }
 .app-shell .ui-filter-fields { grid-template-columns:minmax(0,1fr); }
 .app-shell .ui-toolbar > *, .app-shell .ui-tabs > * { flex:1 1 auto; }
 .app-shell .ui-work-table { overflow:visible; }
 .app-shell .ui-filter .form-actions > * { flex:1; }
 .app-shell .ui-work-table :is(table,tbody,tr,td,th) { display:block; width:auto; }
 .app-shell .ui-work-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
 .app-shell .ui-work-table tr { border:1px solid var(--border); border-radius:8px; padding:.5rem; margin-bottom:.75rem; background:var(--surface,#fff); }
 .app-shell .ui-work-table td .button { width:100%; box-sizing:border-box; }
 .app-shell .ui-work-table td[data-label]::before { content:attr(data-label); display:block; font-size:.8rem; color:var(--text-soft); }
}

/* Semantik wird an der Aktion vergeben, nicht aus ihrer Position abgeleitet. */
:is(.app-shell,.ui-auth) :is(.button-secondary,.portal-edit-cancel,.portal-filter-reset) {
 background:#e8edf2; color:#243247; border-color:#c5ced8;
}
.app-shell :is(.button-success,.portal-button-success) { background:#176534; color:#fff; border-color:#176534; }
.app-shell :is(.button,.portal-edit-save,.portal-edit-cancel):hover { filter:none; box-shadow:inset 0 0 0 1px currentColor; }
.app-shell :is(.button,.portal-edit-save,.portal-edit-cancel) { box-sizing:border-box; white-space:normal; overflow-wrap:anywhere; }
.app-shell .ui-member-number { font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }

/* Gemeinsame Formulare: kompakte Desktoparbeit, vollständige Fehler und Hilfen. */
.app-shell :is(.portal-edit-form,.portal-edit-grid) { gap:var(--ui-gap); }
.app-shell .portal-edit-section { padding:1rem; border-radius:8px; }
.app-shell .portal-edit-section-heading { margin-bottom:.75rem; }
.app-shell .portal-edit-header { margin-bottom:.75rem; }
.app-shell .portal-required-hint { margin:0; }
.app-shell .portal-edit-field { gap:.25rem; }
.app-shell :is(.field,.portal-form-field,.portal-edit-field) { min-width:0; overflow-wrap:anywhere; }
.app-shell :is(.field,.portal-form-field,.portal-edit-field) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {
 box-sizing:border-box; width:100%; min-width:0; height:auto; min-height:var(--ui-control); padding:.3rem .6rem; line-height:1.35;
}
.app-shell :is(.field,.portal-form-field,.portal-edit-field) textarea { min-height:5rem; resize:vertical; }
.app-shell :is(.field,.portal-form-field,.portal-edit-field) input:is([type=checkbox],[type=radio]) { align-self:flex-start; accent-color:var(--primary); }
.app-shell :is(.field,.portal-form-field,.portal-edit-field) label { cursor:pointer; }
.app-shell .portal-edit-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.app-shell .portal-edit-grid > .portal-edit-field { grid-column:auto; }
/* Der Formularinhalt (nach Abzug der Navigation) entscheidet über Spalten. */
.app-shell .portal-edit-form { container:ui-form / inline-size; }
.app-shell .portal-edit-grid { grid-template-columns:minmax(0,1fr); }
@container ui-form (min-width:36rem) {
 .app-shell .portal-edit-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .app-shell .portal-member-contact-grid { grid-template-columns:minmax(7rem,.3fr) minmax(0,.7fr) minmax(7rem,.3fr); }
 .app-shell .portal-member-contact-grid > :is(.ui-field-strasse,.ui-field-ort) { grid-column:span 2; }
 .app-shell .portal-member-contact-grid > :is(.ui-field-telefon,.ui-field-mobil,.ui-field-email) { grid-column:1 / -1; }
}
@container ui-form (min-width:58rem) {
 .app-shell .portal-edit-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .app-shell .portal-member-contact-grid { grid-template-columns:minmax(0,2fr) minmax(7rem,.65fr) minmax(7rem,.7fr) minmax(0,1.65fr); }
 .app-shell .portal-member-contact-grid > :is(.ui-field-strasse,.ui-field-ort) { grid-column:auto; }
 .app-shell .portal-member-contact-grid > :is(.ui-field-telefon,.ui-field-mobil,.ui-field-email) { grid-column:span 2; }
}
@media (max-width:700px) {
 .app-shell .portal-member-personal-grid .portal-form-control { max-width:100%; }
 .app-shell .portal-edit-actions > * { width:100%; }
}
/* Auch manuell kompakte Darstellung erhält auf Touchgeräten sichere Ziele. */
@media (max-width:700px), (pointer:coarse) {
 .app-shell :is(.button,.portal-edit-save,.portal-edit-cancel,.portal-filter-reset) { min-height:2.8rem; }
 .app-shell :is(.field,.portal-form-field,.portal-edit-field) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) { min-height:2.8rem; font-size:1rem; }
 .app-shell :is(.field,.portal-form-field,.portal-edit-field) label { min-height:1.75rem; }
 .app-shell :is(.field,.portal-form-field,.portal-edit-field) input:is([type=checkbox],[type=radio]) { width:1.5rem; height:1.5rem; margin:.5rem; }
}

:is(.app-shell,.ui-auth) :is(a,button,input,select,textarea,summary):focus-visible { outline-color:#243247; }
.app-shell .portal-profile-header { padding:1rem; margin-bottom:1rem; }
.app-shell .portal-detail-card { min-width:0; overflow-wrap:anywhere; }

/* Bewusst aktivierte Tabellenkomponente; keine globale Tabellenumgestaltung. */
.app-shell .ui-table-frame { background:#fff; border:1px solid var(--border); border-radius:var(--radius,8px); overflow-x:auto; }
.app-shell .ui-table { width:100%; border-collapse:collapse; background:#fff; text-align:left; }
.app-shell .ui-table :is(th,td) { padding:.6rem .8rem; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; }
.app-shell .ui-table th { background:#f8fafc; color:#526174; font-size:.75rem; font-weight:600; line-height:1.4; }
.app-shell .ui-table td { font-size:.875rem; }
.app-shell .ui-table tbody tr:last-child td { border-bottom:0; }
.app-shell .ui-table tbody tr:is(:hover,:focus-within) { background:#f1f5f9; }
.app-shell .ui-record-number { font-weight:700; font-variant-numeric:tabular-nums; }
.app-shell .ui-status { display:inline-block; padding:.15rem .5rem; background:#e8edf2; color:#243247; border-radius:5px; font-size:.8125rem; }
@media (max-width:650px) {
 .app-shell .ui-work-table.ui-table-frame { border:0; border-radius:0; background:transparent; overflow:visible; }
 .app-shell .ui-work-table .ui-table { background:transparent; }
 .app-shell .ui-work-table .ui-table td { border-bottom:1px solid var(--border); }
 .app-shell .ui-work-table .ui-table td:last-child { border-bottom:0; }
}

/* Gemeinsame Anmeldung ohne Navigationslayout. */
.ui-auth { min-height:100svh; padding:clamp(1rem,4vw,2rem); }
.ui-auth .login-card { padding:clamp(1.25rem,4vw,1.75rem); }
.ui-auth .login-brand { margin-bottom:1.25rem; }
.ui-auth .login-form { display:grid; gap:1rem; margin-top:1.25rem; }
.ui-auth .field { display:flex; flex-direction:column; gap:.4rem; min-width:0; }
.ui-auth label { font-weight:600; font-size:.9rem; }
.ui-auth input:not([type=hidden]) { width:100%; min-width:0; min-height:2.8rem; padding:.6rem .75rem; border:1px solid var(--border); border-radius:6px; font:inherit; font-size:1rem; background:var(--surface); color:var(--text); }
.ui-auth .button { min-height:2.8rem; }
.ui-auth .errorlist { margin:0; padding-left:1.25rem; color:#b42318; }
.ui-auth .login-error { margin:0; }
.ui-password { position:relative; }
.ui-auth .ui-password input,
.app-shell .field .ui-password input:not([type=hidden]):not([type=checkbox]):not([type=radio]) { padding-right:3.5rem; }
.ui-password-toggle { position:absolute; right:1px; top:1px; width:2.8rem; height:calc(100% - 2px); min-height:2.7rem; border:0; border-radius:5px; background:transparent; color:var(--text); cursor:pointer; display:grid; place-items:center; }
.ui-password-toggle[hidden] { display:none; }
.ui-password-toggle svg { width:1.4rem; height:1.4rem; fill:none; stroke:currentColor; stroke-width:1.8; }
.ui-password-toggle[aria-pressed=false] .ui-eye-slash { display:none; }

/* Bestehende Belegsortierung: gemeinsame Komponenten, unveränderte Selektoren. */
.kb-beleg-eintrag {
  padding: 1rem 0;
  border-bottom: 1px solid var(--portal-border, #d8dfe8);
}
.kb-beleg-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}
.kb-beleg-vorhanden {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin: .7rem 0;
}
.kb-beleg-form {
  display: grid;
  gap: .65rem;
  margin-top: 1rem;
}
.kb-seitenliste {
  display: grid;
  gap: .5rem;
  padding: 0;
  margin: .3rem 0;
  list-style: none;
}
.kb-seite {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem;
  border: 1px solid var(--portal-border, #d8dfe8);
  border-radius: .6rem;
}
.kb-seite-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.kb-seite button {
  min-width: 2.5rem;
  min-height: 2.5rem;
  cursor: pointer;
}
@media (max-width: 600px) {
  .kb-seite { flex-wrap: wrap; }
  .kb-seite-name { flex-basis: 100%; }
}

/* Zurückhaltende globale Ansichtssteuerung; Beschriftung bleibt zugänglich. */
.ui-visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.app-shell .ui-density { margin:0; flex:0 0 auto; }
.app-shell .ui-density select { width:auto; max-width:100%; font-size:.85rem; color:var(--text-muted, #475569); background:var(--surface, #fff); }
@media (pointer:coarse) {
 .app-shell :is(.button,.portal-button,.portal-edit-save,.portal-edit-cancel,input:not([type=checkbox]):not([type=radio]),select,summary) { min-height:44px; }
}

/* Gemeinsame Kennzahlenzeile: kompakte Fakten statt einzelner Aktionskarten. */
.app-shell .ui-summary-strip {
 display:flex; flex-wrap:wrap; width:fit-content; max-width:100%;
 margin:0 0 1rem; padding:0; background:var(--surface,#fff);
 border:1px solid var(--border); border-radius:var(--radius,8px); overflow:hidden;
}
.app-shell .ui-summary-strip > div { min-width:8rem; max-width:100%; padding:.5rem .85rem; border-inline-end:1px solid var(--border); }
.app-shell .ui-summary-strip dt { font-size:.8125rem; color:var(--text-soft); overflow-wrap:anywhere; }
.app-shell .ui-summary-strip dd { margin:.3rem 0 0; font-size:1.35rem; font-weight:700; font-variant-numeric:tabular-nums; line-height:1.2; }
.app-shell .ui-section-title { margin:0; font-size:1rem; line-height:1.5; }
@media (max-width:650px) {
 .app-shell .ui-summary-strip { display:grid; width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .app-shell .ui-summary-strip > div { min-width:0; }
}

/* Aktionsgruppen teilen Abstände und Umbruch in beiden Portalen. */
.app-shell :is(.form-actions,.portal-edit-actions,.panel-actions,.ui-action-group) > form { margin:0; }
.app-shell .ui-toolbar { align-items:center; }
.app-shell .ui-toolbar > .ui-action-group { margin-inline-start:auto; }
.app-shell .ui-inline-form { display:inline-flex; margin:0; vertical-align:middle; }
.app-shell .portal-edit-actions { margin:0; padding:.5rem 0 1rem; }
.app-shell :is(.field,.portal-form-field,.portal-edit-field) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select) { height:var(--ui-control); }
@media (max-width:700px) {
 .app-shell .ui-toolbar > .ui-action-group { margin-inline-start:0; width:100%; }
 .app-shell .ui-action-group > .button { flex:1 1 12rem; }
 .app-shell .portal-edit-actions { flex-direction:row; }
}
@media (max-width:700px), (pointer:coarse) {
 .app-shell :is(.field,.portal-form-field,.portal-edit-field) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select) { height:max(var(--ui-control),2.8rem); }
}

/* Gemeinsame Orientierung und aufgabenbezogene Desktopformulare. */
.app-shell .ui-breadcrumbs { padding:.6rem 1.25rem 0; font-size:.8125rem; }
.app-shell .ui-breadcrumbs ol { display:flex; flex-wrap:wrap; gap:.4rem; list-style:none; padding:0; margin:0; }
.app-shell .ui-breadcrumbs li + li::before { content:"/"; margin-inline-end:.4rem; color:var(--text-soft); }
.app-shell .ui-breadcrumbs a { color:var(--text); text-underline-offset:.2em; }
.app-shell .ui-skip-link { position:fixed; top:.5rem; left:.5rem; z-index:100; transform:translateY(-160%); }
.app-shell .ui-skip-link:focus { transform:none; }
.app-shell .ui-stack { margin-bottom:1rem; }
.app-shell .platform-form { container:ui-task / inline-size; max-width:none; }
.app-shell .ui-task-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--ui-gap); align-items:start; }
@container ui-task (min-width:36rem) {
 .app-shell .ui-task-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@container ui-task (min-width:64rem) {
 .app-shell .ui-task-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
.app-shell .ui-task-grid > :is(.form-actions,.note-box) { grid-column:1 / -1; }
.app-shell .ui-task-grid > button { justify-self:start; align-self:end; }
.app-shell .ui-task-grid .field-wide { grid-column:1 / -1; }
.app-shell .ui-optional { border:1px solid var(--border); border-radius:8px; padding:.75rem; margin-bottom:1rem; }
.app-shell .ui-optional > summary { cursor:pointer; font-weight:600; padding:.25rem; }
.app-shell .ui-optional[open] > summary { margin-bottom:.75rem; }
.app-shell .ui-choice { display:flex; align-items:center; gap:.5rem; min-height:2.8rem; cursor:pointer; }
.app-shell .ui-choice input { flex:0 0 auto; width:1.2rem; height:1.2rem; accent-color:var(--primary); }
.app-shell .ui-choice-text { display:block; font-size:.8125rem; color:var(--text-soft); }
.app-shell button:disabled { cursor:not-allowed; }
.app-shell .ui-work-table :is(th,td) { min-width:0; }
.app-shell .ui-work-table td > .button { font-size:inherit; }
.app-shell .sidebar-footer .button { width:100%; margin-top:.5rem; }
.app-shell .ui-toolbar :is(input,select) { min-width:0; }
@media (min-width:901px) {
 .app-shell .page-content { max-width:none; padding:1rem 1.25rem 2rem; }
 .app-shell .topbar { min-height:0; padding:1rem 1.25rem; }
 .app-shell .welcome { margin-bottom:1rem; }
}
@media (max-width:650px) {
 .app-shell .ui-work-table table { min-width:0; }
 .app-shell .ui-work-table td { text-align:left; }
 .app-shell .ui-toolbar > :is(input,select) { flex:1 1 100%; width:100%; }
 .app-shell .page-content { padding:1rem; }
}
/* Navigation bleibt ohne JavaScript auf schmalen Bildschirmen erreichbar. */
@media (max-width:900px) {
 html:not(.ui-js) .app-shell .sidebar { display:flex; height:auto; position:static; width:auto; }
}
.app-shell .ui-choice[hidden] { display:none; }
.app-shell .module-form { max-width:none; }
.app-shell .module-card { padding:var(--ui-gap); gap:var(--ui-gap); border-radius:8px; }
.app-shell .module-status-row { margin-top:.5rem; }
html:not(.ui-js) .ui-menu-toggle { display:none!important; }
/* Eigenständige Aktionsformulare nutzen die verfügbare Panelbreite. */
.app-shell form.ui-task-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr)); margin-top:var(--ui-gap); }
.app-shell .field > label { margin-bottom:0; }
@media (max-width:650px) {
 .app-shell form.ui-task-grid { grid-template-columns:minmax(0,1fr); }
}

/* Gemeinsame öffentliche Shell ohne interne Navigation. */
.ui-public-page.content { width: min(100%, 76rem); margin-inline: auto; padding: clamp(1rem, 3vw, 2rem); }
.ui-public-brand { display: flex; gap: .75rem; align-items: center; }
.ui-public-brand img { width: 3rem; height: 3rem; object-fit: contain; }
.ui-public-footer { margin-top: 1.5rem; padding-block: 1rem; border-top: 1px solid var(--ui-border, #d8dee8); }
.ui-preserve-lines { white-space: pre-line; overflow-wrap: anywhere; }
.ui-public-page .ui-task-grid > .field:has(textarea),
.portal-edit-form .ui-task-grid > .field:has(textarea) { grid-column: 1 / -1; }
.ui-public-page .field select { max-width: 100%; }

.app-shell.ui-public-shell { display: block; min-height: 100vh; }

.app-shell .ui-fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.app-shell .ui-fieldset legend { font-weight: 700; margin-bottom: .4rem; }
.app-shell .ui-fieldset + .ui-fieldset { margin-top: var(--ui-gap); }

/* Gemeinsame lesbare Inhaltsbereiche für Anleitungen und längere Hinweise. */
.ui-reading-content { padding: var(--ui-gap, 1rem); overflow-wrap: anywhere; }
.ui-reading-content > p, .ui-reading-content > ol, .ui-reading-content > details { max-width: 72ch; }
.ui-reading-content article + article { border-top: 1px solid var(--border, #d7deea); margin-top: 1rem; padding-top: 1rem; }
.ui-reading-content li + li { margin-top: .5rem; }

/* Desktop-Arbeitsfläche und Informationsdichte sind unabhängig voneinander. */
html[data-ui-density="compact"] { --ui-control:2rem; --ui-gap:.5rem; --ui-row:.35rem; }
.ui-auth-logo { width:4rem; height:4rem; flex-shrink:0; object-fit:contain; }
.app-shell .navigation :is(.nav-item,.portal-nav-subitem,.portal-nav-group-toggle) {
 min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere;
 hyphens:auto; line-height:1.4; text-overflow:clip;
}
.app-shell .navigation :is(.nav-icon,.portal-nav-chevron) { flex-shrink:0; }
.app-shell .portal-nav-group-toggle > span:not(.nav-icon):not(.portal-nav-chevron) { min-width:0; }
.app-shell :is(.table-wrap,.table-wrapper,.portal-listenrahmen) { max-width:100%; overflow-x:auto; }
.app-shell table { width:100%; border-collapse:collapse; font-size:.9rem; line-height:1.45; }
.app-shell thead th { background:var(--surface-soft); text-align:left; font-size:.8rem; }
.app-shell tbody tr:hover { background:var(--surface-soft); }
@media (min-width:901px) {
 .app-shell { grid-template-columns:var(--ui-sidebar-width) minmax(0,1fr); }
 .app-shell .sidebar { padding:.75rem .5rem; }
 .app-shell .topbar { flex-wrap:wrap; padding:.65rem 1.25rem; gap:1rem; border-bottom:1px solid var(--border); background:var(--surface); }
 .app-shell .topbar h1 { font-size:1.3rem; line-height:1.25; }
 .app-shell .topbar-actions { margin-left:auto; justify-content:flex-end; }
 .app-shell .page-content { padding:1.25rem 1.5rem; max-width:none; }
 .app-shell :is(.panel,.portal-form-section) { padding:calc(var(--ui-gap) + .25rem); }
 .app-shell .dashboard-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,24rem),1fr)); align-items:start; gap:var(--ui-gap); }
}
@media (min-width:1600px) {
 .app-shell .page-content { padding:1.5rem 2rem; }
}
@media (max-width:900px) {
 .app-shell .ui-density { flex-wrap:wrap; }
 .app-shell .topbar-actions { width:100%; }
}

/* Zwei Arbeitsansichten, unabhängig von der physischen Bildschirmbreite.
   Ohne JavaScript gelten weiterhin die responsiven Basisregeln. */
.ui-view-switch { display:flex; flex-wrap:wrap; gap:.25rem; margin-inline-start:auto; align-items:center; }
.ui-view-switch svg { width:1.25rem; height:1.25rem; fill:none; stroke:currentColor; stroke-width:1.7; }
.app-shell .ui-view-switch [aria-pressed=true] { background:var(--primary); color:var(--ui-primary-text,#fff); border-color:var(--primary); }
html[data-ui-view=desktop] { --ui-control:2.15rem; --ui-gap:.5rem; --ui-row:.35rem; }
html[data-ui-view=mobile] { --ui-control:2.8rem; --ui-gap:.75rem; --ui-row:.6rem; }
html[data-ui-view=desktop] .app-shell { display:grid; grid-template-columns:var(--ui-sidebar-width) minmax(0,1fr); }
html[data-ui-view=desktop] .app-shell .sidebar { display:flex; position:sticky; top:0; width:auto; height:100dvh; transform:none; box-shadow:none; }
html[data-ui-view=desktop] .app-shell :is(.ui-menu-toggle,.portal-mobile-menu,.portal-menu-overlay) { display:none!important; }
html[data-ui-view=desktop] .app-shell :is(.form-grid,.portal-form-grid,.portal-edit-grid,.ui-task-grid) { grid-template-columns:repeat(2,minmax(0,1fr)); }
html[data-ui-view=desktop] .app-shell .ui-filter { grid-template-columns:minmax(10rem,1fr) minmax(12rem,2fr) auto; }
html[data-ui-view=desktop] .app-shell .ui-filter-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
html[data-ui-view=desktop] .app-shell :is(.dashboard-grid,.portal-fachmodul-grid,.ui-detail-grid) { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr)); gap:var(--ui-gap); }
html[data-ui-view=desktop] .app-shell .topbar-actions { width:auto; margin-left:auto; }
html[data-ui-view=desktop] .app-shell .portal-edit-actions > * { width:auto; }
html[data-ui-view=desktop] .app-shell :is(.ui-responsive-table,.portal-tabelle,.ui-table,.data-table) { display:table; min-width:38rem; width:100%; table-layout:auto; }
html[data-ui-view=desktop] .app-shell :is(.ui-responsive-table,.portal-tabelle,.ui-table,.data-table) thead { display:table-header-group; position:static; width:auto; height:auto; clip-path:none; overflow:visible; }
html[data-ui-view=desktop] .app-shell :is(.ui-responsive-table,.portal-tabelle,.ui-table,.data-table) tbody { display:table-row-group; }
html[data-ui-view=desktop] .app-shell :is(.ui-responsive-table,.portal-tabelle,.ui-table,.data-table) tr { display:table-row; border:0; padding:0; }
html[data-ui-view=desktop] .app-shell :is(.ui-responsive-table,.portal-tabelle,.ui-table,.data-table) :is(th,td) { display:table-cell; width:auto; padding:var(--ui-row) .65rem; text-align:left; border-bottom:1px solid var(--border); }
html[data-ui-view=desktop] .app-shell :is(.ui-responsive-table,.portal-tabelle,.ui-table,.data-table) td::before { content:none; }
html[data-ui-view=desktop] .app-shell :is(.ui-responsive-table,.portal-tabelle,.ui-table,.data-table) td .button { width:auto; }
html[data-ui-view=mobile] .app-shell { display:block; }
html[data-ui-view=mobile] .app-shell .sidebar { display:none; position:static; transform:none; width:auto; height:auto; box-shadow:none; }
html[data-ui-view=mobile] .app-shell:is(.ui-menu-open,.portal-menu-open) .sidebar { display:flex; }
html[data-ui-view=mobile] .app-shell :is(.ui-menu-toggle,.portal-mobile-menu) { display:inline-flex!important; align-items:center; justify-content:center; min-width:44px; min-height:44px; }
html[data-ui-view=mobile] .app-shell .portal-menu-overlay { display:none; }
html[data-ui-view=mobile] .app-shell .topbar { flex-wrap:wrap; gap:.75rem; }
html[data-ui-view=mobile] .app-shell .topbar-actions { width:100%; }
html[data-ui-view=mobile] .app-shell :is(.form-grid,.portal-form-grid,.portal-edit-grid,.ui-task-grid,.ui-filter,.ui-filter-fields,.ui-detail-grid,.dashboard-grid,.portal-fachmodul-grid) { display:grid; grid-template-columns:minmax(0,1fr); }
html[data-ui-view=mobile] .app-shell :is(.field,.portal-edit-field,.portal-form-field) { grid-column:1 / -1; }
html[data-ui-view=mobile] .app-shell :is(.button,button,input,select,summary) { min-height:2.8rem; }
html[data-ui-view=mobile] .app-shell input:is([type=checkbox],[type=radio]) { min-height:1.5rem; width:1.5rem; }
html[data-ui-view=mobile] .app-shell :is(.ui-responsive-table,.ui-responsive-table tbody) { display:block; min-width:0; width:100%; table-layout:auto; }

/* Korrektur: bewährtes mobiles Seitenmenü statt Verschieben des Seiteninhalts. */
html[data-ui-view=mobile] .vereins-shell .sidebar {
 display:flex; position:fixed; z-index:1002; top:0; left:0;
 width:min(290px,85vw); height:100dvh; overflow:hidden;
 transform:translateX(-105%); transition:transform .2s ease;
 box-shadow:8px 0 30px rgb(0 0 0 / 12%); visibility:hidden;
}
html[data-ui-view=mobile] .vereins-shell.portal-menu-open .sidebar { transform:translateX(0); visibility:visible; }
html[data-ui-view=mobile] .vereins-shell.portal-menu-open .portal-menu-overlay {
 display:block; position:fixed; z-index:1001; inset:0; width:100%; border:0;
 padding:0; background:rgb(15 23 42 / 48%); cursor:pointer;
}
/* Kleine Symbolsteuerung, unabhängig von gemeinsamen Aktionsbutton-Mindestgrößen. */
.app-shell .ui-view-switch .button {
 width:2rem; height:2rem; min-height:2rem; padding:.3rem; border-color:transparent;
 background:transparent; color:var(--text-soft); border-radius:5px;
}
.app-shell .ui-view-switch [aria-pressed=true] { color:var(--primary); background:var(--surface-soft); border-color:var(--border); }
.app-shell .topbar-actions .ui-view-switch { order:99; flex:0 0 auto; }
html[data-ui-view=desktop] .app-shell .page-content { max-width:none; padding:1rem 1.25rem; container:ui-workspace / inline-size; }
html[data-ui-view=desktop] .app-shell .sidebar { padding:.75rem .5rem; }
html[data-ui-view=desktop] .app-shell .portal-edit-page { max-width:none; }
html[data-ui-view=desktop] .app-shell .portal-filter.portal-filter-form {
 display:grid; grid-template-columns:minmax(12rem,2fr) minmax(9rem,1fr) auto; align-items:end;
}
html[data-ui-view=desktop] .app-shell .portal-filter.portal-filter-form > :is(.portal-filter-search,.portal-filter-actions) { grid-column:auto; }
html[data-ui-view=desktop] .app-shell .portal-filter-actions { display:flex; flex-wrap:wrap; gap:.5rem; }
html[data-ui-view=desktop] .app-shell .portal-member-list table { table-layout:auto; }
html[data-ui-view=desktop] .app-shell .portal-member-list th:first-child { width:3rem; }
html[data-ui-view=desktop] .app-shell .ui-finance-table :is(th,td):nth-last-child(-n+3) { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
html[data-ui-view=desktop] .app-shell .portal-fachmodul-grid > .panel {
 display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.5rem 1rem; align-items:center;
}
html[data-ui-view=desktop] .app-shell .portal-fachmodul-grid .portal-fachmodul-card-top { grid-column:1 / -1; }
html[data-ui-view=desktop] .app-shell .portal-fachmodul-grid .panel > p { grid-column:1 / -1; margin:0; }
@container ui-workspace (min-width:54rem) {
 html[data-ui-view=desktop] .app-shell .portal-edit-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
 html[data-ui-view=desktop] .app-shell .portal-member-personal-grid { grid-template-columns:minmax(7rem,1fr) repeat(2,minmax(0,2fr)); }
 html[data-ui-view=desktop] .app-shell .portal-member-contact-grid { grid-template-columns:2fr .7fr .8fr 2fr; }
 html[data-ui-view=desktop] .app-shell .portal-member-contact-grid > .portal-edit-field { grid-column:auto; }
 html[data-ui-view=desktop] .app-shell .portal-member-contact-grid > :is(.ui-field-telefon,.ui-field-mobil) { grid-column:auto; }
 html[data-ui-view=desktop] .app-shell .portal-member-contact-grid > .ui-field-email { grid-column:span 2; }
}
/* Kleine Desktopfenster behalten alle Spalten durch lokales Scrollen. */
html[data-ui-view=desktop] .app-shell .content { min-width:0; }
html[data-ui-view=desktop] .app-shell .ui-filter { grid-template-columns:minmax(0,1fr); }
@container ui-workspace (min-width:48rem) {
 html[data-ui-view=desktop] .app-shell .ui-filter { grid-template-columns:minmax(10rem,1fr) minmax(0,3fr) auto; }
}

/* Die ursprünglichen Mitgliederkarten auch bei manueller Mobilwahl am Desktop. */
@media (min-width:651px) {
 html[data-ui-view=mobile] .app-shell .portal-member-list { border:0; background:transparent; overflow:visible; }
 html[data-ui-view=mobile] .app-shell .portal-member-list :is(table,tbody) { display:block; }
 html[data-ui-view=mobile] .app-shell .portal-member-list thead { display:none; }
 html[data-ui-view=mobile] .app-shell .portal-member-list tr { display:block; padding:12px; margin-bottom:12px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
 html[data-ui-view=mobile] .app-shell .portal-member-list td { display:flex; justify-content:space-between; gap:12px; padding:7px 4px; border:0; text-align:right; }
 html[data-ui-view=mobile] .app-shell .portal-member-list td::before { content:attr(data-label); color:var(--text-soft); text-align:left; }
 html[data-ui-view=mobile] .app-shell .portal-member-list td[data-label=Mitglied] { font-size:1rem; font-weight:700; }
 html[data-ui-view=mobile] .app-shell .portal-member-list td[colspan] { display:block; text-align:left; }
 html[data-ui-view=mobile] .app-shell .portal-member-list td[colspan]::before { content:none; }
}

/* Arbeitslisten: native Details bleiben in Safari geschlossen und bedienbar.
   DOM-Reihenfolge: Suche, Suchen, Zurücksetzen, Filter, Zusatzfelder. */
.app-shell .ui-searchbar {
 position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto auto;
 align-items:center; gap:.5rem; padding:.65rem; margin:0 0 .5rem;
}
.app-shell .ui-searchbar > .field { margin:0; min-width:0; }
.app-shell .ui-searchbar > .field > span {
 position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%);
}
.app-shell .ui-searchbar .ui-search-reset { margin-inline-end:13rem; }
.app-shell .ui-searchbar-more { grid-column:1 / -1; min-width:0; }
.app-shell .ui-searchbar-more:not([open]) { margin-top:-.5rem; }
.app-shell .ui-searchbar-more > summary {
 display:list-item; position:absolute; top:.65rem; right:.65rem;
 box-sizing:border-box; min-height:var(--ui-control); padding:.4rem .6rem;
 border:1px solid var(--border); border-radius:6px; color:var(--text-soft);
 font-size:.875rem; cursor:pointer; line-height:1.4;
}
.app-shell .ui-searchbar-more[open] > summary { color:var(--text); background:var(--surface-soft); }
.app-shell .ui-searchbar-more > .ui-filter-fields {
 gap:.65rem; padding-top:.65rem; border-top:1px solid var(--border);
 align-items:start;
}
.app-shell .ui-searchbar .ui-filter-fields .field { margin:0; display:flex; flex-direction:column; gap:.25rem; }
.app-shell .ui-searchbar :is(input,select) { box-sizing:border-box; width:100%; }
.app-shell .ui-list-actions { gap:.5rem; margin:.5rem 0; }
.app-shell .ui-list-actions .portal-export-actions { margin-left:0; }
.app-shell .ui-list-actions .portal-result-count { margin-inline-start:auto; order:2; font-size:.875rem; }
@media (min-width:901px) and (pointer:fine) {
 html:not([data-ui-view=mobile]) { --ui-control:2rem; --ui-gap:.5rem; --ui-row:.25rem; }
 html:not([data-ui-view=mobile]) .app-shell .topbar { padding:.45rem 1rem; min-height:0; gap:.5rem 1rem; }
 html:not([data-ui-view=mobile]) .app-shell .topbar h1 { margin:0; font-size:1.3rem; }
 html:not([data-ui-view=mobile]) .app-shell .page-content { padding:.75rem 1rem; }
 html:not([data-ui-view=mobile]) .app-shell .brand { padding-bottom:.5rem; }
 html:not([data-ui-view=mobile]) .app-shell .navigation { gap:.2rem; }
 html:not([data-ui-view=mobile]) .app-shell .nav-heading { margin:.75rem .5rem .25rem; }
 html:not([data-ui-view=mobile]) .app-shell .sidebar :is(.nav-item,.portal-nav-group-toggle,.portal-nav-subitem) { min-height:2rem; padding:.25rem .5rem; }
 html:not([data-ui-view=mobile]) .app-shell :is(.panel,.portal-form-section,.portal-edit-section,.ui-record-section) { padding:.65rem .75rem; margin-bottom:.5rem; }
 html:not([data-ui-view=mobile]) .app-shell :is(.panel-header,.portal-edit-section-heading) { margin-bottom:.5rem; }
 html:not([data-ui-view=mobile]) .app-shell :is(.panel-header h2,.portal-edit-section-heading h2) { font-size:1rem; margin:0 0 .2rem; }
 html:not([data-ui-view=mobile]) .app-shell .portal-edit-header > div { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; }
 html:not([data-ui-view=mobile]) .app-shell .portal-edit-actions { padding:.25rem 0 .5rem; }
 html:not([data-ui-view=mobile]) .app-shell .portal-edit-page .portal-edit-field :is(input.portal-form-control,select.portal-form-control) { height:var(--ui-control); min-height:var(--ui-control); }
 html:not([data-ui-view=mobile]) .app-shell .portal-date-button { width:1.75rem; height:1.75rem; min-height:1.75rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-searchbar { padding:.5rem; gap:.375rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-searchbar-more > summary { top:.5rem; right:.5rem; padding:.3rem .5rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-searchbar-more > .ui-filter-fields { padding-top:.5rem; gap:.5rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-list-actions { gap:.375rem; margin:.375rem 0; }
 html:not([data-ui-view=mobile]) .app-shell .ui-table :is(th,td) {
 height:32px; box-sizing:border-box; padding:.2rem .5rem; line-height:1.35;
 }
 html:not([data-ui-view=mobile]) .app-shell .ui-table td .button { min-height:1.65rem; padding:.15rem .45rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-table .ui-status { padding:.1rem .4rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-record-header { margin-bottom:.5rem; gap:.5rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-record-section dl > div { padding:.25rem 0; }
 html:not([data-ui-view=mobile]) .app-shell .ui-side-detail { padding:.65rem .75rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-side-detail-bar { margin-bottom:.5rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-side-detail .ui-record-section { padding:.5rem 0; margin:0; }
 html:not([data-ui-view=mobile]) .app-shell .portal-select-cell input { margin:0; vertical-align:middle; }
 html:not([data-ui-view=mobile]) .app-shell .compact-welcome { padding:0; margin-bottom:.5rem; }
 html:not([data-ui-view=mobile]) .app-shell .mini-metrics { margin-bottom:.5rem; gap:.5rem; }
 html:not([data-ui-view=mobile]) .app-shell .mini-metric { padding:.5rem .75rem; }
}
/* Explizite Mobilwahl und schmale Fenster erhalten große Touchziele. */
@media (max-width:900px) {
 .app-shell .ui-searchbar { grid-template-columns:minmax(0,1fr) auto; }
 .app-shell .ui-searchbar .ui-search-reset { margin-inline-end:0; }
 .app-shell .ui-searchbar-more > summary { position:static; }
 .app-shell .ui-searchbar-more:not([open]) { margin-top:0; }
 .app-shell .ui-searchbar .ui-filter-fields { grid-template-columns:minmax(0,1fr); }
}
html[data-ui-view=mobile] .app-shell .ui-searchbar { grid-template-columns:minmax(0,1fr); }
html[data-ui-view=mobile] .app-shell .ui-searchbar .ui-search-reset { margin-inline-end:0; }
html[data-ui-view=mobile] .app-shell .ui-searchbar-more > summary { position:static; }
html[data-ui-view=mobile] .app-shell .ui-searchbar-more:not([open]) { margin-top:0; }

.app-shell .ui-searchbar-basic .ui-search-reset { margin-inline-end:0; }

@container ui-workspace (min-width:54rem) {
 html[data-ui-view=desktop] .app-shell .ui-task-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media (min-width:901px) {
 html:not([data-ui-view=mobile]) .app-shell .portal-fachmodul-header { margin:0 0 .5rem; padding:0; }
 html:not([data-ui-view=mobile]) .app-shell .portal-fachmodul-header p { margin:0; font-size:.875rem; }
}

/* Gemeinsame Mehrfachauswahl: native Checkboxen für Touch und Tastatur. */
.app-shell .ui-choice-list { max-height:22rem; overflow:auto; border:1px solid var(--border); border-radius:.5rem; padding:.5rem; }
.app-shell .ui-choice-list label { display:flex; align-items:center; gap:.5rem; min-height:2.8rem; cursor:pointer; overflow-wrap:anywhere; }
.app-shell .ui-choice-list input[type=checkbox] { flex:0 0 auto; width:1.5rem; height:1.5rem; }
.app-shell .ui-task-grid > .field:has(.ui-choice-list) { grid-column:1 / -1; }

/* Gemeinsame kompakte Formularanordnung für Vereinsfunktionen. */
.app-shell .portal-function-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}
.app-shell .portal-function-grid .portal-edit-field { min-width: 0; }
.app-shell .portal-function-grid .portal-function-description { grid-column: 1 / -1; }
.app-shell .portal-function-description textarea { min-height: 5rem; height: 5rem; }
.app-shell .portal-function-grid .portal-function-active { grid-column: auto; }
@media (max-width: 700px) {
    .app-shell .portal-function-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Bestehende Portal-Switches: vollständige berührbare Label-Fläche. */
.app-shell .portal-function-switch { min-height:44px; }

/* Datensatzarbeit: dieselben Komponenten für jedes Verwaltungsprodukt. */
.app-shell .page-content { container:ui-workspace / inline-size; }
.app-shell .ui-list-detail { display:grid; grid-template-columns:minmax(0,1fr); gap:1rem; align-items:start; }
.app-shell .ui-list-detail-main { min-width:0; }
.app-shell .ui-side-detail {
 min-width:0; padding:1rem; border:1px solid var(--border); border-radius:var(--radius);
 background:var(--surface); overflow-wrap:anywhere;
}
.app-shell .ui-side-detail-bar { display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-bottom:.75rem; }
.app-shell .ui-side-detail-bar .eyebrow { margin:0; }
.app-shell .ui-side-detail:focus-visible { outline:3px solid #243247; outline-offset:3px; }
.app-shell .ui-record-header { padding:0; gap:.75rem; margin:0 0 1rem; align-items:center; }
.app-shell .ui-record-header h2 { font-size:1.25rem; margin:.2rem 0 .4rem; }
.app-shell .ui-record-avatar {
 display:grid; flex:0 0 auto; place-items:center; width:2.8rem; height:2.8rem;
 border-radius:6px; font-size:1rem; font-weight:700; background:var(--primary-soft); color:var(--text);
}
.app-shell .ui-record-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap:.75rem; margin-bottom:1rem; }
.app-shell .ui-record-section { padding:1rem; border-radius:var(--radius); box-shadow:none; }
.app-shell .ui-record-section h3 { font-size:.9rem; margin:0 0 .5rem; }
.app-shell .ui-record-section dl > div { grid-template-columns:minmax(0,2fr) minmax(0,3fr); gap:.5rem; padding:.4rem 0; }
.app-shell .ui-record-section dd { font-size:.875rem; font-weight:500; }
.app-shell .ui-side-detail .ui-record-grid { display:block; margin:0; }
.app-shell .ui-side-detail .ui-record-section { padding:.75rem 0; border:0; border-top:1px solid var(--border); border-radius:0; }
.app-shell .ui-side-detail .ui-record-hint { display:none; }
.app-shell .ui-side-detail-actions { padding-top:.75rem; border-top:1px solid var(--border); }
.app-shell .ui-side-detail-actions > .button { flex:1 1 auto; }
.app-shell .ui-table-actions { width:6rem; }
.app-shell .ui-table td { overflow-wrap:anywhere; }
.app-shell .ui-table tbody tr.ui-row-selected { background:var(--primary-soft); box-shadow:inset 3px 0 var(--primary); }
.app-shell .ui-list-detail tr:focus-visible { outline:3px solid #243247; outline-offset:-3px; }
.app-shell .ui-table .portal-mitglied-link { justify-content:flex-start; text-align:left; }
.app-shell .ui-status-success { background:var(--success-bg); color:var(--success); }
.app-shell .ui-status-warning { background:var(--warning-bg); color:var(--warning); }
.app-shell .ui-empty-state { padding:1.5rem .75rem; text-align:center; }
.app-shell .ui-empty-state p { color:var(--text-soft); }
/* Seitenbereich erst, wenn Liste UND Details genügend Arbeitsbreite haben. */
@container ui-workspace (min-width:54rem) {
 html:not([data-ui-view=mobile]) .app-shell .ui-list-detail:has(> .ui-side-detail) { grid-template-columns:minmax(0,1fr) clamp(18rem,28cqi,23rem); gap:.75rem; }
 html:not([data-ui-view=mobile]) .app-shell .ui-list-detail .ui-table { min-width:0; }
 html.ui-js:not([data-ui-view=mobile]) .app-shell .ui-list-detail > .ui-side-detail {
 position:sticky; top:calc(var(--ui-topbar-height,0px) + .75rem);
 max-height:calc(100vh - var(--ui-topbar-height,0px) - 1.5rem);
 max-height:calc(100dvh - var(--ui-topbar-height,0px) - 1.5rem);
 box-sizing:border-box; overflow-y:auto; scrollbar-gutter:stable;
 }
}
/* Ein gemeinsamer Scrollvertrag: nur die Tabelle scrollt horizontal,
   die Kopfzeile bleibt außerhalb des Detail-Scrollcontainers. Ohne JS
   bleibt die Kurzansicht im Dokumentfluss, ohne geschätzte Kopfhöhe. */
.app-shell :is(.ui-side-detail,.ui-list-detail tr) { scroll-margin-top:calc(var(--ui-topbar-height,0px) + .75rem); }
.app-shell :is(a,button,input,select,textarea,summary):focus { scroll-margin-top:calc(var(--ui-topbar-height,0px) + .75rem); scroll-margin-bottom:.75rem; }
@media (min-width:901px) {
 html.ui-js:not([data-ui-view=mobile]) .app-shell .topbar { position:sticky; top:0; z-index:30; background:var(--surface); }
}
@container ui-workspace (min-width:80rem) {
 html:not([data-ui-view=mobile]) .app-shell .ui-searchbar .ui-filter-fields { grid-template-columns:repeat(6,minmax(0,1fr)); }
 html:not([data-ui-view=mobile]) .app-shell .portal-edit-grid:not(.portal-member-contact-grid):not(.portal-member-personal-grid) { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (pointer:coarse), (max-width:900px) {
 .app-shell { --ui-control:2.8rem; }
 html .app-shell .ui-view-switch .button { width:2.8rem; height:2.8rem; min-height:2.8rem; }
}
@media (max-width:900px) {
 html:not(.ui-js) .app-shell .sidebar { transform:none; visibility:visible; }
 html:not(.ui-js) .app-shell .portal-mobile-menu { display:none; }
}

/* Rastervariante der gemeinsamen nativen Mehrfachauswahl. */
.app-shell [data-ui-choice-actions][hidden] { display:none; }
.app-shell [data-ui-choice-actions] { margin-bottom:var(--ui-gap); }
.app-shell .ui-choice-list.ui-choice-grid {
 display:grid; grid-template-columns:minmax(0,1fr); gap:var(--ui-gap);
 max-height:none; overflow:visible; border:0; border-radius:0; padding:0;
}
.app-shell .ui-choice-grid label { min-height:var(--ui-control); font-weight:400; }
@container ui-workspace (min-width:30rem) {
 .app-shell .ui-choice-list.ui-choice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@container ui-workspace (min-width:45rem) {
 .app-shell .ui-choice-list.ui-choice-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@container ui-workspace (min-width:60rem) {
 .app-shell .ui-choice-list.ui-choice-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (pointer:coarse), (max-width:900px) {
 .app-shell .ui-choice-grid label { min-height:2.8rem; }
}

/* Gemeinsame Komponenten in einer vorhandenen administrativen Rahmenseite. */
.app-shell.ui-embedded { display:block; min-height:0; }

/* Formulargruppen bemessen ihre Spalten an der eigenen verfügbaren Breite. */
.app-shell .ui-form-section { container:ui-fields / inline-size; min-width:0; }
html .app-shell .ui-form-section .ui-task-grid { grid-template-columns:minmax(0,1fr); }
@container ui-fields (min-width:24rem) {
 html:not([data-ui-view=mobile]) .app-shell .ui-form-section .ui-task-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@container ui-fields (min-width:60rem) {
 html:not([data-ui-view=mobile]) .app-shell .ui-form-section .ui-task-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
.app-shell .ui-form-section :is(h2,h3) { margin:0 0 .6rem; font-size:1rem; }
.app-shell .ui-form-section .ui-task-grid > .field:has(textarea) { grid-column:1 / -1; }
.app-shell :is(.ui-record-header,.ui-record-section) { min-width:0; overflow-wrap:anywhere; }
.app-shell .ui-record-section .panel-heading { margin-bottom:.5rem; }
.app-shell .ui-record-section .list-row { padding:.5rem 0; }
.app-shell .ui-record-section .list-row > div { min-width:0; }
.app-shell .ui-form-section { overflow:visible; }
.app-shell .ui-record-header .detail-status { margin-top:.25rem; }
.app-shell .ui-record-grid > .module-card { flex-direction:column; align-items:stretch; min-width:0; overflow-wrap:anywhere; }
.app-shell .ui-record-grid .module-switch-area { width:auto; flex-basis:auto; }
.app-shell .readonly-field { min-height:var(--ui-control); padding:.4rem .6rem; overflow-wrap:anywhere; }

/* Editierbare Tabellen bleiben lokal scrollbar und werden mobil zu Zeilenkarten. */
.app-shell .ui-work-table .ui-editable-table { table-layout:auto; min-width:54rem; }
.app-shell .ui-editable-table th:first-child { width:32%; }
.app-shell .ui-editable-table .field + .field { margin-top:.4rem; }
.app-shell .ui-editable-table .ui-optional { margin:.5rem 0 0; padding:.4rem; }
.app-shell .ui-editable-table .field > label { font-size:.75rem; }
.app-shell .ui-editable-table :is(input,select,textarea) { min-width:0; }
.app-shell :is(section,details)[id] { scroll-margin-top:calc(var(--ui-topbar-height,0px) + .75rem); }
@media (max-width:650px) {
 html:not([data-ui-view=desktop]) .app-shell .ui-work-table .ui-editable-table { min-width:0; }
}
html[data-ui-view=mobile] .app-shell .ui-work-table .ui-editable-table { min-width:0; }
/* Kalender in scrollbaren Editortabellen öffnen im Zeilenfluss. */
.app-shell .ui-editable-table .portal-date-wrapper { flex-wrap:wrap; }
.app-shell .ui-editable-table .portal-date-calendar { position:static; width:min(20rem,100%); margin-top:.4rem; flex:1 1 100%; }
.app-shell .ui-editable-table .portal-date-button { top:.1rem; transform:none; }
/* Die manuelle Mobilwahl nutzt dieselbe Kartenansicht wie schmale Geräte. */
html[data-ui-view=mobile] .app-shell .ui-work-table { overflow:visible; border:0; background:transparent; }
html[data-ui-view=mobile] .app-shell .ui-work-table :is(table,tbody,tr,td) { display:block; width:auto; min-width:0; }
html[data-ui-view=mobile] .app-shell .ui-work-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
html[data-ui-view=mobile] .app-shell .ui-work-table tr { border:1px solid var(--border); border-radius:8px; padding:.5rem; margin-bottom:.75rem; background:var(--surface); }
html[data-ui-view=mobile] .app-shell .ui-work-table td[data-label]::before { content:attr(data-label); display:block; font-size:.8rem; color:var(--text-soft); }
html[data-ui-view=mobile] .app-shell .ui-work-table td .button { width:100%; }
html[data-ui-view=mobile] .app-shell .ui-work-table td { text-align:left; }
html[data-ui-view=mobile] .app-shell .ui-record-grid { grid-template-columns:minmax(0,1fr); }
@media (pointer:coarse), (max-width:900px) {
 .app-shell .ui-record-section .list-row { min-height:2.8rem; }
}
@media (max-width:650px) {
 .app-shell .topbar :is(h1,.eyebrow,.button,button) { white-space:normal; overflow-wrap:anywhere; }
 .app-shell .topbar-actions > :is(.button,.ui-inline-form) { flex:1 1 auto; }
 .app-shell .topbar-actions .ui-inline-form > .button { width:100%; }
}

/* Gemeinsame Anschrift: Straße hat Vorrang, PLZ/Ort bilden die zweite Zeile. */
.app-shell .ui-address-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--ui-gap); }
@container ui-fields (min-width:24rem) {
 html:not([data-ui-view=mobile]) .app-shell .ui-address-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
 html:not([data-ui-view=mobile]) .app-shell .ui-address-grid > :nth-child(1) { grid-column:span 3; }
 html:not([data-ui-view=mobile]) .app-shell .ui-address-grid > :nth-child(3) { grid-column:span 1; }
 html:not([data-ui-view=mobile]) .app-shell .ui-address-grid > :nth-child(4) { grid-column:span 3; }
 html:not([data-ui-view=mobile]) .app-shell .ui-address-grid > :nth-child(5) { grid-column:1 / -1; }
}
.app-shell .ui-checkbox-field { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:.4rem .6rem; }
.app-shell .ui-checkbox-field > label { grid-column:2; grid-row:1; margin:0; padding:.5rem 0; cursor:pointer; }
.app-shell .ui-checkbox-field > input[type=checkbox] { grid-column:1; grid-row:1; align-self:center; width:1.25rem; height:1.25rem; margin:0; accent-color:var(--primary); }
.app-shell .ui-checkbox-field > :is(small,.errorlist) { grid-column:1 / -1; }
@media (pointer:coarse), (max-width:900px) {
 .app-shell .ui-checkbox-field > label { min-height:44px; display:flex; align-items:center; }
 .app-shell .ui-checkbox-field > input[type=checkbox] { width:1.5rem; height:1.5rem; }
}
