/* ==========================================================================
   Vantage RP – Teamboard
   Markenfarben: Schwarz als Grund, Violett als einziger Akzent,
   Schilder-Typografie für Titel und Spalten
   ========================================================================== */

:root {
  --font-display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Schwarz (Standard) */
  --bg: #000000;
  --bg-raised: #0B0910;
  --surface: #14111B;
  --surface-2: #1E1928;
  --line: #262031;
  --line-strong: #3A3149;
  --text: #EEEAF5;
  --muted: #9A91AB;
  --faint: #6E6680;
  --accent: #9B5CFF;          /* Markierungen, Fokus, Rahmen */
  --accent-fill: #7C3AED;     /* Flächen mit weißer Schrift (Buttons) */
  --accent-fill-hover: #6D28D9;
  --accent-ink: #FFFFFF;
  --accent-text: #B98CFF;     /* Akzent als Schriftfarbe */
  --accent-wash: rgba(155, 92, 255, 0.16);
  --danger: #FF6B6B;
  --danger-wash: rgba(255, 107, 107, 0.13);
  --ok: #3CCFB4;
  --ok-wash: rgba(60, 207, 180, 0.12);
  --info: #5B9DFF;
  --overlay: rgba(0, 0, 0, 0.72);
  --shadow-lift: 0 18px 44px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(155, 92, 255, 0.12);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  --p0: #6E6680;
  --p1: #5B9DFF;
  --p2: #FFB238;
  --p3: #FF6B6B;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --sidebar-w: 252px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F4F2F8;
    --bg-raised: #FAF9FC;
    --surface: #FFFFFF;
    --surface-2: #EFEBF6;
    --line: #DDD7E8;
    --line-strong: #C2B9D3;
    --text: #120E1A;
    --muted: #5C5470;
    --faint: #8A8299;
    --accent: #7C3AED;
    --accent-fill: #7C3AED;
    --accent-fill-hover: #6D28D9;
    --accent-ink: #FFFFFF;
    --accent-text: #6D28D9;
    --accent-wash: rgba(124, 58, 237, 0.12);
    --danger: #D63A2C;
    --danger-wash: rgba(214, 58, 44, 0.1);
    --ok: #0F8F78;
    --ok-wash: rgba(15, 143, 120, 0.1);
    --info: #2F6FD6;
    --overlay: rgba(18, 14, 26, 0.45);
    --shadow-lift: 0 18px 40px -12px rgba(18, 14, 26, 0.35), 0 2px 6px rgba(18, 14, 26, 0.12);
    --p0: #8A8299;
    --p1: #2F6FD6;
    --p2: #E59400;
    --p3: #D63A2C;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F4F2F8;
  --bg-raised: #FAF9FC;
  --surface: #FFFFFF;
  --surface-2: #EFEBF6;
  --line: #DDD7E8;
  --line-strong: #C2B9D3;
  --text: #120E1A;
  --muted: #5C5470;
  --faint: #8A8299;
  --accent: #7C3AED;
  --accent-fill: #7C3AED;
  --accent-fill-hover: #6D28D9;
  --accent-ink: #FFFFFF;
  --accent-text: #6D28D9;
  --accent-wash: rgba(124, 58, 237, 0.12);
  --danger: #D63A2C;
  --danger-wash: rgba(214, 58, 44, 0.1);
  --ok: #0F8F78;
  --ok-wash: rgba(15, 143, 120, 0.1);
  --info: #2F6FD6;
  --overlay: rgba(18, 14, 26, 0.45);
  --shadow-lift: 0 18px 40px -12px rgba(18, 14, 26, 0.35), 0 2px 6px rgba(18, 14, 26, 0.12);
  --p0: #8A8299;
  --p1: #2F6FD6;
  --p2: #E59400;
  --p3: #D63A2C;
  color-scheme: light;
}

/* ---------- Basis ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}
html.no-scroll { overflow: hidden; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
img, svg { display: block; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: var(--r-sm); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { display: inline-flex; flex: none; line-height: 0; }

::selection { background: var(--accent-fill); color: var(--accent-ink); }

/* ---------- Boot ---------- */

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.boot-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---------- Wortmarke ---------- */

.wordmark {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--text);
}
.wordmark-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 0.9;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.wordmark-horizon {
  display: block;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  background: var(--accent);
}
.wordmark-sub {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: transparent;
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
  touch-action: manipulation;
}
@media (hover: hover) { .btn:hover { background: var(--surface-2); } }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-ink);
}
@media (hover: hover) { .btn--primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); } }
.btn--ghost { border-color: transparent; }
.btn--danger { border-color: transparent; color: var(--danger); }
@media (hover: hover) { .btn--danger:hover { background: var(--danger-wash); } }
.btn--danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger-solid:hover { background: var(--danger); filter: brightness(1.08); }
.btn--block { width: 100%; }
.btn--sm { min-height: 32px; padding: 0 10px; font-size: 0.8125rem; border-radius: var(--r-sm); }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--accent-ink) transparent var(--accent-ink) transparent;
  animation: spin 0.7s linear infinite;
}
.btn:not(.btn--primary).is-busy::after { border-color: var(--text) transparent var(--text) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--r-md);
  border: 0;
  background: transparent;
  color: var(--muted);
  touch-action: manipulation;
}
@media (hover: hover) { .icon-btn:hover { background: var(--surface-2); color: var(--text); } }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; }
.icon-btn--sm { width: 32px; height: 32px; border-radius: var(--r-sm); }

/* ---------- Formulare ---------- */

