/* HeldixClient – Webseite: Konto (/konto) und Team-Bereich (/team) – Rahmen (Seitenleiste, Seitenkopf, untere Leiste,
   Bereichs-Chips), Spielerbilder, Listen, Popover und gemeinsame neue Bausteine. Nutzt die Tokens und Komponenten
   aus design.css; die Bausteine der bisherigen Seiten stehen in bereich-bausteine.css (vorher geladen).
   Seitenteile: konto.css, team.css. */

/* ---------- Seite ---------- */
.bereich .site-header .container,
.bereich .site-footer .container {
  width: min(1440px, 100% - 2 * var(--gutter));
}
.bereich-main {
  display: block;
  min-height: 62vh;
  padding-bottom: var(--sp-8);
}
.bereich-main > .gate,
.bereich-main > .app-loading {
  width: min(880px, 100% - 2 * var(--gutter));
  margin: var(--sp-7) auto 0;
}
.bereich-main > .app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-9) 0;
  color: var(--text-2);
}
.bereich h1,
.bereich h2,
.bereich h3,
.bereich h4,
.bereich p {
  margin: 0;
}
.bereich .panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
  min-width: 0;
}
.bereich .panel[hidden] {
  display: none;
}
.bereich .panel:focus {
  outline: none;
}
.bereich .panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  align-items: start;
}
.bereich .app-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--sp-3);
  margin: 0;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-inset);
}
.bereich .app-card + .app-card {
  margin-top: 0;
}
.bereich .card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.bereich .card-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 260px;
}
.bereich .card-head p {
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.bereich .app-card h2,
.bereich .card__title {
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.bereich .app-card h2 .muted,
.bereich .card__title .text-3 {
  font-weight: 600;
}
.bereich .hint {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.text-online {
  color: var(--c-green-300);
}
.bereich .list-gap {
  display: grid;
  gap: var(--sp-3);
}
.bereich .list-title {
  margin: var(--sp-2) 0 var(--sp-1);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bereich .saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-green-300);
  font-size: var(--fs-xs);
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--dur);
}
.bereich .saved.visible {
  opacity: 1;
}
.bereich .saved .icon {
  width: 15px;
  height: 15px;
}
.chip--xs {
  min-height: 20px;
  padding: 0 7px;
  font-size: 11px;
}
.chip--xs .icon {
  width: 12px;
  height: 12px;
}

/* ---------- Rahmen ---------- */
.shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: start;
  gap: var(--sp-6);
  width: min(1440px, 100% - 2 * var(--gutter));
  margin: var(--sp-5) auto 0;
}
.shell__side {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  display: grid;
  align-content: start;
  gap: var(--sp-4);
  max-height: calc(100dvh - var(--header-h) - var(--sp-6));
  padding: var(--sp-4);
  overflow-y: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.shell-main,
.shell__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-5);
  min-width: 0;
}
.shell-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
  min-width: 0;
}
.side-me {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.side-me .person__text {
  display: grid;
  min-width: 0;
}
.side-me .person__name {
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-me .person__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-me .person__meta--online {
  color: var(--c-green-300);
}
.side-me .person__meta--dnd {
  color: var(--danger-text);
}
.side-me .person__meta--role {
  color: var(--text-2);
}
.side-me .person__meta .icon {
  width: 14px;
  height: 14px;
}
.side-nav {
  display: grid;
  gap: 2px;
}
.side-group,
.side-list {
  display: grid;
  gap: 2px;
}
.side-group ul.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.side-nav__group {
  margin: var(--sp-3) var(--sp-3) var(--sp-1);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.side-nav__group--lock {
  margin-top: 0;
}
.side-nav__group:has(> .side-lock[hidden]):empty,
.side-nav__group--lock:has(> .side-lock[hidden]) {
  display: none;
}
.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 40px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.side-nav a .icon,
.side-nav a .rolle,
.side-other-icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.side-other-icon {
  display: grid;
  place-items: center;
}
.side-other-icon img.rolle {
  width: auto;
  height: 18px;
}
.side-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.side-nav a:focus-visible {
  outline: 2px solid var(--c-blue-300);
  outline-offset: -2px;
}
.side-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--text);
}
.side-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.side-nav a[aria-current="page"] .icon {
  color: var(--c-blue-300);
}
.side-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-nav .count {
  margin-left: auto;
}
.side-lock {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 20px;
  padding: 0 7px;
  border-radius: var(--r-full);
  background: var(--reward-soft);
  color: var(--c-amber-300);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.side-lock .icon {
  width: 11px;
  height: 11px;
}
.side-group.locked .side-item:not(.side-item--other) {
  opacity: 0.55;
}
.side-logout {
  justify-self: start;
}

/* Seitenkopf */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.page-head__title {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.page-head .shell-title {
  margin-top: 2px;
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  overflow-wrap: anywhere;
}
.page-head .shell-title:focus {
  outline: none;
}
.page-head__tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.bell {
  position: relative;
}
.bell__dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
  background: var(--accent);
}
.shell-bell,
.shell-user {
  position: relative;
}
.shell-user {
  display: none;
}

/* Suche (Strg+K) im Seitenkopf: sieht aus wie ein Eingabefeld */
.shell-search-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 320px;
  height: 44px;
  padding: 0 10px 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text-3);
  font: 500 var(--fs-sm) / 1 var(--font);
  text-align: left;
  cursor: text;
  transition: border-color var(--dur-fast);
}
.shell-search-button:hover {
  border-color: rgba(148, 163, 184, 0.36);
}
.shell-search-button:focus-visible {
  outline: 2px solid var(--c-blue-300);
  outline-offset: 2px;
}
.shell-search-button .icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.shell-search-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-search-key {
  padding: 2px 6px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  color: var(--text-3);
  font: 700 11px var(--font);
}

