/* Team app ▸ „Für dich in Discord“ ▸ panel „Welche Erwähnungen?“ (26.10.2026, team/teamErwaehnungen.js) and the badge
   on the tile's items („@Team“, „@everyone“, „@here“; team/teamDashboard.js dcZeile). Only tokens (design-tokens.css,
   web3-design.css), same look as the bell panel (team/team-alarme.css). The panel hangs in <body>: every panel rule is
   scoped to .te-panel; the button and badge live in the dashboard tile (#teamDashboardView, #tdSeitenleiste). */

.te-panel {
  --te-akzent: var(--w3-akzent, var(--text-1));
  --te-akzent-flaeche: var(--w3-akzent-flaeche, var(--surface-3));
  --te-akzent-hauch: var(--w3-akzent-hauch, var(--surface-2));
  --te-akzent-rand: var(--w3-akzent-rand, var(--border-3));
  --te-akzent-text: var(--w3-akzent-text, var(--text-inv));
  --te-kante: var(--w3-kante, inset 0 0 0 1px var(--border-1));
  --te-kante-feld: var(--w3-kante-feld, inset 0 0 0 1px var(--border-2));
  --te-fuellung: var(--w3-fuellung, var(--surface-2));
  --te-fuellung-stark: var(--w3-fuellung-stark, var(--surface-3));
  --te-flaeche: var(--w3-popover, var(--surface-2));

  position: fixed;
  inset: auto;
  top: var(--space-10);
  right: var(--space-4);
  margin: 0;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 2 * var(--space-4)));
  /* Never an inner scroll (FRF rule): too low a window gets the full-screen sheet below. */
  max-width: none;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--te-flaeche);
  background-image: var(--w3-glanz, none);
  box-shadow: var(--w3-schatten, var(--shadow-lg)), var(--te-kante);
  color: var(--text-1);
  font-family: inherit;
  font-size: var(--fs-14);
  line-height: var(--lh-normal, 1.45);
}
dialog.te-panel:modal { inset: auto; top: var(--space-10); right: var(--space-4); margin: 0; }
.te-panel[open] { animation: te-ein var(--t-base, .2s) ease-out; }
.te-panel::backdrop { background: transparent; }
@keyframes te-ein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.te-panel .te-kopf {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: var(--te-flaeche);
}
.te-panel .te-kopf-symbol {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: var(--radius-pill);
  background: var(--te-akzent-flaeche); color: var(--te-akzent);
}
.te-panel .te-kopf-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.te-panel .te-titel { margin: 0; font-size: var(--fs-16); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.te-panel .te-untertitel { margin: 0; font-size: var(--fs-12); color: var(--text-3); }
.te-panel .te-sym { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.te-panel .te-symbol-knopf {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: background var(--t-fast, .12s), color var(--t-fast, .12s);
}
.te-panel .te-symbol-knopf:hover { background: var(--te-fuellung-stark); color: var(--text-1); }

.te-panel .te-meldung {
  margin: 0 var(--space-4) var(--space-2); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md); background: var(--te-akzent-hauch); box-shadow: inset 0 0 0 1px var(--te-akzent-rand);
  font-size: var(--fs-13);
}
.te-panel .te-meldung[hidden] { display: none; }

.te-panel .te-inhalt { padding: 0 var(--space-4) var(--space-4); transition: opacity var(--t-base, .2s); }
.te-panel .te-inhalt.te-laedt { opacity: .7; }
.te-panel .te-koerper { display: flex; flex-direction: column; gap: var(--space-3); }

/* List of targets with switches (same rows as the bell panel). */
.te-panel .te-liste {
  margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column;
  border-radius: var(--radius-lg); background: var(--te-fuellung); box-shadow: var(--te-kante-feld); overflow: hidden;
}
.te-panel .te-eintrag {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3);
  transition: background var(--t-fast, .12s);
}
.te-panel .te-eintrag + .te-eintrag { box-shadow: inset 0 1px 0 var(--border-1); }
.te-panel .te-eintrag.te-an { background: var(--te-akzent-hauch); }
.te-panel .te-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.te-panel .te-zeile { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-2); min-width: 0; }
.te-panel .te-name { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; font-weight: var(--fw-medium); font-size: var(--fs-14); overflow-wrap: anywhere; }
/* The role's colour from Discord (data, not a design colour): a small dot only. */
.te-panel .te-farbe { flex: none; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--te-farbe, var(--text-3)); }
.te-panel .te-marke {
  display: inline-flex; align-items: center; height: 20px; padding: 0 var(--space-2);
  border-radius: var(--radius-pill); background: var(--te-fuellung-stark); color: var(--text-2); font-size: var(--fs-11);
}
.te-panel .te-meta { white-space: pre-wrap; color: var(--text-3); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.te-panel .te-textknopf {
  flex: none; border: 0; padding: 0 var(--space-2); height: 20px; border-radius: var(--radius-sm);
  background: transparent; color: var(--te-akzent); font: inherit; font-size: var(--fs-11); font-weight: var(--fw-medium); cursor: pointer;
}
.te-panel .te-textknopf:hover { background: var(--te-akzent-hauch); }

.te-panel .te-schalter { position: relative; display: inline-flex; flex: none; margin-top: 2px; cursor: pointer; }
.te-panel .te-schalter input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.te-panel .te-schalter-spur {
  position: relative; width: 34px; height: 20px; border-radius: var(--radius-pill);
  background: var(--te-fuellung-stark); box-shadow: inset 0 0 0 1px var(--border-2);
  transition: background var(--t-fast, .12s);
}
.te-panel .te-schalter-spur::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: var(--radius-pill);
  background: var(--text-2); transition: transform var(--t-fast, .12s);
}
.te-panel .te-schalter input:checked + .te-schalter-spur { background: var(--te-akzent-flaeche); box-shadow: inset 0 0 0 1px var(--te-akzent-rand); }
.te-panel .te-schalter input:checked + .te-schalter-spur::after { transform: translateX(14px); background: var(--te-akzent); }
.te-panel .te-schalter input:disabled { cursor: default; }
.te-panel .te-schalter input:disabled + .te-schalter-spur { opacity: .6; }
.te-panel .te-schalter input:focus-visible + .te-schalter-spur { box-shadow: var(--focus-ring); }
:root[data-theme="light"] .te-panel .te-schalter input:checked + .te-schalter-spur { background: var(--te-akzent); box-shadow: none; }
:root[data-theme="light"] .te-panel .te-schalter input:checked + .te-schalter-spur::after { background: var(--te-akzent-text); }
:root[data-theme="light"] .te-panel .te-schalter input:focus-visible + .te-schalter-spur { box-shadow: var(--focus-ring); }