.field { display: grid; gap: 6px; }
.field-label { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.field-hint { font-size: 0.8125rem; color: var(--faint); }
.field-error { font-size: 0.8125rem; color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  font-size: 1rem; /* verhindert Zoom auf iOS */
  transition: border-color 0.12s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
  border-radius: var(--r-md);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238D98B3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.select option { background: var(--surface); color: var(--text); }
input[type="date"].input { min-width: 0; }
input[type="color"] {
  width: 42px; height: 42px; padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
}

.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .form-row--2 { grid-template-columns: 1fr 1fr; }
}
.form-error {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--danger-wash);
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.check input {
  appearance: none;
  flex: none;
  width: 20px; height: 20px;
  margin: 1px 0 0;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-raised);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.check input::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
.check input:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
.check input:checked::after { opacity: 1; }
.check input:disabled { opacity: 0.45; cursor: not-allowed; }
.check input:focus-visible { box-shadow: var(--focus); }

.toggle-group {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--line);
}
.toggle-group button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
}
.toggle-group button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* ---------- Avatare, Badges, Chips ---------- */

.avatar {
  --size: 28px;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: calc(var(--size) * 0.4);
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--role, var(--surface-2));
  color: var(--role-ink, var(--text));
  user-select: none;
}
.avatar { position: relative; overflow: hidden; }
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.avatar.has-img img { opacity: 1; }
.avatar--lg { --size: 44px; }

/* Discord */
.btn--discord {
  min-height: 48px;
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-ink);
  font-size: 1rem;
}
@media (hover: hover) { .btn--discord:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); } }
.discord-id-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.discord-id {
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: all;
}
.avatar--sm { --size: 24px; }
.avatars { display: inline-flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar + .avatar { margin-left: -5px; }
.avatar-more {
  --size: 24px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.6875rem;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.role-badge::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--role, var(--faint));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip--overdue { background: var(--danger-wash); color: var(--danger); }
.chip--today { background: var(--accent-wash); color: var(--accent-text); }
.chip--done { background: var(--ok-wash); color: var(--ok); }

.prio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}
.prio::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--prio);
}

/* ---------- Leere Zustände ---------- */

.empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--muted);
}
.empty strong { color: var(--text); font-size: 1rem; }

/* ==========================================================================
   Anmeldung
   ========================================================================== */

.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    linear-gradient(180deg, transparent 0 55%, var(--accent-wash) 100%),
    var(--bg);
}
.auth-skyline {
  position: relative;
  padding: 40px 24px 0;
  overflow: hidden;
}
.auth-title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(4rem, 22vw, 11rem);
  line-height: 0.88;
  letter-spacing: 0.02em;
  color: var(--text);
}
.auth-title span { display: block; }
.auth-title .auth-title-rp {
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}
.auth-tagline {
  margin-top: 18px;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1rem;
}
.auth-panel {
  padding: 28px 24px calc(32px + var(--safe-b));
  display: flex;
  align-items: flex-start;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 20px;
}
.auth-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.1;
}
.auth-card p { color: var(--muted); }
.auth-lights {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}
.auth-lights span {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.85;
}
.auth-lights span:nth-child(2) { flex: 0.3; opacity: 0.55; }
.auth-lights span:nth-child(3) { flex: 0.15; opacity: 0.35; }
.auth-lights span:nth-child(4) { flex: 0.08; opacity: 0.2; }

@media (min-width: 960px) {
  .auth {
    grid-template-rows: none;
    grid-template-columns: 1.25fr 1fr;
  }
  .auth-skyline {
    padding: 64px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-right: 1px solid var(--line);
  }
  .auth-title { font-size: clamp(7rem, 12vw, 12rem); }
  .auth-panel { align-items: center; justify-content: center; padding: 64px; }
}

/* ==========================================================================
   App-Rahmen
   ========================================================================== */

.shell { min-height: 100dvh; }

.sidebar { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar .wordmark-name { font-size: 1.375rem; }
.topbar-me {
  display: inline-flex;
  border-radius: 50%;
  text-decoration: none;
}

.main {
  min-width: 0;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
}
.tab {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 600;
  position: relative;
  touch-action: manipulation;
}
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"]::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 28%; right: 28%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

@media (min-width: 900px) {
  .shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .topbar, .tabbar { display: none; }
  .main { padding-bottom: 40px; }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 14px 16px;
    background: var(--bg-raised);
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .sidebar .wordmark { padding: 0 10px; }
}

.nav { display: grid; gap: 2px; }
.nav-title {
  padding: 0 12px 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--faint);
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r-md);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.nav-link:hover { background: var(--surface); color: var(--text); }
button.nav-link { border: 0; background: transparent; width: 100%; text-align: left; }
button.nav-link:hover { background: var(--surface); }
.nav-link[aria-current="page"] { background: var(--surface); color: var(--text); }
.nav-link[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-link .nav-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.nav-link--board { font-weight: 500; min-height: 36px; }
.nav-link--board .nav-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  border: 1.5px solid currentColor;
  flex: none;
}
.nav-link--board[aria-current="page"] .nav-dot { background: var(--accent); border-color: var(--accent); }
.nav-link--board .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  color: var(--text);
  text-decoration: none;
}
.sidebar-me:hover { background: var(--surface); }
.sidebar-me-text { display: grid; min-width: 0; line-height: 1.3; }
.sidebar-me-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Seiten
   ========================================================================== */