/* Aufklapp-Flächen (Aktivität, eigenes Konto) */
.shell-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-menu);
  width: min(380px, calc(100vw - 2 * var(--gutter)));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: var(--sp-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow: var(--sh-3);
}
.shell-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2) var(--sp-3);
}
.shell-activity-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shell-activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-md);
  color: var(--text-2);
  text-decoration: none;
}
a.shell-activity-item:hover {
  background: var(--surface-3);
  color: var(--text);
}
.shell-activity-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--c-blue-300);
}
.shell-activity-icon .icon {
  width: 16px;
  height: 16px;
}
.shell-activity-body {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
  font-size: var(--fs-sm);
}
.shell-activity-title {
  color: var(--text);
  font-weight: 700;
}
.shell-activity-text {
  overflow-wrap: anywhere;
}
.shell-activity-body time {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.shell-activity-empty {
  padding: var(--sp-4) var(--sp-2);
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-align: center;
}
.unread-dot {
  width: 8px;
  height: 8px;
  flex: none;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.shell-user-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2) var(--sp-2);
}
.shell-user-meta {
  display: grid;
  gap: 4px;
  margin: 0 0 var(--sp-3);
  padding: 0 var(--sp-2);
  list-style: none;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.shell-user-meta .rolle-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-weight: 600;
}
.shell-signout {
  margin: 0 var(--sp-2) var(--sp-1);
}

/* Kacheln (Bereiche als Karten) */
.shell-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
}
.shell-tile {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.shell-tile:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}
.shell-tile.has-news {
  border-color: rgba(96, 165, 250, 0.32);
}
.shell-tile-body {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.shell-tile-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
}
.shell-tile-text {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.shell-tile-news {
  color: var(--c-blue-300);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.shell-tile-go .icon {
  width: 18px;
  height: 18px;
  color: var(--text-3);
}

/* Bereichs-Chips (Team auf dem Handy) und untere Leiste (Konto auf dem Handy) */
.mobile-sections,
.tabbar {
  display: none;
}

/* ---------- Spielerbilder (app-common.js: Initialen, darüber der Minecraft-Kopf) ---------- */
.bereich .avatar,
.toasts .avatar,
dialog .avatar {
  --hue: 215;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, hsl(var(--hue) 55% 46%), hsl(calc(var(--hue) + 35) 55% 28%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  user-select: none;
}
.bereich .avatar-sm,
dialog .avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 12px;
}
.bereich .avatar-xs,
dialog .avatar-xs {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 10px;
}
.bereich .avatar-lg,
dialog .avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 20px;
}
.bereich .avatar-xl,
dialog .avatar-xl {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  font-size: 32px;
}
.bereich .avatar > img.head,
dialog .avatar > img.head {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  image-rendering: pixelated;
}
.bereich .avatar.has-head .avatar-initials,
dialog .avatar.has-head .avatar-initials {
  visibility: hidden;
}
.bereich .avatar .presence,
dialog .avatar .presence {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  background: var(--text-3);
}
.bereich .avatar .presence.on,
dialog .avatar .presence.on {
  background: var(--online);
}
.avatar-stack {
  display: flex;
}
.avatar-stack > .avatar + .avatar {
  margin-left: -10px;
  box-shadow: 0 0 0 2px var(--surface);
}
.badge-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
}
.badge-mark img.rolle,
.rolle-name img.rolle,
.side-me img.rolle {
  width: auto;
  height: 16px;
}

