/* Tabs (U-0129, FE-D15). Two blocks that look alike and are different things:

   .tabs       — the parts of a read page. Real links (?tab=…): each tab is an address.
   .form-tabs  — the sections of ONE form. A radio group ("Abschnitt") whose radios belong to an
                 empty form of their own (form="…"), so the choice never travels with the save.
                 CSS hides the sections that are not chosen; every field stays in the form and is
                 sent. Without CSS, without :has() and in print it is the long form. */
.tabs, .form-tabs__bar {
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--color-border);
}
.form-tabs__bar { min-width: 0; margin: 0; padding: 0; border-width: 0 0 1px; }
.tabs__tab, .form-tabs__tab {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--control-height); padding: 0 var(--space-3); margin-bottom: -1px;
  border-bottom: 2px solid transparent; border-radius: var(--radius-control) var(--radius-control) 0 0;
  color: var(--color-text-muted); font-weight: var(--weight-medium); text-decoration: none;
  cursor: pointer;
}
.tabs__tab:hover, .form-tabs__tab:hover { color: var(--color-text); background: var(--color-surface-muted); }
.tabs__tab[aria-current="page"], .form-tabs__tab:has(input:checked) {
  color: var(--color-text); border-bottom-color: var(--color-primary); font-weight: var(--weight-semibold);
}
.form-tabs__tab:has(input:focus-visible) { box-shadow: var(--focus-ring); border-radius: var(--radius-control); }
/* The radio stays in the accessibility tree and takes the keyboard; only its dot is not drawn. */
.form-tabs__tab input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.form-tabs__tab { position: relative; }
.tabs__count, .form-tabs__count { font-weight: var(--weight-regular); color: var(--color-text-muted); }
.form-tabs__errors {
  display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 var(--space-2);
  border: 1px solid var(--color-danger); border-radius: var(--radius-badge);
  color: var(--color-danger); font-size: var(--text-sm); font-weight: var(--weight-medium);
}
.form-tabs__panel { padding-top: var(--space-5); }
.form-tabs__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.form-tabs__lead { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: var(--space-1); }
.form-tabs__panel > .form-tabs__title + *, .form-tabs__panel > .form-tabs__lead + * { margin-top: var(--space-4); }
/* The empty form the section radios belong to: it has nothing to show and nothing to send. */
.form-tabs__owner { display: none; }

@media screen {
  @supports selector(:has(*)) {
    .form-tabs:has(.form-tabs__tab:nth-of-type(1) input:checked) > .form-tabs__panel:not(:nth-of-type(1)),
    .form-tabs:has(.form-tabs__tab:nth-of-type(2) input:checked) > .form-tabs__panel:not(:nth-of-type(2)),
    .form-tabs:has(.form-tabs__tab:nth-of-type(3) input:checked) > .form-tabs__panel:not(:nth-of-type(3)),
    .form-tabs:has(.form-tabs__tab:nth-of-type(4) input:checked) > .form-tabs__panel:not(:nth-of-type(4)),
    .form-tabs:has(.form-tabs__tab:nth-of-type(5) input:checked) > .form-tabs__panel:not(:nth-of-type(5)),
    .form-tabs:has(.form-tabs__tab:nth-of-type(6) input:checked) > .form-tabs__panel:not(:nth-of-type(6)) { display: none; }
    /* One section open: its heading repeats the tab, so only a screen reader needs it. */
    .form-tabs:has(.form-tabs__tab input:checked) .form-tabs__title {
      position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
  }
}
@media print {
  .form-tabs__bar, .tabs { display: none; }
}