.page {
  padding: 24px 16px 0;
  max-width: 1120px;
}
@media (min-width: 900px) {
  .page { padding: 40px 40px 0; }
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-head-text { display: grid; gap: 6px; min-width: 0; }
.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: 0.005em;
  overflow-wrap: break-word;
  hyphens: auto;
}
.page-sub { color: var(--muted); max-width: 60ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.section { margin-bottom: 36px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
}
.section-note { color: var(--faint); font-size: 0.875rem; }

/* ---------- Aufgabenzeilen (Übersicht, Planung) ---------- */

.task-list {
  display: grid;
  border-top: 1px solid var(--line);
}
.task-row {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 14px;
  padding: 12px 4px 12px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-left: 0; border-right: 0; border-top: 0;
  text-align: left;
  width: 100%;
  color: inherit;
}
@media (hover: hover) { .task-row:hover { background: var(--bg-raised); } }
.task-row-prio { align-self: stretch; border-radius: 2px; background: var(--prio); }
.task-row-main { display: grid; gap: 4px; min-width: 0; }
.task-row-title { font-weight: 600; overflow-wrap: anywhere; }
.task-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.task-row-meta .sep { color: var(--faint); }
.task-row-side { display: flex; align-items: center; gap: 10px; }

.group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 24px 0 8px;
  font-weight: 700;
}
.group-title:first-child { margin-top: 0; }
.group-title .count { color: var(--faint); font-weight: 600; font-size: 0.875rem; }
.group-title--danger { color: var(--danger); }

/* ---------- Übersicht ---------- */

.dash {
  display: grid;
  gap: 36px;
}
@media (min-width: 1080px) {
  .dash { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; }
}
.summary-line {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 52ch;
}
.summary-line b { color: var(--text); font-weight: 700; }
.summary-line b.is-danger { color: var(--danger); }

.board-tiles { display: grid; gap: 10px; }
.board-tile {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}
@media (hover: hover) { .board-tile:hover { border-color: var(--line-strong); } }
.board-tile-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.board-tile-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.board-tile-count { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 2px; }

/* ==========================================================================
   Kanban
   ========================================================================== */

.shell-content { display: flex; flex-direction: column; min-height: 100dvh; min-width: 0; }
.shell-content:has(> .main--fill) { height: 100dvh; min-height: 0; }
.main--fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}
.board-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
@media (min-width: 900px) {
  .main--fill { padding-bottom: 0; }
}
@media (max-height: 520px) and (max-width: 899px) {
  .shell-content:has(> .main--fill) { height: auto; min-height: 100dvh; }
  .board-view { min-height: 480px; }
}

.board-head {
  display: grid;
  gap: 14px;
  padding: 18px 16px 12px;
}
@media (min-width: 900px) {
  .board-head { padding: 32px 32px 16px; }
}
.board-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.board-title-wrap { display: grid; gap: 4px; min-width: 0; flex: 1 1 260px; }
.board-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 0.95;
  overflow-wrap: break-word;
  hyphens: auto;
}
.board-desc { color: var(--muted); font-size: 0.875rem; max-width: 70ch; }
.board-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  color: inherit;
}
.board-picker .icon { color: var(--muted); }
.board-actions { display: flex; gap: 8px; flex: none; }

.board-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.search {
  position: relative;
  flex: 1 1 200px;
  max-width: 320px;
}
.search .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
.search .input { padding-left: 38px; min-height: 38px; }
.board-tools .select { width: auto; min-height: 38px; flex: 0 1 auto; }

.lane-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px;
}
.lane-chips::-webkit-scrollbar { display: none; }
.lane-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8125rem;
}
.lane-chip b { font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.lane-chip[aria-current="true"] { border-color: var(--accent); color: var(--text); }
.lane-chip[aria-current="true"] b { color: var(--accent-text); }
@media (min-width: 900px) {
  .lane-chips { display: none; }
}

.lanes {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 16px 16px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
  overscroll-behavior-x: contain;
  position: relative;
}
.lanes.is-dragging { scroll-snap-type: none; }
@media (min-width: 900px) {
  .lanes { padding: 4px 32px 24px; scroll-snap-type: none; gap: 14px; }
}

.lane {
  flex: 0 0 min(86vw, 340px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  border: 1px solid var(--line);
}
@media (min-width: 900px) {
  .lane { flex-basis: 300px; }
}
.lane.is-over { border-color: var(--accent); }
.lane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 8px 16px;
}
.lane-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3125rem;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lane-count {
  color: var(--faint);
  font-weight: 700;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.lane-done-mark { color: var(--ok); }
.lane-head .icon-btn { margin-left: auto; }

.lane-list {
  flex: 1;
  min-height: 64px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 10px 12px;
}
.lane-empty {
  padding: 14px 6px;
  color: var(--faint);
  font-size: 0.875rem;
  text-align: center;
}
.lanes.is-dragging .lane-empty { display: none; }

.card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px 12px 12px 15px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  flex: none;
}
.card::before {
  content: '';
  position: absolute;
  left: -1px; top: 10px; bottom: 10px;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--prio);
}
@media (hover: hover) { .card:hover { border-color: var(--line-strong); } }
.card:focus-visible { box-shadow: var(--focus); border-radius: var(--r-md); }
.card.is-done .card-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.card-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.card-meta .meta-item { display: inline-flex; align-items: center; gap: 4px; }
.card-meta .meta-item.is-complete { color: var(--ok); }

.card.is-drag-source { display: none; }
.card--ghost {
  position: fixed;
  left: 0; top: 0;
  z-index: 1000;
  margin: 0;
  pointer-events: none;
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
  rotate: 1.5deg;
  will-change: transform;
}
.card-placeholder {
  flex: none;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--accent);
  background: var(--accent-wash);
}
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
body.is-dragging { -webkit-user-select: none; user-select: none; }

/* ==========================================================================
   Dialoge
   ========================================================================== */