/* Notices (catch-up progress), empty, skeleton. */
.te-panel .te-hinweis {
  margin: 0; display: flex; align-items: flex-start; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md);
  background: var(--te-fuellung); color: var(--text-2); font-size: var(--fs-13);
}
.te-panel .te-hinweis .te-sym { width: 16px; height: 16px; margin-top: 1px; color: var(--text-3); }
.te-panel .te-lauf {
  flex: none; width: 14px; height: 14px; margin-top: 2px; border-radius: var(--radius-pill);
  border: 2px solid var(--border-2); border-top-color: var(--te-akzent);
  animation: te-dreh 0.9s linear infinite;
}
@keyframes te-dreh { to { transform: rotate(360deg); } }
.te-panel .te-leise { margin: 0; color: var(--text-3); font-size: var(--fs-12); }
.te-panel .te-leer { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; }
.te-panel .te-leer p { margin: 0; color: var(--text-2); }
.te-panel .te-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 36px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-pill);
  background: var(--te-fuellung); box-shadow: var(--te-kante-feld);
  color: var(--text-1); font: inherit; font-size: var(--fs-13); font-weight: var(--fw-medium); cursor: pointer;
}
.te-panel .te-knopf:hover { background: var(--te-fuellung-stark); }
.te-panel .te-skelett { display: flex; flex-direction: column; gap: var(--space-2); }
.te-panel .te-skelett-zeile { display: block; height: 52px; border-radius: var(--radius-lg); background: var(--te-fuellung); animation: te-puls 1.2s ease-in-out infinite; }
@keyframes te-puls { 50% { opacity: .55; } }

.te-panel .te-knopf:focus-visible,
.te-panel .te-textknopf:focus-visible,
.te-panel .te-symbol-knopf:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Phones, touch screens, low windows: full-screen sheet that scrolls as a whole. */
dialog.te-panel.te-blatt:modal,
.te-panel.te-blatt {
  inset: 0;
  width: 100%; max-width: none;
  height: 100%; max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.te-panel.te-blatt .te-kopf { padding-top: max(var(--space-4), env(safe-area-inset-top, 0px)); }
.te-panel.te-blatt::backdrop { background: var(--overlay); }

/* ── In the tile: the head button and the badge of an item ── */
:is(#teamDashboardView, #tdSeitenleiste) .te-wahl-knopf {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: background var(--t-fast, .12s), color var(--t-fast, .12s);
}
:is(#teamDashboardView, #tdSeitenleiste) .te-wahl-knopf:hover { background: var(--w3-fuellung-stark, var(--surface-3)); color: var(--text-1); }
:is(#teamDashboardView, #tdSeitenleiste) .te-wahl-knopf:focus-visible { outline: none; box-shadow: var(--focus-ring); }
:is(#teamDashboardView, #tdSeitenleiste) .te-wahl-knopf svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:is(#teamDashboardView, #tdSeitenleiste) .te-abzeichen {
  /* inline-block, not inline-flex: text-overflow only works on a block's own text (a long role name ends in „…“). */
  display: inline-block; flex: 0 1 auto; min-width: 0; height: 20px; line-height: 20px; max-width: 14em; padding: 0 var(--space-2); vertical-align: middle;
  border-radius: var(--radius-pill); background: var(--w3-akzent-hauch, var(--surface-3)); box-shadow: inset 0 0 0 1px var(--w3-akzent-rand, var(--border-2));
  color: var(--text-1); font-size: var(--fs-11); font-weight: var(--fw-medium);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .te-panel, .te-panel *, .te-panel::backdrop { animation: none !important; transition: none !important; }
}
