/* ==========================================================================
   segmented_control – mutually exclusive options as a pill group
   (view switch Kacheln/Liste/Tabelle/Kompakt/Raum/Stream/Präsentation, admin tabs).
   Variants: muted, soft, block, underline (tabs with lime underline, T237), chips (separate pills, T305).
   State segmented_control_compact (T403, compactLabels()): too little room – options with a symbol show only the symbol.
   State segmented_control_item_locked (T238): option outside the feature scope.
   Overflow variant (T162): options in segmented_control_items; those that do
   not fit are hidden and offered in the menu of segmented_control_more (⋯).
   ========================================================================== */
.segmented_control { display: flex; gap: 2px; background: var(--q-white); border-radius: var(--radius-pill); padding: 3px; flex: none; }
.segmented_control_item {
  --icon: none;
  display: flex; align-items: center; gap: 7px; border: none; border-radius: var(--radius-pill);
  background: transparent; color: var(--q-dark); padding: 8px 14px; font-size: var(--fs-12); font-weight: var(--w-bold); white-space: nowrap;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.segmented_control_item:hover { background: var(--q-highlight-4); }
.segmented_control_item_icon { width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; } /* icon in text colour (reference 09/2026) */
.segmented_control_item_active, .segmented_control_item[aria-checked="true"], .segmented_control_item[aria-selected="true"] { background: var(--q-highlight-2); color: var(--q-white); }
/* Muted variant: grey track, navy active pill (quality in "Aufnahmeeinstellungen") */
.segmented_control_muted { background: var(--q-highlight-4); }
.segmented_control_muted .segmented_control_item:hover { background: var(--q-white); }
.segmented_control_muted .segmented_control_item_active:hover, .segmented_control_muted .segmented_control_item[aria-checked="true"]:hover,
.segmented_control_muted .segmented_control_item[aria-selected="true"]:hover { background: var(--q-highlight-2); } /* chosen stays navy (white text) */
/* Block: full width, equally sized items */
.segmented_control_block .segmented_control_item { flex: 1; justify-content: center; padding: 7px 8px; }
/* Overflow variant (view switch, T162) */
.segmented_control_items { display: flex; gap: 2px; min-width: 0; }
.segmented_control_item[hidden] { display: none; }
.segmented_control_more { justify-content: center; padding: 8px 12px; }
.segmented_control_more .segmented_control_item_icon { width: 16px; height: 16px; }
.segmented_control_more[aria-expanded="true"] { background: var(--q-highlight-4); }
.segmented_control_item_compact { padding: 8px 11px; }
/* locked option (T238, feature scope "Gesperrt anzeigen"): half opacity, key instead of the icon – a click names the plan */
.segmented_control_item_locked { opacity: .5; }
.segmented_control_item_compact .segmented_control_item_label { display: none; }
/* T403: compactLabels() – no room for the labels: options with a symbol show only the symbol (the label stays as title / aria-label) */
.segmented_control_compact .segmented_control_item:has(> .segmented_control_item_icon) { padding-left: 12px; padding-right: 12px; }
.segmented_control_compact .segmented_control_item:has(> .segmented_control_item_icon) > .segmented_control_item_label { display: none; }
/* Soft variant: grey track, white active pill (reference "Desktop | Mobil") */
.segmented_control_soft { background: var(--q-highlight-4); }
.segmented_control_soft .segmented_control_item_active, .segmented_control_soft .segmented_control_item[aria-selected="true"] { background: var(--q-white); color: var(--q-highlight-2); box-shadow: 0 0 6px rgba(0, 0, 0, .08); }

/* Underline variant (reference "Einstellungen" 27.09.2026, T237): tabs on a grey base line instead of pills –
   active tab navy and bold with a lime underline (3 px), "⋯" the same while its menu is open */
.segmented_control_host:has(> .segmented_control_underline) { border-bottom: 1px solid var(--q-bright); }
.segmented_control_underline { background: transparent; border-radius: 0; padding: 0; margin-bottom: -1px; }
.segmented_control_underline .segmented_control_item {
  border-radius: 0; background: transparent; color: var(--q-dark); font-weight: var(--w-regular); box-shadow: inset 0 -3px 0 transparent;
  transition: box-shadow var(--dur-fast) ease, color var(--dur-fast) ease;
}
.segmented_control_underline .segmented_control_item:hover { background: transparent; color: var(--q-highlight-2); }
.segmented_control_underline .segmented_control_item_active, .segmented_control_underline .segmented_control_item[aria-selected="true"],
.segmented_control_underline .segmented_control_more[aria-expanded="true"] { background: transparent; color: var(--q-highlight-2); box-shadow: inset 0 -3px 0 var(--q-highlight-1); }
.segmented_control_underline .segmented_control_item_active, .segmented_control_underline .segmented_control_item[aria-selected="true"] { font-weight: var(--w-bold); }
.segmented_control_underline .segmented_control_item:focus-visible { box-shadow: inset 0 0 0 3px rgba(21, 165, 181, .35); }
.segmented_control_underline .segmented_control_item_active:focus-visible { box-shadow: inset 0 -3px 0 var(--q-highlight-1), inset 0 0 0 3px rgba(21, 165, 181, .35); }

/* Tabs with overflow (segmentedTabs, T217): the host takes the free width, the pill group keeps its natural width;
   a dot marks tabs with unsaved changes – on "⋯" when a hidden tab has them, in its menu behind the entry */
.segmented_control_host { display: flex; min-width: 0; }
.segmented_control_host > .segmented_control { flex: none; } /* natural width – fit() compares it with the host */
/* T640: on the smartphone (segmentedTabs, up to 759 px) no "⋯" – every tab keeps symbol and label, the row is swiped
   sideways; a soft fade marks the edge where more tabs follow (_start / _end, set while scrolling) */
.segmented_control_host_swipe {
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; scroll-behavior: smooth;
  --swipe-fade-start: 0px; --swipe-fade-end: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--swipe-fade-start), #000 calc(100% - var(--swipe-fade-end)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--swipe-fade-start), #000 calc(100% - var(--swipe-fade-end)), transparent 100%);
}
.segmented_control_host_swipe::-webkit-scrollbar { display: none; }
.segmented_control_host_swipe_start { --swipe-fade-start: 28px; }
.segmented_control_host_swipe_end { --swipe-fade-end: 28px; }
@media (prefers-reduced-motion: reduce) { .segmented_control_host_swipe { scroll-behavior: auto; } }
.segmented_control_host_swipe { justify-content: flex-start; } /* an overflow to the left could not be scrolled to */
.segmented_control_host_swipe > .segmented_control_underline { margin-bottom: 0; } /* the host clips – the line stays whole */
.segmented_control_item:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.segmented_control_item_dot { display: none; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--q-highlight-3); }
.segmented_control_item_dirty .segmented_control_item_dot { display: block; }
.segmented_control_more { position: relative; }
.segmented_control_more .segmented_control_item_dot { position: absolute; top: 5px; right: 6px; }
/* T486: a number at a tab (open items behind it) – beside the label, at "⋯" the sum of the hidden tabs as a small badge */
.segmented_control_item_badge { flex: none; min-width: 18px; padding: 0 6px; font-size: 11px; line-height: 18px; text-align: center; border-radius: 9px; }
.segmented_control_more .segmented_control_item_badge { position: absolute; top: -4px; right: -4px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; box-shadow: 0 0 0 2px var(--q-white); }
.popover_item.segmented_control_menu_item_dirty::after { content: ""; width: 8px; height: 8px; flex: none; margin-left: auto; border-radius: 50%; background: var(--q-highlight-3); }