.dialog {
  padding: 0;
  border: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 100%;
  max-height: 94dvh;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; animation: sheet-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.dialog::backdrop { background: var(--overlay); animation: fade-in 0.2s ease; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

@media (min-width: 640px) {
  .dialog {
    margin: auto;
    width: calc(100% - 48px);
    max-width: 520px;
    max-height: min(88dvh, 860px);
    border-radius: var(--r-lg);
  }
  .dialog--lg { max-width: 860px; }
  .dialog--sm { max-width: 420px; }
}

.dialog-inner { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 10px 20px;
  border-bottom: 1px solid var(--line);
}
.dialog-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.dialog-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
}
.dialog-foot {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
}
@media (min-width: 640px) {
  .dialog-foot { padding-bottom: 12px; }
}
.dialog-foot .spacer { flex: 1; }
@media (max-width: 639px) {
  .dialog-foot .btn { flex: 1 1 auto; }
  .dialog-foot .spacer { display: none; }
}
.dialog-text { color: var(--muted); }
.dialog-body:focus, .dialog-body:focus-visible { box-shadow: none; outline: none; }
.dialog-kicker { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.dialog-kicker .save-state { margin-left: 4px; }

/* ---------- Aufgabendetail ---------- */

.task-detail {
  display: grid;
  gap: 24px;
}
@media (min-width: 760px) {
  .task-detail { grid-template-columns: minmax(0, 1fr) 240px; align-items: start; }
}
.task-main { display: grid; gap: 24px; min-width: 0; }
.task-side {
  display: grid;
  gap: 16px;
  align-content: start;
}
@media (min-width: 760px) {
  .task-side { padding-left: 20px; border-left: 1px solid var(--line); }
}
.title-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-md);
  padding: 6px 8px;
  margin: -6px -8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.15;
  resize: none;
  overflow: hidden;
}
.title-input:hover:not(:disabled) { border-color: var(--line); }
.title-input:focus-visible { border-color: var(--accent); box-shadow: none; }
.title-input:disabled { color: var(--text); opacity: 1; }
.task-where { color: var(--muted); font-size: 0.875rem; margin-top: 8px; }

.block { display: grid; gap: 10px; }
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.block-title { font-weight: 700; font-size: 1rem; }
.block-note { color: var(--faint); font-size: 0.8125rem; font-weight: 600; }

.desc-view {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}
.desc-view.is-empty { color: var(--faint); }

.checklist { display: grid; gap: 2px; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 4px 7px 6px;
  border-radius: var(--r-sm);
}
@media (hover: hover) { .check-item:hover { background: var(--surface-2); } }
.check-item .check { flex: 1; min-width: 0; }
.check-item .check span { overflow-wrap: anywhere; }
.check-item.is-done .check span { color: var(--muted); text-decoration: line-through; }
.check-item .icon-btn { opacity: 0.6; }
.check-item:hover .icon-btn, .check-item .icon-btn:focus-visible { opacity: 1; }
@media (hover: none) { .check-item .icon-btn { opacity: 1; } }
.inline-add { display: flex; gap: 8px; }
.inline-add .input { min-height: 38px; }

.assignee-list { display: grid; gap: 4px; }
.assignee {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}
.assignee-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignee .icon-btn { margin-left: auto; }

.picker { display: grid; gap: 2px; max-height: 50dvh; overflow-y: auto; }
.picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
}
@media (hover: hover) { .picker-item:hover { background: var(--surface-2); } }
.picker-item .check input { margin: 0; }
.picker-item-text { display: grid; min-width: 0; line-height: 1.3; flex: 1; }
.picker-item-name { font-weight: 600; }
.picker-item-load { margin-left: auto; color: var(--faint); font-size: 0.8125rem; white-space: nowrap; }
.picker-item.is-disabled { opacity: 0.45; cursor: not-allowed; }

.comments { display: grid; gap: 16px; }
.comment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.comment-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.comment-author { font-weight: 700; }
.comment-time { color: var(--faint); font-size: 0.8125rem; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.comment-delete {
  border: 0; background: none; padding: 0;
  color: var(--faint); font-size: 0.8125rem; font-weight: 600;
  margin-left: auto;
}
.comment-delete:hover { color: var(--danger); }
.comment-form { display: grid; gap: 8px; }
.comment-form .textarea { min-height: 72px; }
.comment-form .btn { justify-self: end; }

.meta-list { display: grid; gap: 4px; color: var(--faint); font-size: 0.8125rem; }

.save-state {
  color: var(--faint);
  font-size: 0.8125rem;
  font-weight: 600;
  min-height: 1.2em;
}

/* ==========================================================================
   Team
   ========================================================================== */

.member-list { display: grid; border-top: 1px solid var(--line); }
.member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.member-main { display: grid; gap: 2px; min-width: 0; }
.member-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  min-width: 0;
}
.member-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 0.8125rem; }
.member-load {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 70px;
}
.member-load-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.member-load-label { font-size: 0.75rem; color: var(--faint); }
.member.is-inactive .member-main, .member.is-inactive .avatar { opacity: 0.5; }
.member-actions { display: flex; gap: 4px; }
.tag {
  font-family: var(--font-ui);
  letter-spacing: normal;
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
  flex: none;
}
.tag--accent { background: var(--accent-wash); color: var(--accent-text); }
.tag--danger { background: var(--danger-wash); color: var(--danger); }

.team-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* ==========================================================================
   Rollen
   ========================================================================== */

.role-ladder {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.role-rung {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.role-rung-bar { align-self: stretch; border-radius: 3px; background: var(--role); }
.role-rung-main { display: grid; gap: 4px; min-width: 0; }
.role-rung-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.role-rung-perms { color: var(--muted); font-size: 0.8125rem; }
.role-rung-actions { display: flex; align-items: center; gap: 2px; }
.role-rung.is-locked .role-rung-name { color: var(--muted); }

.perm-list { display: grid; gap: 14px; }
.perm-list .check { align-items: flex-start; }
.perm-text { display: grid; gap: 2px; }
.perm-text b { font-weight: 600; }
.perm-text small { color: var(--muted); font-size: 0.8125rem; line-height: 1.4; }
.perm-text .perm-locked { color: var(--faint); font-size: 0.75rem; }

.color-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--sw);
  padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

/* ==========================================================================
   Planung
   ========================================================================== */

.plan-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; align-items: center; }
.plan-tools .select { width: auto; }