/* ---------- Listen ---------- */
.bereich .rows {
  display: grid;
  margin: 0 calc(-1 * var(--sp-2));
  padding: 0;
  list-style: none;
}
.bereich .rows > li.row,
.bereich .rows > li > .row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  margin: 0;
  padding: var(--sp-2);
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
}
.bereich .rows > li + li {
  border-top: 1px solid var(--line);
}
.bereich .rows > li.row:hover,
.bereich .rows > li > .row-button:hover {
  background: var(--surface-2);
}
.bereich .row-main {
  display: grid;
  gap: 2px;
  flex: 1 1 180px;
  min-width: 0;
}
.bereich .row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.bereich .row-sub {
  color: var(--text-2);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}
.bereich .row-sub.online {
  color: var(--c-green-300);
}
.bereich .row-meta {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.bereich .row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-left: auto;
}
.row__time {
  align-self: flex-start;
  margin-top: 6px;
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.bereich .rows > li.row--unread::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 22px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.row-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.row-link:hover {
  color: inherit;
}
.row-link .row-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-link .row-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Suchfeld in Listen (Freunde, Team-Tabellen) */
.search--inline {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 200px;
  max-width: 320px;
}
.search--inline > .icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  pointer-events: none;
}
.search--inline .input {
  padding-left: 40px;
}

