/* Team app ▸ „Was ist neu“ (25.10.2026, team/teamNeu.js): the header button right of the account menu and its panel.
   Same look as the bell panel (team-alarme.css): tokens only, Web3 accent where the Web3 design is on, light and dark
   follow the tokens. Panel rules are scoped to .tn-panel (the dialog hangs in <body>). */

/* ── Header button (auth.js #teamNeuBtn, Team mode only) ── */
.tabbar-actions .team-neu-btn[hidden] { display: none !important; }
.tabbar-actions .account-btn.team-neu-btn {
  position: relative;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  padding: 0;
}
.tabbar-actions .team-neu-btn svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar-actions .team-neu-btn[aria-expanded="true"] { background: var(--surface-3); border-color: var(--border-3); }
.tabbar-actions .team-neu-btn .team-neu-zahl {
  position: absolute; top: -5px; right: -5px;
  display: inline-grid; place-items: center;
  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: var(--radius-pill);
  background: var(--w3-akzent, var(--accent, var(--text-1))); color: var(--w3-akzent-text, var(--text-inv));
  box-shadow: 0 0 0 2px var(--w3-grund, var(--surface-1));
  font-size: 10px; font-weight: var(--fw-semibold); line-height: 1; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.tabbar-actions .team-neu-btn .team-neu-zahl[hidden] { display: none; }

/* ── Panel ── */
.tn-panel {
  --tn-akzent: var(--w3-akzent, var(--text-1));
  --tn-akzent-flaeche: var(--w3-akzent-flaeche, var(--surface-3));
  --tn-akzent-hauch: var(--w3-akzent-hauch, var(--surface-2));
  --tn-akzent-rand: var(--w3-akzent-rand, var(--border-3));
  --tn-akzent-text: var(--w3-akzent-text, var(--text-inv));
  --tn-kante: var(--w3-kante, inset 0 0 0 1px var(--border-1));
  --tn-kante-feld: var(--w3-kante-feld, inset 0 0 0 1px var(--border-2));
  --tn-fuellung: var(--w3-fuellung, var(--surface-2));
  --tn-fuellung-stark: var(--w3-fuellung-stark, var(--surface-3));
  --tn-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(460px, calc(100vw - 2 * var(--space-4)));
  max-width: none;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--tn-flaeche);
  background-image: var(--w3-glanz, none);
  box-shadow: var(--w3-schatten, var(--shadow-lg)), var(--tn-kante);
  color: var(--text-1);
  font-family: inherit;
  font-size: var(--fs-14);
  line-height: var(--lh-normal, 1.45);
}
/* style.css centres every modal dialog: this panel sits at its button. */
dialog.tn-panel:modal { inset: auto; top: var(--space-10); right: var(--space-4); margin: 0; }
.tn-panel[open] { animation: tn-ein var(--t-base, .2s) ease-out; }
.tn-panel::backdrop { background: transparent; }
@keyframes tn-ein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.tn-panel .tn-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(--tn-flaeche);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.tn-panel .tn-kopf-symbol {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: var(--radius-pill);
  background: var(--tn-akzent-flaeche); color: var(--tn-akzent);
}
.tn-panel .tn-kopf-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tn-panel .tn-titel { margin: 0; font-size: var(--fs-16); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.tn-panel .tn-untertitel { margin: 0; font-size: var(--fs-12); color: var(--text-3); }
.tn-panel .tn-sym { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tn-panel .tn-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);
}
.tn-panel .tn-symbol-knopf:hover { background: var(--tn-fuellung-stark); color: var(--text-1); }

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