.plan-grid { display: grid; gap: 36px; }
@media (min-width: 1080px) {
  .plan-grid { grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); align-items: start; }
}

.day { margin-bottom: 20px; }
.day-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.day-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.1;
}
.day-date { color: var(--faint); font-size: 0.875rem; font-weight: 600; }
.day.is-today .day-name { color: var(--accent-text); }
.day.is-overdue .day-name { color: var(--danger); }

.workload { display: grid; gap: 12px; }
.workload-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 4px 0;
  color: inherit;
  text-align: left;
  width: 100%;
}
.workload-row-main { display: grid; gap: 5px; min-width: 0; }
.workload-name { font-weight: 600; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workload-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.workload-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--role, var(--accent)); }
.workload-num { min-width: 2ch; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.875rem; }
.workload-row[aria-pressed="true"] .workload-name { color: var(--accent-text); }

/* ==========================================================================
   Protokoll
   ========================================================================== */

.log { display: grid; border-left: 2px solid var(--line); margin-left: 13px; }
.log-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 0 0 18px 0;
  margin-left: -15px;
}
.log-item .avatar { box-shadow: 0 0 0 4px var(--bg); }
.log-text { overflow-wrap: anywhere; padding-top: 3px; }
.log-text b { font-weight: 700; }
.log-time { display: block; color: var(--faint); font-size: 0.8125rem; }
.log-day {
  margin: 6px 0 14px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--muted);
}

/* ==========================================================================
   Profil
   ========================================================================== */

.profile-grid { display: grid; gap: 36px; max-width: 760px; }
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-card .avatar { --size: 64px; }
.profile-name { font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.perm-summary { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==========================================================================
   Menü (Mehr-Blatt, Board-Auswahl)
   ========================================================================== */

.menu-list { display: grid; gap: 2px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding: 0 12px;
  border-radius: var(--r-md);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
}
@media (hover: hover) { .menu-item:hover { background: var(--surface-2); } }
.menu-item[aria-current="page"] { background: var(--surface-2); }
.menu-item[aria-current="page"] .icon { color: var(--accent-text); }
.menu-item .icon { color: var(--muted); }
.menu-item .menu-meta { margin-left: auto; color: var(--faint); font-size: 0.8125rem; font-weight: 600; }
.menu-item--danger, .menu-item--danger .icon { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }

/* Spaltenverwaltung im Board-Dialog */
.col-edit { display: grid; gap: 8px; }
.col-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-raised);
}
.col-row-main { display: grid; gap: 8px; min-width: 0; }
.col-row .input { min-height: 38px; }
.col-row-actions { display: flex; gap: 2px; align-self: start; }

/* ==========================================================================
   Toasts
   ========================================================================== */

.toasts {
  position: fixed;
  z-index: 2000;
  left: 16px; right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
}
@media (min-width: 900px) {
  .toasts { left: auto; right: 24px; bottom: 24px; justify-items: end; }
}
.toast {
  pointer-events: auto;
  max-width: 420px;
  padding: 11px 16px;
  border-radius: var(--r-md);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lift);
  animation: toast-in 0.2s ease;
}
.toast--error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* Toasts liegen als Popover in der Top-Layer, damit sie auch über Dialogen erscheinen */
.toasts[popover] {
  inset: auto;
  left: 16px; right: 16px;
  top: auto;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  color: inherit;
}
@media (min-width: 900px) {
  .toasts[popover] { left: auto; right: 24px; bottom: 24px; }
}

.load-more { margin-top: 12px; }

.skeleton {
  height: 14px;
  border-radius: 7px;
  background: var(--surface);
  animation: pulse 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Erweiterungen: Labels, Spaltenfarben, WIP, Liste, Einstellungen, Discord
   ========================================================================== */

/* ---------- Labels ---------- */
.labels { display: flex; flex-wrap: wrap; gap: 4px; }
.label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  background: color-mix(in srgb, var(--lbl, var(--faint)) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lbl, var(--faint)) 45%, transparent);
  white-space: nowrap;
}
.label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lbl, var(--faint));
}
.label--more { --lbl: var(--faint); }
.label--more::before { display: none; }
.label-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.label--toggle {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.8125rem;
  border: 0;
  cursor: pointer;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--muted);
}
.label--toggle[aria-pressed="true"] {
  color: var(--text);
  background: color-mix(in srgb, var(--lbl) 26%, transparent);
  box-shadow: inset 0 0 0 1px var(--lbl);
}
.label--toggle:disabled { cursor: default; opacity: 0.7; }
.card .labels { margin-bottom: -2px; }
.task-row-main .labels { margin-bottom: 2px; }

/* ---------- Spaltenfarbe & WIP ---------- */
.lane { border-top: 3px solid var(--col, var(--line)); }
.lane-dot {
  width: 9px; height: 9px;
  flex: none;
  border-radius: 3px;
  background: var(--col, var(--faint));
}
.lane-head .lane-dot { margin-right: 2px; }
.lane-count.is-over, .lane-chip b.is-over { color: var(--danger); }
.lane.is-over-limit { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 55%, transparent); }
.lane.is-over-limit .lane-count { background: var(--danger-wash); padding: 1px 6px; border-radius: 999px; }
.lane-chip[aria-current="true"] { border-color: var(--col, var(--accent)); }
.lane-title { font-size: 1.1875rem; letter-spacing: 0.01em; }

/* ---------- Werkzeugleiste & Listenansicht ---------- */
.tools-spacer { flex: 1 1 0; min-width: 0; }
.board-tools .select[hidden] { display: none; }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 559px) {
  .view-toggle button span:not(.icon) { display: none; }
  .tools-spacer { display: none; }
}
.board-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 16px 24px;
}
@media (min-width: 900px) {
  .board-list { padding: 4px 32px 32px; }
}
.list-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.1;
}
.list-group:first-child { margin-top: 4px; }
.list-group .count { font-family: var(--font-ui); font-size: 0.875rem; color: var(--faint); font-weight: 600; }