@media (max-width: 759px) {
  /* only options WITH a symbol shrink to it – options with text only (Alle · Aktiv · Gesperrt) keep their label (T234);
     :where keeps the specificity low so the variants below can show labels again */
  .segmented_control_item:where(:has(> .segmented_control_item_icon)) > .segmented_control_item_label { display: none; }
  .segmented_control_item { padding: 8px 11px; }
  .segmented_control_soft .segmented_control_item_label, .segmented_control_muted .segmented_control_item_label { display: inline; }
  /* overflow variant: labels stay – what does not fit goes into "⋯" */
  .segmented_control_overflow .segmented_control_item { padding: 8px 12px; }
  .segmented_control_overflow .segmented_control_item_label { display: inline; }
  .segmented_control_overflow .segmented_control_item_compact { padding: 8px 11px; }
  .segmented_control_overflow .segmented_control_item_compact .segmented_control_item_label { display: none; }
  /* chips scroll – labels stay (T305) */
  .segmented_control_chips .segmented_control_item_label { display: inline; }
  .segmented_control_chips .segmented_control_item { padding: 7px 13px; }
}

/* T275: large variant (public pages – tabs of the views, billing cycle): 14 px, taller pills. T282: scroll – one line
   that scrolls sideways when it does not fit (tabs of the product page); scrollbar thin with a mouse, hidden on touch */
.segmented_control_large { padding: 5px; gap: 4px; }
.segmented_control_large .segmented_control_item { gap: 8px; padding: 13px 18px; font-size: var(--fs-14); cursor: pointer; text-decoration: none; }
.segmented_control_large .segmented_control_item_icon { width: 16px; height: 16px; }
.segmented_control_scroll { flex-wrap: nowrap; justify-content: safe center; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.segmented_control_scroll .segmented_control_item { flex: none; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .segmented_control_scroll { scrollbar-width: thin; scrollbar-color: rgba(16, 49, 78, .35) transparent; } }
@media not ((hover: hover) and (pointer: fine)) { .segmented_control_scroll::-webkit-scrollbar { display: none; } }
.segmented_control_item:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Chips variant (T305, help panel categories): separate grey pills in one horizontally scrolling row – the chosen one
   navy; icon in the text colour */
.segmented_control_chips { flex-wrap: nowrap; gap: 6px; background: transparent; border-radius: 0; padding: 0; overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity; }
.segmented_control_chips .segmented_control_item { flex: none; background: var(--q-highlight-4); color: var(--q-highlight-2); padding: 7px 13px; scroll-snap-align: start; }
.segmented_control_chips .segmented_control_item:hover { background: var(--q-bright); }
.segmented_control_chips .segmented_control_item[aria-selected="true"], .segmented_control_chips .segmented_control_item_active { background: var(--q-highlight-2); color: var(--q-white); }
.segmented_control_chips .segmented_control_item_icon { width: 13px; height: 13px; }