/* ── Days and entries ── */
.tn-panel .tn-tage { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
/* Mode „Scrollen“: teamNeu.js sets max-height down to the window edge; the box scrolls, never the page. */
.tn-panel .tn-tage.tn-scroll {
  overflow-y: auto; overscroll-behavior: contain;
  margin-right: calc(-1 * var(--space-2)); padding-right: var(--space-2);
  scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb, var(--border-3)) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
}
.tn-panel .tn-tage.tn-scroll > * { flex-shrink: 0; }
.tn-panel .tn-tage.tn-scroll > :last-child { padding-bottom: var(--space-4); }
.tn-panel .tn-tage:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-md); }
.tn-panel .tn-tag { display: flex; flex-direction: column; gap: var(--space-2); }
.tn-panel .tn-tag-titel {
  margin: 0; display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-11); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide, .06em);
  text-transform: uppercase; color: var(--text-3);
}
.tn-panel .tn-tag-titel::after { content: ""; flex: 1; height: 1px; background: var(--border-1); }
.tn-panel .tn-eintraege {
  margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column;
  border-radius: var(--radius-lg); background: var(--tn-fuellung); box-shadow: var(--tn-kante-feld); overflow: hidden;
}
.tn-panel .tn-eintrag { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: var(--space-3); }
.tn-panel .tn-eintrag + .tn-eintrag { box-shadow: inset 0 1px 0 var(--border-1); }
.tn-panel .tn-ungelesen { background: var(--tn-akzent-hauch); }
.tn-panel .tn-ungelesen::before {
  content: ""; position: absolute; left: 0; top: var(--space-3); bottom: var(--space-3); width: 3px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0; background: var(--tn-akzent);
}
.tn-panel .tn-eintrag-kopf { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-2); width: 100%; }
.tn-panel .tn-zeit { color: var(--text-3); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.tn-panel .tn-art, .tn-panel .tn-admin {
  display: inline-flex; align-items: center; height: 20px; padding: 0 var(--space-2);
  border-radius: var(--radius-pill); font-size: var(--fs-11); font-weight: var(--fw-medium); white-space: nowrap;
}
.tn-panel .tn-art-neu { background: var(--tn-akzent-flaeche); color: var(--tn-akzent); box-shadow: inset 0 0 0 1px var(--tn-akzent-rand); }
.tn-panel .tn-art-verbessert { background: var(--success-soft, var(--tn-fuellung-stark)); color: var(--w3-positiv, var(--success, var(--text-1))); }
.tn-panel .tn-art-verschoben { background: var(--warning-soft, var(--tn-fuellung-stark)); color: var(--w3-warnung, var(--warning, var(--text-1))); }
.tn-panel .tn-admin { background: var(--tn-fuellung-stark); color: var(--text-2); }
.tn-panel .tn-punkt { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--tn-akzent); flex: none; }
.tn-panel .tn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tn-panel .tn-eintrag-titel { margin: 2px 0 0; font-size: var(--fs-14); font-weight: var(--fw-semibold); line-height: 1.35; }
.tn-panel .tn-eintrag-text { margin: 0; color: var(--text-2); font-size: var(--fs-13); line-height: var(--lh-relaxed, 1.55); overflow-wrap: anywhere; }
.tn-panel .tn-hin {
  display: inline-flex; align-items: center; gap: var(--space-1);
  margin-left: auto; height: 26px; padding: 0 var(--space-2) 0 var(--space-3);
  border: 0; border-radius: var(--radius-pill);
  background: transparent; box-shadow: var(--tn-kante-feld); color: var(--tn-akzent);
  font: inherit; font-size: var(--fs-12); font-weight: var(--fw-medium); cursor: pointer;
  transition: background var(--t-fast, .12s);
}
.tn-panel .tn-hin:hover { background: var(--tn-akzent-hauch); }
.tn-panel .tn-hin .tn-sym { width: 14px; height: 14px; }

/* ── Buttons, empty, skeleton ── */
.tn-panel .tn-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 32px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-pill);
  background: var(--tn-fuellung); box-shadow: var(--tn-kante-feld);
  color: var(--text-1); font: inherit; font-size: var(--fs-13); cursor: pointer;
}
.tn-panel .tn-knopf:hover { background: var(--tn-fuellung-stark); }
.tn-panel .tn-knopf:disabled { opacity: .5; cursor: default; }
.tn-panel .tn-seiten { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-12); color: var(--text-3); }
.tn-panel .tn-leer { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) 0; }
.tn-panel .tn-leer p, .tn-panel .tn-leer-text { margin: 0; color: var(--text-2); }
.tn-panel .tn-skelett { display: flex; flex-direction: column; gap: var(--space-2); }
.tn-panel .tn-skelett-zeile { display: block; height: 72px; border-radius: var(--radius-lg); background: var(--tn-fuellung); animation: tn-puls 1.2s ease-in-out infinite; }
@keyframes tn-puls { 50% { opacity: .55; } }

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

/* Phones, touch screens, windows too low: a full-screen sheet that scrolls as a whole (no inner box). */
dialog.tn-panel.tn-blatt:modal,
.tn-panel.tn-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);
}
.tn-panel.tn-blatt .tn-kopf { border-radius: 0; padding-top: max(var(--space-4), env(safe-area-inset-top, 0px)); }
.tn-panel.tn-blatt .tn-tage { max-height: none !important; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.tn-panel.tn-blatt[open] { animation-name: tn-hoch; }
.tn-panel.tn-blatt::backdrop { background: var(--overlay); }
@keyframes tn-hoch { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

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