/* ---------- Spalten-Editor ---------- */
.col-row { border-left: 3px solid var(--col, var(--line)); }
.col-row-line { display: flex; align-items: center; gap: 10px; }
.col-row-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--col); flex: none; }
.col-row-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.col-wip { display: inline-flex; align-items: center; gap: 8px; }
.input--wip { width: 72px; min-height: 34px; padding: 4px 10px; }
.swatch--sm { width: 22px; height: 22px; }
.color-row .color-custom { width: 34px; height: 30px; padding: 2px; }
.color-row { gap: 6px; }

.label-edit { display: grid; gap: 8px; }
.label-row {
  display: grid;
  grid-template-columns: minmax(80px, auto) minmax(0, 1fr) auto;
  grid-template-areas: "chip name del" "colors colors colors";
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-raised);
}
.label-row > .label { grid-area: chip; justify-self: start; }
.label-row > .input { grid-area: name; min-height: 36px; }
.label-row > .color-row { grid-area: colors; }
.label-row > .icon-btn { grid-area: del; }

/* ---------- Einstellungen ---------- */
.settings-block { max-width: 760px; display: grid; gap: 14px; }
.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--line);
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--faint); }
.status-card--ok .status-dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-wash); }
.status-card--danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.status-card--danger .status-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-wash); }
.status-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.status-text span { color: var(--muted); font-size: 0.875rem; }
@media (max-width: 559px) {
  .status-card { flex-wrap: wrap; }
}
.howto {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 16px;
}
.howto summary { cursor: pointer; font-weight: 600; }
.steps { margin: 12px 0 2px; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); }
.steps li::marker { color: var(--accent-text); font-weight: 700; }
.settings-toggles { gap: 16px; }
.sync-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

/* ---------- Discord-Rollen ---------- */
.drole-list { max-height: 260px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; }
.drole-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dc); }
.drole-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--faint);
}
.drole-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
}
.drole-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dc); }
.tag--sync { gap: 4px; background: var(--accent-wash); color: var(--accent-text); }

/* ---------- Verlauf ---------- */
.history {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--line);
  display: grid;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--muted);
}
.history li { display: grid; gap: 1px; overflow-wrap: anywhere; }
.history b { color: var(--text); font-weight: 600; }
.history time { color: var(--faint); font-size: 0.8125rem; }

.avatar--bot { background: var(--accent-fill); color: var(--accent-ink); }

/* ---------- Filterleiste: Desktop in einer Zeile, Mobil aufklappbar ---------- */
.board-filters { display: contents; }
.filter-toggle { display: none; min-height: 38px; padding: 0 12px; }
.filter-count:empty { display: none; }
.filter-count {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-fill); color: var(--accent-ink);
  font-size: 0.6875rem; line-height: 18px; text-align: center;
}
@media (min-width: 900px) {
  .board-tools .view-toggle { order: 10; margin-left: auto; }
  .board-tools .board-filters .select:last-of-type { order: 9; }
}
@media (max-width: 899px) {
  .board-tools { flex-wrap: wrap; }
  .board-tools .search { flex: 1 1 120px; max-width: none; }
  .filter-toggle { display: inline-flex; }
  .board-filters { display: none; }
  .board-tools.is-open .board-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .board-tools.is-open .board-filters .select { width: 100%; }
  .board-tools.is-open .board-filters .btn { grid-column: 1 / -1; justify-self: start; }
}

/* ==========================================================================
   Rechte-Menü, Akte, Statistik, Team-Erweiterungen
   ========================================================================== */

.page--wide { max-width: 1320px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.875rem; }
.back-link:hover { color: var(--text); }

/* ---------- Rollen: Liste + Editor ---------- */
.roles-layout { display: grid; gap: 20px; }
@media (min-width: 1000px) {
  .roles-layout { grid-template-columns: 290px minmax(0, 1fr); align-items: start; }
  .role-list { position: sticky; top: 24px; max-height: calc(100dvh - 48px); overflow-y: auto; }
  .role-back { display: none; }
}
@media (max-width: 999px) {
  .roles-layout.is-editing .role-list { display: none; }
  .roles-layout:not(.is-editing) .role-editor { display: none; }
}
.role-list { display: grid; gap: 4px; align-content: start; }
.role-item { display: flex; align-items: center; gap: 4px; border-radius: var(--r-md); border: 1px solid transparent; }
.role-item[aria-current="true"] { background: var(--surface); border-color: var(--line-strong); }
.role-item-main {
  flex: 1; min-width: 0;
  display: flex; align-items: stretch; gap: 12px;
  padding: 10px 6px 10px 10px;
  border: 0; background: transparent; color: inherit; text-align: left;
  border-radius: var(--r-md);
}
@media (hover: hover) { .role-item:not([aria-current="true"]):hover { background: var(--bg-raised); } }
.role-item-bar { width: 4px; border-radius: 2px; background: var(--role); flex: none; }
.role-item-text { display: grid; gap: 3px; min-width: 0; }
.role-item-name { font-family: var(--font-display); font-weight: 700; font-size: 1.1875rem; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 0.75rem; color: var(--faint); }
.role-item-move { display: flex; flex-direction: column; padding-right: 4px; }
.role-item-move .icon-btn { width: 26px; height: 22px; }

.role-editor {
  display: grid; gap: 18px;
  padding: 22px;
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  position: relative;
}
@media (max-width: 559px) { .role-editor { padding: 16px 14px; } }
.role-back { justify-self: start; }
.role-editor-head { display: flex; align-items: center; gap: 12px; }
.role-editor-swatch { width: 14px; height: 40px; border-radius: 5px; background: var(--role); flex: none; }
.role-name-input {
  flex: 1; min-width: 0;
  font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1;
  padding: 4px 10px;
  border-color: transparent; background: transparent;
}
.role-name-input:hover:not(:disabled) { border-color: var(--line); }
.role-name-input:disabled { opacity: 1; color: var(--text); }