/* Beitreten-Karte (Chat, Übersicht) */
.join-card {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 100%;
  margin-top: 4px;
  padding: 4px 4px 4px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text-2);
}
.join-card > .icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--accent-text);
}
.join-card[data-kind="world"] > .icon {
  color: var(--c-green-300);
}
.join-card[data-kind="invite"] > .icon {
  color: var(--c-violet-300);
}
.join-card__text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}
.join-card__kind {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.join-card__title {
  overflow: hidden;
  color: var(--text);
  font: 600 var(--fs-sm) var(--font);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.join-card[data-kind="server"] .join-card__title {
  font: 600 var(--fs-xs) var(--mono);
}
.join-card .btn {
  --btn-h: 30px;
  flex: none;
}
.join-button .icon {
  width: 16px;
  height: 16px;
}

/* Kleine Kennzahlen (Einladungen, Dienst) */
.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
  margin: 0;
}
.mini-stats div {
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  text-align: center;
}
.mini-stats dt {
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.mini-stats dd {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Auswahl als Karten (Teilen, „Ist online“-Hinweise) */
.choice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  border: 0;
}
.choice-card {
  position: relative;
  display: block;
  cursor: pointer;
}
.choice-card input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choice-card > span {
  display: grid;
  gap: 2px;
  height: 100%;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.choice-card small {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.choice-card input:checked + span {
  border-color: var(--line-accent);
  background: var(--accent-soft);
}
.choice-card input:focus-visible + span {
  outline: 2px solid var(--c-blue-300);
  outline-offset: 2px;
}
.choice-card.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Schalter in Listen (input.switch aus den Skripten): wie .switch aus design.css */
.switches {
  display: grid;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.switches > .switch-row:first-child {
  border-top: 0;
}
.switch-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.switch-text strong {
  color: var(--text);
  font-size: var(--fs-sm);
}
.switch-text small {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.switch-row.dim .switch-text {
  opacity: 0.55;
}
input.switch {
  position: relative;
  display: inline-block;
  flex: none;
  width: 44px;
  height: 26px;
  min-height: 0;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur);
}
input.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform var(--dur) var(--ease), background var(--dur);
}
input.switch:checked {
  border-color: transparent;
  background: var(--accent);
}
input.switch:checked::after {
  transform: translateX(18px);
  background: #fff;
}
input.switch:focus-visible {
  outline: 2px solid var(--c-blue-300);
  outline-offset: 2px;
}
input.switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Fortschritt aus älteren Skripten (<div class="progress"><span>) */
.bereich .progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--dur) var(--ease);
}

/* Unterreiter (Team → Addons, Cosmetics-Plätze) und Filter: brechen in schmalen Fenstern um statt überzustehen */
.bereich .segmented {
  flex-wrap: wrap;
  max-width: 100%;
}
.bereich .segmented button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font: 600 var(--fs-xs) var(--font);
  cursor: pointer;
}
.bereich .segmented button[aria-pressed="true"],
.bereich .segmented button.active {
  background: var(--surface-3);
  color: var(--text);
}
.segmented--sm span {
  min-height: 28px;
  padding: 0 10px;
  font-size: var(--fs-xs);
}

/* Dialoge im neuen Look (Profilkarte, Auswahl) */
.bereich dialog.modal,
dialog.modal {
  overflow-y: auto;
}
.pick-list {
  display: grid;
  gap: 2px;
  max-height: min(50vh, 420px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: 0;
}
.pick-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.pick-row:hover {
  background: var(--surface-2);
}
.pick-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.pick-row > span:not(.avatar):not(.chip) {
  flex: 1;
  font-weight: 600;
}

/* ---------- Schmalere Bildschirme ---------- */
@media (max-width: 1240px) {
  .shell-search-button {
    width: 240px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 232px minmax(0, 1fr);
    gap: var(--sp-5);
  }
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    margin-top: var(--sp-4);
  }
  .shell__side {
    display: none;
  }
  .shell-user {
    display: block;
  }
  .page-head {
    flex-wrap: nowrap;
    align-items: center;
  }
  .page-head .shell-title {
    font-size: var(--fs-xl);
  }
  .page-head .shell-search-button {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
  .page-head .shell-search-label,
  .page-head .shell-search-key {
    display: none;
  }
  .bereich .panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .bereich .app-card {
    padding: var(--sp-4);
  }
  /* Team: Bereiche als Chips */
  .mobile-sections {
    position: sticky;
    top: var(--header-h);
    z-index: 5;
    display: flex;
    gap: var(--sp-2);
    margin: calc(-1 * var(--sp-2)) calc(-1 * var(--gutter)) 0;
    padding: var(--sp-2) var(--gutter);
    overflow-x: auto;
    background: rgba(7, 10, 18, 0.92);
    scrollbar-width: none;
  }
  .mobile-sections::-webkit-scrollbar {
    display: none;
  }
  .mobile-sections a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    min-height: 38px;
    padding: 0 14px;
    border-radius: var(--r-full);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-2);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }
  .mobile-sections a[aria-current="page"] {
    border-color: var(--line-accent);
    background: var(--accent-soft);
    color: var(--text);
  }
  .mobile-sections .count {
    margin-left: 2px;
  }
  /* Konto: untere Leiste mit „Mehr“-Blatt */
  .bereich--konto.bereich--angemeldet {
    padding-bottom: 76px;
  }
  .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: var(--z-menu);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-strong);
    background: rgba(11, 16, 27, 0.96);
  }
  .tabbar > a,
  .tabbar summary {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 2px;
    min-height: 54px;
    padding-top: 7px;
    border-radius: var(--r-md);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    list-style: none;
    cursor: pointer;
  }
  .tabbar > a .icon,
  .tabbar summary .icon {
    width: 22px;
    height: 22px;
  }
  .tabbar summary::-webkit-details-marker {
    display: none;
  }
  .tabbar > a[aria-current="page"],
  .tabbar__more.is-current > summary,
  .tabbar__more[open] > summary {
    color: var(--c-blue-300);
    background: var(--accent-soft);
  }
  .tabbar .count {
    position: absolute;
    top: 3px;
    left: calc(50% + 6px);
    min-width: 17px;
    height: 17px;
    font-size: 10px;
  }
  .tabbar__sheet {
    position: fixed;
    inset: auto 8px calc(76px + env(safe-area-inset-bottom));
    display: grid;
    gap: 2px;
    max-height: calc(100dvh - var(--header-h) - 100px);
    overflow-y: auto;
    padding: var(--sp-3);
    border-radius: var(--r-lg);
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    box-shadow: var(--sh-3);
  }
  .tabbar__sheet a,
  .tabbar__logout {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: 46px;
    padding: 0 var(--sp-3);
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text);
    font: 600 var(--fs-sm) var(--font);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }
  .tabbar__sheet a[aria-current="page"] {
    background: var(--accent-soft);
  }
  .tabbar__sheet a:hover,
  .tabbar__logout:hover {
    background: var(--surface-3);
  }
  .tabbar__sheet .count {
    position: static;
    margin-left: auto;
  }
  .tabbar__sheet .icon,
  .tabbar__sheet img.rolle {
    width: 20px;
    height: 20px;
    color: var(--accent-text);
  }
  .tabbar__sheet img.rolle {
    width: auto;
  }
  .tabbar__logout {
    margin-top: var(--sp-1);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--r-md) var(--r-md);
    color: var(--text-2);
  }
}
@media (max-width: 480px) {
  .bereich .row-actions .label {
    display: none;
  }
  .mini-stats dd {
    font-size: var(--fs-md);
  }
  .shell-popover {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: var(--gutter);
    right: var(--gutter);
    width: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .side-nav a,
  input.switch,
  input.switch::after,
  .shell-tile {
    transition: none;
  }
}