.editor-block { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.editor-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.editor-block-head h3 { font-size: 1rem; font-weight: 700; }
.editor-cols { display: grid; gap: 18px; }
@media (min-width: 760px) { .editor-cols { grid-template-columns: 1fr 1fr; } }
.editor-danger { display: flex; justify-content: flex-end; padding-top: 8px; }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 0.875rem;
}
@media (hover: hover) { .preset:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-wash); } }
.preset:disabled { opacity: 0.5; cursor: not-allowed; }
.preset-own { font-size: 0.6875rem; color: var(--accent-text); font-weight: 700; }
.preset-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.preset-tools .select { width: auto; min-height: 36px; }
.preset-manage summary { cursor: pointer; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.preset-manage-list { display: grid; gap: 4px; margin-top: 8px; }
.preset-manage-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; border-radius: var(--r-sm); background: var(--surface); }

.scope-opts { display: grid; gap: 8px; }
.scope-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); cursor: pointer; }
.scope-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.scope-opt input { margin-top: 3px; accent-color: var(--accent-fill); width: 16px; height: 16px; flex: none; }
.scope-opt span { display: grid; gap: 2px; }
.scope-opt small { color: var(--muted); font-size: 0.8125rem; line-height: 1.4; }

.limit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.limit-label { font-weight: 600; min-width: 92px; }
.select--sm { width: auto; min-height: 34px; padding-top: 4px; padding-bottom: 4px; }
.limit-state { min-width: 70px; }

.perm-groups { display: grid; gap: 18px; }
.perm-group { display: grid; gap: 8px; }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.perm-group-head h4 { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; }
.perm-grid { display: grid; gap: 8px; }
@media (min-width: 760px) { .perm-grid { grid-template-columns: 1fr 1fr; } }
.perm-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.perm-toggle.is-on { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.perm-toggle:has(input:disabled) { cursor: default; }

.switch {
  appearance: none; flex: none;
  width: 36px; height: 20px; margin: 1px 0 0;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative; cursor: pointer;
  transition: background-color 0.15s;
}
.switch::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.switch:checked { background: var(--accent-fill); }
.switch:checked::after { transform: translateX(16px); }
.switch:disabled { opacity: 0.45; cursor: not-allowed; }
.switch:focus-visible { box-shadow: var(--focus); }

.save-bar {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  z-index: 15;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-lift);
}
.save-bar > span { margin-right: auto; font-weight: 600; }
@media (min-width: 900px) { .save-bar { bottom: 16px; } }

.matrix-hint { margin-bottom: 14px; }
.matrix-wrap { overflow: auto; max-height: calc(100dvh - 240px); border: 1px solid var(--line); border-radius: var(--r-lg); }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 0.875rem; min-width: 100%; }
.matrix th, .matrix td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; background: var(--bg); }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--bg-raised); vertical-align: bottom; }
.matrix tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; text-align: left; font-weight: 600; background: var(--bg-raised); }
.matrix .matrix-corner { left: 0; z-index: 3; text-align: left; }
.matrix-role { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.matrix-role::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--role); }
.matrix-group th { text-align: left; font-size: 0.75rem; color: var(--faint); font-weight: 700; background: var(--bg-raised); position: sticky; left: 0; }
.matrix td.is-implied { background: var(--accent-wash); }
.matrix-check { justify-content: center; }

/* ---------- Team & Akte ---------- */
.member-link { text-decoration: none; color: inherit; border-radius: var(--r-sm); }
@media (hover: hover) { .member-link:hover .member-name span:first-child { text-decoration: underline; text-underline-offset: 3px; } }
.member-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag--points { background: var(--accent-wash); color: var(--accent-text); }
.tag { gap: 3px; }

.cleanup {
  margin-bottom: 20px; padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent);
  background: var(--danger-wash);
  display: grid; gap: 10px;
}
.cleanup-head { display: flex; align-items: center; gap: 8px; color: var(--danger); }
.cleanup-list { display: grid; gap: 6px; }
.cleanup-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.cleanup-name { font-weight: 600; }
.cleanup-access { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
@media (max-width: 559px) { .cleanup-row { grid-template-columns: auto 1fr auto; } .cleanup-access { grid-column: 2 / -1; grid-row: 2; } }

.access-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.access-item { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); align-items: center; }
.access-item:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }

.avatar--xl { --size: 76px; }
.file-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 28px; }
.file-head-text { flex: 1; min-width: 220px; display: grid; gap: 6px; }
.file-former { margin-top: 6px; }
.file-grid { display: grid; gap: 28px; }
@media (min-width: 980px) { .file-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); align-items: start; } }
.file-col { display: grid; gap: 28px; }
.file-block { display: grid; gap: 12px; }
.file-admin { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.points-hero { display: flex; align-items: baseline; gap: 10px; }
.points-value { font-family: var(--font-display); font-weight: 800; font-size: 3.5rem; line-height: 0.9; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.points-label { color: var(--muted); font-weight: 600; }
.points-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.file-history .pos { color: var(--ok); }
.file-history .neg { color: var(--danger); }
.file-history .tag { margin-left: 6px; }
.points-pill { margin-left: auto; display: grid; justify-items: end; text-decoration: none; }
.points-pill .points-value { font-size: 2.5rem; }
.profile-card { flex-wrap: wrap; }
.summary-points { color: var(--muted); text-decoration: none; white-space: nowrap; }
.summary-points b { color: var(--accent-text); }

.notes { display: grid; gap: 10px; }
.note { padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-raised); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.note--warn { border-left-color: var(--danger); }
.note-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 0.875rem; }
.note-head time { color: var(--faint); font-size: 0.8125rem; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }

/* ---------- Statistik ---------- */
.stat-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 32px; }
.stat-tile { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); background: var(--bg-raised); border: 1px solid var(--line); }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: 2.25rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.stat-tile--danger .stat-value { color: var(--danger); }

.chart { margin: 0; display: grid; gap: 10px; }
.chart-cap { display: flex; align-items: baseline; gap: 10px; }
.chart-cap span { color: var(--faint); font-size: 0.875rem; }
.chart-plot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; height: 200px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; color: var(--faint); font-size: 0.75rem; font-variant-numeric: tabular-nums; text-align: right; }
.chart-area { position: relative; }
.chart-grid { position: absolute; inset: 0; border-top: 1px dashed var(--line); border-bottom: 1px solid var(--line-strong); pointer-events: none; }
.chart-bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; align-items: end; }
.chart-col { height: 100%; display: flex; align-items: flex-end; border: 0; padding: 0; background: transparent; border-radius: 4px 4px 0 0; cursor: default; }
.chart-col:focus-visible { box-shadow: var(--focus); }
.chart-bar { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); }
.chart-col:hover .chart-bar, .chart-col:focus-visible .chart-bar { background: var(--accent-text); }
.chart-tip {
  position: absolute; top: -8px;
  transform: translate(-50%, -100%);
  display: grid; gap: 2px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lift);
  font-size: 0.8125rem; white-space: nowrap;
  pointer-events: none; z-index: 5;
}
.chart-tip b { font-size: 1rem; }
.chart-tip span { color: var(--muted); }
.chart-x { display: flex; justify-content: space-between; padding-left: 34px; color: var(--faint); font-size: 0.75rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.stats-table th, .stats-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.stats-table thead th { color: var(--muted); font-weight: 600; font-size: 0.8125rem; background: var(--bg-raised); }
.stats-table tbody tr:last-child > * { border-bottom: 0; }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-table .is-danger { color: var(--danger); font-weight: 700; }
.stats-table a { color: var(--text); text-decoration: none; }
.stats-person { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.col-bar { min-width: 180px; }
.hbar { display: flex; align-items: center; gap: 8px; }
.hbar-fill { display: block; height: 10px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--accent); }
.hbar-num { font-variant-numeric: tabular-nums; font-weight: 700; }

/* Board-Zugriff */
.access-editor .scope-opts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.access-sub { display: grid; gap: 8px; margin-top: 4px; }
.access-people summary { cursor: pointer; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.access-people .tag:empty { display: none; }
.people-picker { max-height: 240px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; }

/* ---------- Taiga-Funktionen ---------- */
.card-ref { color: var(--faint); font-weight: 600; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.card.is-blocked { border-color: color-mix(in srgb, var(--danger) 60%, var(--line)); }
.card-blocked { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 700; color: var(--danger); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-estimate { min-width: 20px; height: 20px; padding: 0 5px; justify-content: center; border-radius: 5px; background: var(--surface-2); color: var(--text); font-size: 0.75rem; }
.lane--collapsed { flex: 0 0 52px !important; scroll-snap-align: start; }
.lane-collapsed-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 0; border: 0; background: transparent; color: var(--muted); border-radius: var(--r-lg);
}
@media (hover: hover) { .lane-collapsed-btn:hover { color: var(--text); background: var(--surface); } }
.lane-collapsed-name { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.02em; white-space: nowrap; }
.lane-collapsed-count { font-weight: 700; font-size: 0.8125rem; color: var(--faint); }
.lane-head .lane-fold { margin-left: 0; }
.lane-head .icon-btn:first-of-type { margin-left: auto; }
.block-flag { padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line); }
.block-flag.is-blocked { border-color: var(--danger); background: var(--danger-wash); }
.block-flag .check { align-items: center; }
.attachments { display: grid; gap: 6px; }
.attachment { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-raised); }
.attachment-thumb { width: 44px; height: 44px; border-radius: var(--r-sm); overflow: hidden; display: block; background: var(--surface-2); }
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-icon { width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.attachment-text { display: grid; min-width: 0; }
.attachment-name { color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-name:hover { text-decoration: underline; }
.dropzone {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; border-radius: var(--r-md);
  border: 1.5px dashed var(--line-strong); background: transparent; color: var(--muted); font-weight: 600;
}
.dropzone small { width: 100%; text-align: center; color: var(--faint); font-weight: 500; }
.dropzone.is-over, .dropzone:hover { border-color: var(--accent); color: var(--text); background: var(--accent-wash); }

.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.block-flag .input { margin-top: 8px; }

.access-people summary { list-style: none; }
.access-people summary::-webkit-details-marker { display: none; }
.access-people summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--surface-2); color: var(--text); font-weight: 700; }
.access-people[open] summary::before { content: "−"; }

.access-row--linked { grid-template-columns: minmax(0, 1fr) minmax(140px, 220px) auto; }
@media (max-width: 559px) { .access-row--linked { grid-template-columns: 1fr auto; } .access-row--linked .select { grid-column: 1; grid-row: 2; width: 100%; } }
.access-linked { margin-left: auto; color: var(--accent-text); display: inline-flex; }

.prefix-form .input { max-width: 220px; }
.fail-list { margin: 6px 0; padding-left: 18px; }

/* ---------- Feinschliff: Icons in Umschaltern & Seitenleiste ---------- */
.toggle-group button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
}
.toggle-group button .icon svg { display: block; }
.nav-link--board .icon { color: var(--faint); }
.nav-link--board:hover .icon { color: var(--muted); }
.nav-link--board[aria-current="page"] .icon { color: var(--accent-text); }
.nav-link--board { min-height: 38px; }
