/* ═══════════════════════════════════════════════════════════════
   Themes & Design-System
   Wird NACH style.css geladen und legt sich darüber.

   Jedes Theme definiert nur Farb-Tokens als "R G B"-Tripel (damit sich
   daraus beliebige Transparenzen bauen lassen). Darunter werden diese
   Tokens auf die bestehenden Variablen (--bg-*, --accent, …) gemappt,
   sodass alle vorhandenen Komponenten automatisch mitziehen.

   Designprinzip (übernommen vom City-Survival-Panel): gestaffelte dunkle
   Flächen (sunken → surface → raised), EINE flache Akzentfarbe pro Theme
   statt Farbverläufen, Tiefe über einen weichen Glow bei Hover/Aktiv.
   Umgeschaltet über <html data-theme="…"> (siehe js/theme.js).
   ═══════════════════════════════════════════════════════════════ */

:root,
[data-theme="snojan"] {
  --c-sunken: 8 9 12;
  --c-surface: 15 17 23;
  --c-raised: 23 26 35;
  --c-border: 37 41 56;
  --c-border-strong: 52 58 78;
  --c-hover: 32 36 50;
  --c-brand: 88 101 242;
  --c-brand-hover: 71 82 222;
  --c-accent: 128 142 255;
  --glow-accent: rgba(88, 101, 242, 0.5);
  --glow-secondary: rgba(139, 92, 246, 0.35);
}

[data-theme="citysurvival"] {
  --c-sunken: 16 13 10; --c-surface: 23 19 15; --c-raised: 32 26 20;
  --c-border: 51 41 33; --c-border-strong: 74 60 43; --c-hover: 51 41 33;
  --c-brand: 224 102 31; --c-brand-hover: 194 85 26; --c-accent: 243 137 76;
  --glow-accent: rgba(224, 102, 31, 0.55); --glow-secondary: rgba(243, 137, 76, 0.3);
}
[data-theme="indigo"] {
  --c-sunken: 11 14 20; --c-surface: 18 22 31; --c-raised: 26 31 43;
  --c-border: 42 49 64; --c-border-strong: 58 66 84; --c-hover: 42 49 64;
  --c-brand: 99 102 241; --c-brand-hover: 84 87 224; --c-accent: 129 140 248;
  --glow-accent: rgba(99, 102, 241, 0.5); --glow-secondary: rgba(99, 102, 241, 0.25);
}
[data-theme="neonvice"] {
  --c-sunken: 13 6 24; --c-surface: 22 12 38; --c-raised: 32 20 54;
  --c-border: 54 36 88; --c-border-strong: 77 53 117; --c-hover: 54 36 88;
  --c-brand: 255 47 176; --c-brand-hover: 224 33 154; --c-accent: 255 106 199;
  --glow-accent: rgba(255, 47, 176, 0.6); --glow-secondary: rgba(34, 211, 238, 0.4);
}
[data-theme="bloodmoon"] {
  --c-sunken: 13 5 5; --c-surface: 23 8 8; --c-raised: 33 11 11;
  --c-border: 58 20 20; --c-border-strong: 85 27 27; --c-hover: 58 20 20;
  --c-brand: 220 38 38; --c-brand-hover: 185 28 28; --c-accent: 239 68 68;
  --glow-accent: rgba(220, 38, 38, 0.55); --glow-secondary: rgba(139, 0, 0, 0.4);
}
[data-theme="matrix"] {
  --c-sunken: 0 0 0; --c-surface: 6 10 6; --c-raised: 12 19 12;
  --c-border: 26 42 26; --c-border-strong: 37 64 37; --c-hover: 26 42 26;
  --c-brand: 43 255 110; --c-brand-hover: 31 214 92; --c-accent: 107 255 158;
  --glow-accent: rgba(43, 255, 110, 0.6); --glow-secondary: rgba(43, 255, 110, 0.3);
  --on-brand: #041a0b;
}
[data-theme="goldenhour"] {
  --c-sunken: 16 12 6; --c-surface: 25 19 9; --c-raised: 34 26 12;
  --c-border: 54 43 21; --c-border-strong: 77 61 29; --c-hover: 54 43 21;
  --c-brand: 224 165 38; --c-brand-hover: 194 148 31; --c-accent: 240 188 74;
  --glow-accent: rgba(224, 165, 38, 0.5); --glow-secondary: rgba(224, 130, 38, 0.35);
  --on-brand: #1c1303;
}
[data-theme="premiumglass"] {
  --c-sunken: 8 11 16; --c-surface: 15 22 32; --c-raised: 18 25 34;
  --c-border: 38 48 60; --c-border-strong: 58 70 85; --c-hover: 27 38 50;
  --c-brand: 122 140 255; --c-brand-hover: 99 115 232; --c-accent: 143 157 255;
  --glow-accent: rgba(122, 140, 255, 0.5); --glow-secondary: rgba(122, 140, 255, 0.25);
}
[data-theme="abyss"] {
  --c-sunken: 5 10 13; --c-surface: 8 18 24; --c-raised: 12 26 34;
  --c-border: 22 48 61; --c-border-strong: 31 65 82; --c-hover: 22 48 61;
  --c-brand: 20 184 196; --c-brand-hover: 14 153 163; --c-accent: 79 216 227;
  --glow-accent: rgba(20, 184, 196, 0.6); --glow-secondary: rgba(76, 29, 149, 0.35);
}
[data-theme="toxic"] {
  --c-sunken: 10 13 5; --c-surface: 18 22 10; --c-raised: 26 31 13;
  --c-border: 45 53 18; --c-border-strong: 65 74 26; --c-hover: 45 53 18;
  --c-brand: 173 255 2; --c-brand-hover: 143 214 0; --c-accent: 195 255 77;
  --glow-accent: rgba(173, 255, 2, 0.55); --glow-secondary: rgba(255, 180, 0, 0.3);
  --on-brand: #141c00;
}
[data-theme="sakura"] {
  --c-sunken: 18 10 20; --c-surface: 27 15 30; --c-raised: 36 21 40;
  --c-border: 58 35 64; --c-border-strong: 79 47 87; --c-hover: 58 35 64;
  --c-brand: 244 114 182; --c-brand-hover: 224 85 159; --c-accent: 249 168 212;
  --glow-accent: rgba(244, 114, 182, 0.55); --glow-secondary: rgba(167, 139, 250, 0.35);
}
[data-theme="vault"] {
  --c-sunken: 7 15 12; --c-surface: 12 23 18; --c-raised: 16 31 25;
  --c-border: 28 51 41; --c-border-strong: 39 68 56; --c-hover: 28 51 41;
  --c-brand: 212 175 55; --c-brand-hover: 184 149 46; --c-accent: 232 199 102;
  --glow-accent: rgba(212, 175, 55, 0.55); --glow-secondary: rgba(16, 163, 74, 0.4);
  --on-brand: #1a1403;
}
[data-theme="void"] {
  --c-sunken: 5 2 8; --c-surface: 10 5 18; --c-raised: 15 8 28;
  --c-border: 29 16 51; --c-border-strong: 42 23 71; --c-hover: 29 16 51;
  --c-brand: 139 92 246; --c-brand-hover: 116 64 232; --c-accent: 167 139 250;
  --glow-accent: rgba(139, 92, 246, 0.6); --glow-secondary: rgba(217, 70, 239, 0.35);
}
/* Helles Theme (Ersatz für den alten Dark/Light-Schalter) */
[data-theme="light"] {
  --c-sunken: 238 240 246; --c-surface: 255 255 255; --c-raised: 255 255 255;
  --c-border: 222 225 235; --c-border-strong: 201 206 221; --c-hover: 234 237 245;
  --c-brand: 88 101 242; --c-brand-hover: 71 82 222; --c-accent: 71 82 222;
  --glow-accent: rgba(88, 101, 242, 0.28); --glow-secondary: rgba(139, 92, 246, 0.18);
  --t-text: #1b1e2b; --t-text-dim: #50566b; --t-text-muted: #858aa0;
}

/* ── Tokens → bestehende Variablen ─────────────────────────────── */
:root {
  --bg-0: rgb(var(--c-sunken));
  --bg-1: rgb(var(--c-surface));
  --bg-2: rgb(var(--c-raised));
  --bg-3: rgb(var(--c-hover));
  --bg-4: rgb(var(--c-border-strong));
  --bg-hover: rgb(var(--c-hover));
  --border: rgb(var(--c-border));
  --border-bright: rgb(var(--c-border-strong));
  --accent: rgb(var(--c-brand));
  --accent-2: rgb(var(--c-accent));
  --accent-hover: rgb(var(--c-brand-hover));
  --accent-glow: var(--glow-accent);
  --accent-dim: rgb(var(--c-brand) / 0.12);
  --text: var(--t-text, #eef0f5);
  --text-dim: var(--t-text-dim, #a3a9ba);
  --text-muted: var(--t-text-muted, #6f7589);
  --glow: 0 0 0 3px rgb(var(--c-brand) / 0.18);
  --on-brand-color: var(--on-brand, #fff);
  --radius: 14px;
  --radius-sm: 10px;
}
/* Der alte :root[data-theme="light"]-Block aus style.css hat höhere Spezifität —
   dort gesetzte Hintergründe gelten weiter, die Akzentfarben kommen von hier. */
:root[data-theme="light"] {
  --accent-glow: var(--glow-accent);
  --accent-dim: rgb(var(--c-brand) / 0.10);
  --text: #1b1e2b; --text-dim: #50566b; --text-muted: #858aa0;
}

/* ── Grundflächen ──────────────────────────────────────────────── */
body { background: var(--bg-0); }
html { scrollbar-width: thin; scrollbar-color: var(--border-bright) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background-color: var(--border-bright); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--accent-2); }
::selection { background: rgb(var(--c-brand) / 0.35); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-2) !important; outline-offset: 2px; }

/* Hintergrund-Blobs in den Theme-Farben statt fest Blau/Pink/Cyan */
.mesh-bg span:nth-child(1) { background: radial-gradient(circle, rgb(var(--c-brand)), transparent 70%); opacity: 0.16; }
.mesh-bg span:nth-child(2) { background: radial-gradient(circle, var(--glow-secondary), transparent 70%); opacity: 0.35; }
.mesh-bg span:nth-child(3) { background: radial-gradient(circle, rgb(var(--c-accent)), transparent 70%); opacity: 0.06; }
.mesh-bg span:nth-child(4) { display: none; }
[data-theme="light"] .mesh-bg span { opacity: 0.08; }
.login-body {
  background: radial-gradient(120% 120% at 50% -10%, var(--glow-accent), transparent 60%), var(--bg-0);
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 18px var(--glow-accent)); transform: scale(1); }
  50%      { filter: drop-shadow(0 0 34px var(--glow-accent)); transform: scale(1.04); }
}

/* ── Karten: flache "raised"-Fläche, weiche Einblend-Animation ──── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  animation: card-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.card:hover { border-color: var(--border-bright); }
.card-header { background: transparent; }
.card-header h3 svg { color: var(--accent-2); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }
/* Karten mit Dropdowns dürfen nicht durch die Animation (transform) neue Stacking-Kontexte klemmen */
.ar-module { animation: none; }

.stat-card { background: var(--bg-2); }
.stat-card:hover { border-color: rgb(var(--c-brand) / 0.45); box-shadow: 0 0 16px var(--glow-accent); }
.stat-icon { background: var(--accent-dim); border-color: rgb(var(--c-brand) / 0.25); color: var(--accent-2); }
.guild-card:hover { border-color: var(--accent); box-shadow: 0 0 22px var(--glow-accent); }
.guild-icon-placeholder, .lb-bar, .bar-chart-fill, .tab-indicator { background: var(--accent); }
.channel-select-item.selected { box-shadow: inset 0 0 0 1px rgb(var(--c-brand) / 0.35); }

/* ── Buttons: flache Akzentfarbe + Glow statt Verlauf ─────────── */
.btn-primary { background: var(--accent); color: var(--on-brand-color); box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-brand-color); box-shadow: 0 0 16px var(--glow-accent); }
.btn-primary::after { display: none; }
.btn-danger { background: rgb(237 66 69 / 0.15); color: #f87171; border-color: transparent; }
.btn-danger:hover { background: #ed4245; color: #fff; }

/* Aktive Auswahl-Pillen/Tabs */
.pill-filter button.active,
.sub-nav button.active,
.tab-btn.active,
.wc-tabs button.active {
  background: var(--accent);
  color: var(--on-brand-color);
  box-shadow: 0 0 14px var(--glow-accent);
}
.switch input:checked + .switch-track { background: var(--accent); box-shadow: 0 0 10px var(--glow-accent); }
.wk-dot.on { background: var(--accent-2); box-shadow: 0 0 6px var(--glow-accent); }
.wk-info { border-color: rgb(var(--c-brand) / 0.25); }
.theme-toggle-dot { background: var(--accent); }

/* Eingabefelder */
.form-input, .form-select { background: var(--bg-1); border-color: var(--border); }
.form-input:focus, .form-select:focus { border-color: var(--accent); box-shadow: var(--glow); }

/* ── Sidebar: flache Fläche, Akzent-Leiste links statt Farbblock ─ */
.sidebar {
  background: var(--bg-2);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
[data-theme="light"] .sidebar { background: #fff !important; }
.sidebar-brand strong, .brand-text {
  background-image: linear-gradient(135deg, rgb(var(--c-brand)), rgb(var(--c-accent)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sidebar-bot-avatar { box-shadow: 0 4px 14px var(--glow-accent); }
.side-indicator { display: none; }
.side-link { font-weight: 600; color: var(--text-dim); }
.side-link::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 3px; height: 60%; border-radius: 999px; background: var(--accent-2);
  transform: translateY(-50%) scaleY(0); transition: transform 0.2s ease;
}
.side-link:hover { background: var(--bg-3); color: var(--text); transform: translateX(2px); }
.side-link.active {
  background: rgb(var(--c-brand) / 0.10);
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgb(var(--c-brand) / 0.16), 0 0 14px var(--glow-accent);
}
.side-link.active::before { transform: translateY(-50%) scaleY(1); }
.side-group-label {
  font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); padding: 14px 12px 4px;
}
.side-group-label:first-of-type { padding-top: 2px; }

.topbar { background: rgb(var(--c-sunken) / 0.8); }
[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.8); }

/* ── Theme-Umschalter: kleiner Button, Farbpunkte klappen erst beim Klick auf ── */
.theme-switcher { position: relative; }
.ts-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font: inherit; font-size: 0.78rem; text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ts-toggle:hover, .theme-switcher.open .ts-toggle { color: var(--text); border-color: var(--accent); background: rgb(var(--c-accent) / 0.08); }
.ts-toggle-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px var(--glow-accent); }
.ts-toggle-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-toggle-label b { color: var(--text); font-weight: 600; }
.ts-toggle-caret { font-size: 0.7rem; transition: transform 0.15s ease; }
.theme-switcher.open .ts-toggle-caret { transform: rotate(180deg); }
.theme-popover {
  display: none; position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 60;
  flex-direction: column; gap: 7px; padding: 10px 12px; min-width: 200px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.theme-switcher.open .theme-popover { display: flex; }
.theme-switcher-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.theme-switcher-head span:last-child { text-transform: none; letter-spacing: 0; color: var(--accent-2); font-weight: 600; }
.theme-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-swatch {
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid transparent; transition: transform 0.15s ease, border-color 0.15s ease;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active { border-color: var(--text); box-shadow: 0 0 10px var(--glow-accent); }
/* Login-Seite: kleiner Button oben rechts, Auswahl klappt nach unten auf */
.theme-switcher.floating { position: fixed; top: 16px; right: 16px; z-index: 50; }
.theme-switcher.floating .ts-toggle { width: auto; background: var(--bg-2); }
.theme-switcher.floating .theme-popover { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; width: 220px; }

/* ═══════════════════════════════════════════════════════════════
   Support · AutoMod · Aktivität
   ═══════════════════════════════════════════════════════════════ */
.save-bar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; margin-top: 20px; z-index: 20; pointer-events: none; }
.save-bar .btn { pointer-events: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 16px var(--glow-accent); }
.chip-avatar { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }

/* Kopfbereich mit Status + Kennzahlen */
.sup-hero { padding: 20px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 18px; }
.sup-hero-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sup-status { display: flex; align-items: center; gap: 14px; }
.sup-status strong { display: block; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.3px; }
.sup-status small { font-size: 0.76rem; color: var(--text-muted); }
.sup-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.sup-status.open .sup-dot { background: #57f287; box-shadow: 0 0 0 5px rgba(87,242,135,0.15), 0 0 18px #57f287; animation: dotPulse 2s ease-in-out infinite; }
.sup-status.closed .sup-dot { background: #ed4245; box-shadow: 0 0 0 5px rgba(237,66,69,0.15); }
.sup-status.open strong { color: #57f287; }
.sup-status.closed strong { color: #f87171; }
.sup-override { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sup-override-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.sup-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.sup-kpi { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.sup-kpi span { display: block; font-size: 1.45rem; font-weight: 800; color: var(--accent-2); line-height: 1.1; }
.sup-kpi label { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

.sup-queue-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--border); margin-bottom: 6px; }
.sup-queue-row.long { border-color: rgba(237,66,69,0.5); box-shadow: 0 0 12px rgba(237,66,69,0.15); }
.sup-queue-row img, .sup-ava { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-3); flex-shrink: 0; }
.sup-queue-row strong { flex: 1; min-width: 0; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-pos { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; background: var(--accent-dim); color: var(--accent-2); flex-shrink: 0; }
.sup-wait { font-size: 0.76rem; font-weight: 700; color: var(--text-dim); }
.sup-queue-row.long .sup-wait { color: #f87171; }
.sup-recent-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sup-recent-row:last-child { border-bottom: none; }
.sup-recent-row div { flex: 1; min-width: 0; }
.sup-recent-row strong { display: block; font-size: 0.82rem; }
.sup-recent-row small { font-size: 0.72rem; color: var(--text-muted); }

.sup-day { display: grid; grid-template-columns: 100px auto 1fr 14px 1fr; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.sup-day:last-child { border-bottom: none; }
.sup-day strong { font-size: 0.84rem; }
.sup-day.closed strong { color: var(--text-muted); }
.sup-day .form-input { padding: 7px 10px; }
.sup-day .form-input:disabled, .sup-special-row .form-input:disabled { opacity: 0.35; }
.sup-dash { text-align: center; color: var(--text-muted); }
.sup-special-row { display: grid; grid-template-columns: 140px 130px 100px 100px 1fr auto; gap: 6px; margin-bottom: 8px; align-items: center; }
.sup-special-row .form-input, .sup-special-row .form-select { padding: 7px 8px; font-size: 0.78rem; }
@media (max-width: 700px) {
  .sup-special-row { grid-template-columns: 1fr 1fr; }
  .sup-day { grid-template-columns: 1fr auto; }
  .sup-day .form-input, .sup-dash { grid-column: span 1; }
}

/* AutoMod */
.am-title { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 260px; }
.am-title h3 { font-size: 1.2rem; font-weight: 800; }
.am-shield { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-dim); color: var(--accent-2); flex-shrink: 0; box-shadow: 0 0 18px var(--glow-accent); }
.am-shield svg { width: 26px; height: 26px; }
.am-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-bottom: 20px; align-items: start; }
.am-rule { padding: 16px; transition: border-color var(--transition), box-shadow var(--transition); }
.am-rule.on { border-color: rgb(var(--c-brand) / 0.45); box-shadow: 0 0 14px rgb(var(--c-brand) / 0.15); }
.am-rule-head { display: flex; align-items: center; gap: 12px; }
.am-rule-head div { flex: 1; min-width: 0; }
.am-rule-head strong { display: block; font-size: 0.9rem; }
.am-rule-head small { font-size: 0.73rem; color: var(--text-muted); }
.am-rule-icon { font-size: 1.35rem; width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-1); border: 1px solid var(--border); flex-shrink: 0; }
.am-rule-body { display: none; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.am-rule.on .am-rule-body { display: grid; }
.am-rule-body .form-group { margin-bottom: 8px; }
.am-num { display: flex; align-items: center; gap: 8px; }
.am-num .form-input { width: 84px; flex-shrink: 0; }
.am-num span { font-size: 0.74rem; color: var(--text-muted); }
.am-log-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.am-log-row:last-child { border-bottom: none; }
.am-log-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.am-log-top strong { font-size: 0.82rem; }
.am-log-row small { font-size: 0.73rem; color: var(--text-muted); }
.am-badge { font-size: 0.64rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--bg-3); color: var(--text-dim); }
.am-badge.timeout { background: rgba(254,231,92,0.12); color: #fee75c; }
.am-badge.kick { background: rgba(237,66,69,0.14); color: #f87171; }
.am-excerpt { margin-top: 6px; font-size: 0.74rem; color: var(--text-dim); background: var(--bg-1); border-left: 3px solid var(--border-bright); border-radius: 4px; padding: 6px 9px; white-space: pre-wrap; word-break: break-word; }

/* Aktivität */
.act-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .act-layout { grid-template-columns: 1fr; } }
.act-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.act-filters button { font-family: var(--font); font-size: 0.74rem; font-weight: 600; color: var(--text-dim); background: var(--bg-1); border: 1px solid var(--border); border-radius: 20px; padding: 5px 11px; cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 5px; }
.act-filters button:hover { border-color: var(--border-bright); color: var(--text); }
.act-filters button.active { background: var(--accent); border-color: transparent; color: var(--on-brand-color); box-shadow: 0 0 12px var(--glow-accent); }
.act-count { font-size: 0.62rem; font-weight: 800; background: rgba(0,0,0,0.25); border-radius: 10px; padding: 0 6px; }
.act-feed { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.act-item { display: flex; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--border); border-left: 3px solid var(--cat); animation: fadeIn 0.2s ease; }
.act-icon { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-3); flex-shrink: 0; font-size: 0.95rem; }
.act-body { flex: 1; min-width: 0; }
.act-msg { font-size: 0.82rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.act-msg a { color: var(--accent-2); }
.act-body small { font-size: 0.7rem; color: var(--text-muted); }
.act-quote { display: block; margin-top: 4px; padding: 4px 10px; border-left: 3px solid var(--border-bright); color: var(--text-dim); }
.log-cat { padding: 10px 0; border-bottom: 1px solid var(--border); }
.log-cat:last-of-type { border-bottom: none; }
.log-cat.off .log-cat-head strong { color: var(--text-muted); }
.log-cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.log-cat-head div { flex: 1; min-width: 0; }
.log-cat-head strong { display: block; font-size: 0.84rem; }
.log-cat-head small { font-size: 0.7rem; color: var(--text-muted); }
.log-cat .form-select { padding: 7px 10px; font-size: 0.78rem; }
.log-cat .form-select:disabled { opacity: 0.4; }

/* ═══════════════════════════════════════════════════════════════
   Tickets · Rollen · Channels
   ═══════════════════════════════════════════════════════════════ */
.tk-empty { height: 100%; min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); text-align: center; padding: 30px; }
.tk-empty span { font-size: 2.6rem; opacity: 0.6; }
.tk-empty p { font-size: 0.85rem; max-width: 300px; }

/* Ticket-Liste + Detail */
.tk-layout { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .tk-layout { grid-template-columns: 1fr; } }
.tk-list-card { padding: 14px; position: sticky; top: 90px; }
.tk-list-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.tk-list-head .pill-filter { width: 100%; }
.tk-list-head .pill-filter button { flex: 1; }
.tk-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 330px); min-height: 200px; overflow-y: auto; padding-right: 2px; }
.tk-row { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-1); color: var(--text); font-family: var(--font); cursor: pointer; transition: all var(--transition); }
.tk-row:hover { border-color: var(--border-bright); background: var(--bg-3); }
.tk-row.active { border-color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 12px var(--glow-accent); }
.tk-row.closed { opacity: 0.75; }
.tk-row img, .tk-row .sup-ava { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.tk-row-main { flex: 1; min-width: 0; }
.tk-row-top { display: flex; align-items: baseline; gap: 6px; font-size: 0.8rem; }
.tk-row-top strong { color: var(--accent-2); }
.tk-row-top span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.tk-row-top small { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }
.tk-row-sub { font-size: 0.78rem; font-weight: 600; margin: 2px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 0.68rem; color: var(--text-muted); }
.tk-dot { width: 7px; height: 7px; border-radius: 50%; background: #ed4245; }
.tk-dot.open { background: #57f287; box-shadow: 0 0 6px #57f287; }

.tk-detail { padding: 18px; min-height: 520px; display: flex; flex-direction: column; }
.tk-d-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tk-d-title h3 { font-size: 1.15rem; font-weight: 800; }
.tk-d-title small { font-size: 0.74rem; color: var(--text-muted); }
.tk-status { font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.tk-status.open { background: rgba(87,242,135,0.12); color: #57f287; }
.tk-status.closed { background: rgba(237,66,69,0.12); color: #f87171; }
.tk-d-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tk-d-meta span { font-size: 0.74rem; color: var(--text-dim); background: var(--bg-1); border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; }
.tk-d-meta b { color: var(--text); }
.tk-d-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tk-subject { background: var(--bg-1); border-left: 3px solid var(--accent); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.tk-subject label, .tk-parts-row > label { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.tk-subject p { font-size: 0.84rem; white-space: pre-wrap; margin-top: 4px; }
.tk-parts-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tk-parts { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.tk-add-user .form-select { padding: 6px 10px; font-size: 0.76rem; width: auto; max-width: 220px; }
.tk-chat { flex: 1; min-height: 260px; max-height: 52vh; overflow-y: auto; background: #313338; border-radius: var(--radius-sm); padding: 12px 0; }
[data-theme="light"] .tk-chat { background: #f2f3f5; }
.tk-msg { display: flex; gap: 12px; padding: 4px 16px; }
.tk-msg:hover { background: rgba(0,0,0,0.08); }
.tk-msg.grouped { padding-top: 0; }
.tk-av { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }
.tk-av-space { width: 36px; flex-shrink: 0; }
.tk-msg-body { flex: 1; min-width: 0; }
.tk-msg-head { display: flex; align-items: baseline; gap: 6px; }
.tk-msg-head strong { font-size: 0.86rem; color: #f2f3f5; }
.tk-msg-head strong.staff { color: #80a4ff; }
[data-theme="light"] .tk-msg-head strong { color: #060607; }
.tk-msg-head small { font-size: 0.68rem; color: #949ba4; }
.tk-msg-text { font-size: 0.84rem; color: #dbdee1; white-space: pre-wrap; word-break: break-word; }
[data-theme="light"] .tk-msg-text { color: #313338; }
.tk-sys { margin: 6px 16px; padding: 8px 12px; border-left: 3px solid var(--accent); background: rgba(0,0,0,0.15); border-radius: 4px; font-size: 0.78rem; color: #b5bac1; white-space: pre-wrap; }
.tk-sys small { display: block; font-size: 0.66rem; color: #6d6f78; margin-top: 2px; }
.tk-att { display: inline-block; margin-top: 4px; font-size: 0.76rem; color: #00a8fc; }
.tk-att-img { display: block; max-width: 280px; max-height: 200px; border-radius: 6px; margin-top: 4px; }
.tk-reply { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.tk-reply textarea { flex: 1; resize: vertical; min-height: 44px; }

/* Ticket-Kategorien */
.tk-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; margin-bottom: 8px; }
@media (max-width: 600px) { .tk-cat-grid { grid-template-columns: 1fr; } }
.tk-cat { padding: 16px; }
.tk-cat-head { display: flex; gap: 8px; margin-bottom: 12px; }
.tk-cat-head .form-input { font-weight: 700; font-size: 0.95rem; }
.tk-cat-emoji { width: 56px !important; flex: 0 0 56px; text-align: center; font-size: 1.1rem !important; }
.tk-cat-opts { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 10px; }
.tk-max { width: 64px !important; display: inline-block; padding: 4px 8px !important; margin: 0 4px; }
.tk-cat-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 12px; }
/* Panel-Vorschau */
.tk-pv-select { margin-top: 8px; max-width: 440px; background: #1e1f22; border-radius: 4px; padding: 9px 12px; font-size: 0.8rem; color: #949ba4; display: flex; justify-content: space-between; }
.tk-pv-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; max-width: 440px; }
.tk-pv-btn { background: #4e5058; color: #fff; font-size: 0.78rem; font-weight: 600; padding: 7px 14px; border-radius: 4px; }
.tk-pv-btn.primary { background: #5865f2; }

/* Rollen / Channels: Liste + Editor */
.mg-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; padding-bottom: 70px; }
@media (max-width: 1000px) { .mg-layout { grid-template-columns: 1fr; } }
.mg-side { padding: 14px; position: sticky; top: 90px; }
.mg-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mg-side-head h3 { font-size: 0.95rem; font-weight: 800; }
.mg-hint { font-size: 0.68rem; color: var(--text-muted); margin: 6px 2px; }
.mg-list { max-height: calc(100vh - 290px); overflow-y: auto; display: flex; flex-direction: column; gap: 1px; margin-top: 8px; }
.mg-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 0.83rem; font-weight: 600; color: var(--text-dim); transition: background var(--transition), color var(--transition); position: relative; }
.mg-item:hover { background: var(--bg-3); color: var(--text); }
.mg-item.active { background: rgb(var(--c-brand) / 0.14); color: var(--text); box-shadow: inset 3px 0 0 var(--accent-2); }
.mg-item.dragging { opacity: 0.4; }
.mg-item.drop-above { box-shadow: inset 0 2px 0 var(--accent-2); }
.mg-item.drop-below { box-shadow: inset 0 -2px 0 var(--accent-2); }
.mg-grip { width: 12px; color: var(--text-muted); cursor: grab; font-size: 0.8rem; }
.mg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-badge { font-size: 0.72rem; }
.mg-count { font-size: 0.7rem; color: var(--text-muted); background: var(--bg-1); border-radius: 10px; padding: 1px 7px; }
.mg-editor { padding: 20px; min-height: 480px; }
.mg-ed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.mg-ed-head h3 { font-size: 1.1rem; font-weight: 800; }
.mg-ed-head small { font-size: 0.74rem; color: var(--text-muted); }
.mg-ed-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 10px currentColor; }
.ch-ed-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 800; color: var(--text-dim); }
.mg-lock { background: rgba(250,166,26,0.10); border: 1px solid rgba(250,166,26,0.3); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.8rem; margin-bottom: 14px; }
.mg-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.mg-tabs button { background: none; border: none; font-family: var(--font); font-size: 0.84rem; font-weight: 600; color: var(--text-muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--transition); }
.mg-tabs button:hover { color: var(--text); }
.mg-tabs button.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.mg-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.mg-toggle-row strong { display: block; font-size: 0.86rem; }
.mg-toggle-row small { display: block; font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.mg-toggle-row small.warn { color: var(--yellow); }
.mg-toggle-row.danger strong { color: #f87171; }
.mg-perm-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.mg-perm-group { margin-top: 14px; }
.mg-perm-group h4 { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding-bottom: 4px; }
.mg-member { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; }
.mg-member:hover { background: var(--bg-3); }
.mg-member img { width: 32px; height: 32px; border-radius: 50%; }
.mg-member div { flex: 1; min-width: 0; }
.mg-member strong { display: block; font-size: 0.84rem; }
.mg-member small { font-size: 0.72rem; color: var(--text-muted); }
.req { color: #f87171; }
.rl-colors { display: flex; gap: 10px; align-items: flex-start; }
.rl-color-big { width: 64px; height: 50px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; position: relative; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.rl-color-big.active { border-color: var(--text); }
.rl-color-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rl-swatches { display: grid; grid-template-columns: repeat(10, 22px); gap: 6px; }
.rl-swatches button { width: 22px; height: 22px; border-radius: 5px; border: 2px solid transparent; cursor: pointer; transition: transform 0.12s ease; }
.rl-swatches button:hover { transform: scale(1.12); }
.rl-swatches button.active { border-color: var(--text); }
@media (max-width: 600px) { .rl-swatches { grid-template-columns: repeat(5, 22px); } }

/* "Ungespeicherte Änderungen"-Leiste wie im Discord */
.mg-savebar { position: fixed; left: calc(252px + 50%); transform: translate(-50%, 140%); bottom: 20px; z-index: 70; display: flex; align-items: center; gap: 12px;
  background: #111214; color: #fff; border-radius: 10px; padding: 10px 12px 10px 18px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); font-size: 0.86rem; font-weight: 600;
  transition: transform 0.25s cubic-bezier(0.2,0.8,0.3,1.2); width: min(720px, calc(100vw - 300px)); }
.mg-savebar span { flex: 1; }
.mg-savebar.show { transform: translate(-50%, 0); }
@media (max-width: 900px) { .mg-savebar { left: 50%; width: calc(100vw - 32px); } }

/* Channel-Baum */
.ch-cat { display: flex; align-items: center; gap: 2px; margin-top: 12px; padding: 2px 4px; border-radius: 4px; }
.ch-cat.active { background: rgb(var(--c-brand) / 0.14); }
.ch-cat-toggle, .ch-cat-add { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; padding: 2px 4px; }
.ch-cat-add { font-size: 1rem; opacity: 0; transition: opacity var(--transition); }
.ch-cat:hover .ch-cat-add { opacity: 1; }
.ch-cat-name { flex: 1; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; color: var(--text-muted); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-cat-name:hover { color: var(--text); }
.ch-kids { padding-left: 8px; display: flex; flex-direction: column; gap: 1px; }
.ch-icon { width: 18px; text-align: center; color: var(--text-muted); font-weight: 800; }
.ch-sync { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(250,166,26,0.10); border: 1px solid rgba(250,166,26,0.3); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.8rem; margin-bottom: 14px; }
.ch-sync.ok { background: rgba(87,242,135,0.08); border-color: rgba(87,242,135,0.3); }
.ch-perm-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
@media (max-width: 800px) { .ch-perm-layout { grid-template-columns: 1fr; } }
.ch-targets { display: flex; flex-direction: column; gap: 2px; }
.ch-target { display: flex; align-items: center; gap: 8px; text-align: left; background: none; border: none; border-radius: 6px; padding: 7px 8px; font-family: var(--font); font-size: 0.8rem; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.ch-target span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-target:hover { background: var(--bg-3); color: var(--text); }
.ch-target.active { background: rgb(var(--c-brand) / 0.14); color: var(--text); }
.ch-add-target { margin-top: 8px; padding: 7px 10px; font-size: 0.78rem; }
.ch-perm-legend { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.84rem; padding-bottom: 6px; }
.tri { display: inline-flex; border: 1px solid var(--border-bright); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.tri button { width: 32px; height: 28px; border: none; background: var(--bg-1); color: var(--text-muted); cursor: pointer; font-weight: 800; font-size: 0.85rem; transition: all 0.12s ease; }
.tri button + button { border-left: 1px solid var(--border); }
.tri button:hover { color: var(--text); }
.tri .deny.on { background: #ed4245; color: #fff; }
.tri .neutral.on { background: var(--bg-4); color: var(--text); }
.tri .allow.on { background: #3ba55d; color: #fff; }
.tri.disabled { opacity: 0.5; pointer-events: none; }
.ch-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ch-type-grid button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--bg-1); color: var(--text-dim); font-family: var(--font); font-size: 0.76rem; font-weight: 600; cursor: pointer; }
.ch-type-grid button span { font-size: 1.2rem; font-weight: 800; }
.ch-type-grid button.active { border-color: var(--accent); background: var(--accent-dim); color: var(--text); }

/* Ticket-Chat im Panel: WhatsApp-Look (wie das Transkript) */
.tk-chat { background: #0b141a; padding: 12px 14px; }
[data-theme="light"] .tk-chat { background: #efeae2; }
.wa-day { display: flex; justify-content: center; margin: 10px 0 6px; position: sticky; top: -12px; z-index: 1; }
.wa-day span, .wa-sys > span { background: #182229; color: #8696a0; font-size: 0.72rem; padding: 4px 11px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-day span { text-transform: uppercase; }
.wa-sys { display: flex; justify-content: center; margin: 6px 0; }
.wa-sys > span { max-width: 80%; text-align: center; white-space: pre-wrap; }
.wa-sys small { display: block; font-size: 0.64rem; opacity: .7; }
.wa-row { display: flex; align-items: flex-start; gap: 7px; margin: 2px 0; }
.wa-row.first { margin-top: 9px; }
.wa-row.out { flex-direction: row-reverse; }
.wa-av, .wa-av-space { width: 30px; height: 30px; flex-shrink: 0; }
.wa-av { border-radius: 50%; object-fit: cover; }
.wa-bubble { position: relative; max-width: 70%; min-width: 80px; background: #202c33; color: #e9edef; border-radius: 8px; padding: 5px 8px 7px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-row.out .wa-bubble { background: #005c4b; }
.wa-row.first.in .wa-bubble { border-top-left-radius: 0; }
.wa-row.first.out .wa-bubble { border-top-right-radius: 0; }
.wa-row.first .wa-bubble::before { content: ''; position: absolute; top: 0; width: 8px; height: 12px; }
.wa-row.first.in .wa-bubble::before { left: -8px; background: #202c33; clip-path: polygon(100% 0, 0 0, 100% 100%); }
.wa-row.first.out .wa-bubble::before { right: -8px; background: #005c4b; clip-path: polygon(0 0, 100% 0, 0 100%); }
.wa-name { font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 1px; }
.wa-name span { font-size: 0.62rem; color: #8696a0; background: rgba(134,150,160,.16); padding: 1px 6px; border-radius: 6px; }
.wa-text { font-size: 0.85rem; white-space: pre-wrap; word-break: break-word; padding-right: 58px; }
.wa-row.out .wa-text { padding-right: 74px; }
.wa-meta { position: absolute; right: 7px; bottom: 4px; display: flex; align-items: center; gap: 3px; font-size: 0.66rem; color: #8696a0; }
.wa-ticks { fill: #53bdeb; }
.wa-img img { display: block; max-width: 100%; max-height: 260px; border-radius: 6px; margin: 2px 0 4px; }
.wa-file { display: block; background: rgba(0,0,0,.18); border-radius: 6px; padding: 8px 10px; margin: 2px 0 4px; color: inherit; text-decoration: none; font-size: 0.8rem; }
[data-theme="light"] .wa-bubble, [data-theme="light"] .wa-row.first.in .wa-bubble::before { background: #fff; color: #111b21; }
[data-theme="light"] .wa-row.out .wa-bubble, [data-theme="light"] .wa-row.first.out .wa-bubble::before { background: #d9fdd3; }
[data-theme="light"] .wa-day span, [data-theme="light"] .wa-sys > span { background: #fff; color: #54656f; }
/* Antwortleiste im WhatsApp-Stil, direkt unter dem Chat */
.tk-chat { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tk-reply { margin-top: 0; display: flex; align-items: flex-end; gap: 8px; background: #202c33; padding: 8px 10px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.tk-reply textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; border: none; outline: none; border-radius: 20px; padding: 10px 16px; background: #2a3942; color: #e9edef; font: 0.88rem/1.35 var(--font); }
.tk-reply textarea::placeholder { color: #8696a0; }
.wa-send { width: 42px; height: 42px; flex-shrink: 0; border: none; border-radius: 50%; background: #00a884; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .12s ease, background .12s ease; }
.wa-send:hover { background: #06cf9c; transform: scale(1.06); }
[data-theme="light"] .tk-reply { background: #f0f2f5; }
[data-theme="light"] .tk-reply textarea { background: #fff; color: #111b21; }

/* Ersatzschriften fürs Willkommensbild (Schnörkel-Namen, Symbole) — gleiche Dateien wie auf dem Server */
@font-face { font-family: 'Noto Sans Math'; src: url('/card-fonts/NotoSansMath.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Noto Sans Symbols 2'; src: url('/card-fonts/NotoSansSymbols2.ttf') format('truetype'); font-display: swap; }

/* Channels: Drag & Drop */
.ch-cat.dragging, .ch-item.dragging { opacity: 0.4; }
.ch-cat.drop-above { box-shadow: inset 0 2px 0 var(--accent-2); }
.ch-cat.drop-below { box-shadow: inset 0 -2px 0 var(--accent-2); }
.ch-cat.drop-into { background: rgb(var(--c-brand) / 0.18); box-shadow: inset 0 0 0 1px var(--accent-2); }
.ch-cat[draggable="true"] { cursor: grab; }
.ch-item .mg-grip { width: 10px; }

/* Mitglieder */
.mb-item { padding: 6px 8px; }
.mb-av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.mb-names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.mb-names small { font-size: 0.68rem; color: var(--text-muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.mb-head img { width: 64px; height: 64px; border-radius: 50%; box-shadow: 0 0 16px var(--glow-accent); }
.mb-head h3 { font-size: 1.2rem; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.mb-head small { font-size: 0.74rem; color: var(--text-muted); }
.mb-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.mb-role { border-color: color-mix(in srgb, var(--rc) 45%, transparent); }
.mb-add-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.mb-add { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 6px; border: 1px dashed var(--border-bright); background: var(--bg-1); color: var(--text-dim); font-family: var(--font); font-size: 0.76rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
.mb-add span:last-child { color: var(--accent-2); font-weight: 800; }
.mb-add:hover { border-color: var(--accent); border-style: solid; color: var(--text); background: var(--accent-dim); }

/* Benutzer & Zugriff */
.ac-badge { font-size: 0.64rem; font-weight: 800; padding: 1px 7px; border-radius: 10px; background: var(--accent-dim); color: var(--accent-2); }
.ac-badge.full { background: rgba(250,166,26,0.15); color: var(--gold); }
.ac-seg { display: inline-flex; border: 1px solid var(--border-bright); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.ac-seg button { border: none; background: var(--bg-1); color: var(--text-muted); font-family: var(--font); font-size: 0.72rem; font-weight: 700; padding: 6px 10px; cursor: pointer; transition: all .12s ease; white-space: nowrap; }
.ac-seg button + button { border-left: 1px solid var(--border); }
.ac-seg button:hover { color: var(--text); }
.ac-seg .none.on { background: var(--bg-4); color: var(--text); }
.ac-seg .view.on { background: #3b82f6; color: #fff; }
.ac-seg .edit.on { background: #3ba55d; color: #fff; }
.ac-seg.disabled { opacity: .55; pointer-events: none; }
.ac-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.ac-people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ac-user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.ac-user { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--border); }
.ac-user img { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.ac-user-main { min-width: 0; flex: 1; }
.ac-user-main strong { display: block; font-size: 0.86rem; }
.ac-user-main > small { font-size: 0.72rem; color: var(--text-muted); }
.ac-user-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ac-lvl { font-size: 0.66rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.ac-lvl.view { background: rgba(59,130,246,.15); color: #7fb0ff; }
.ac-lvl.edit { background: rgba(59,165,93,.15); color: #6fdc8c; }
.ac-via { display: block; margin-top: 4px; font-size: 0.68rem; color: var(--text-muted); }
/* Bereiche mit Stufe "Ansehen" */
.view-only-banner { margin-bottom: 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.35); font-size: 0.84rem; }
.view-only .btn-primary, .view-only .btn-danger, .view-only .save-bar, .view-only .mg-savebar, .view-only .tk-reply,
.view-only .ar-chip-x, .view-only .mb-add-list, .view-only .ch-cat-add, .view-only .mg-grip { display: none !important; }
.view-only .switch, .view-only .tri, .view-only .ac-seg { pointer-events: none; opacity: .6; }

/* hidden-Attribut muss immer gewinnen (sonst überschreibt z.B. display:grid es) */
[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   Login-Seite
   ═══════════════════════════════════════════════════════════════ */
.lg-body { display: block; min-height: 100vh; }
.lg-shell { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 70px 28px 40px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 420px); gap: 48px; align-items: center; min-height: 100vh; }
@media (max-width: 980px) { .lg-shell { grid-template-columns: 1fr; gap: 30px; padding-top: 80px; } .lg-login { order: -1; } }

/* Bot-Kopf */
.lg-bot { display: flex; align-items: center; gap: 22px; margin-bottom: 26px; }
.lg-bot h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.8px; line-height: 1.1;
  background-image: linear-gradient(135deg, var(--text) 30%, rgb(var(--c-accent))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-tagline { margin-top: 8px; color: var(--text-dim); font-size: 1rem; line-height: 1.55; max-width: 520px; }
.lg-avatar-ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; border-radius: 50%; padding: 4px;
  background: conic-gradient(from 0deg, rgb(var(--c-brand)), rgb(var(--c-accent)), var(--glow-secondary), rgb(var(--c-brand)));
  animation: lgSpin 8s linear infinite; box-shadow: 0 0 40px var(--glow-accent); }
.lg-avatar { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg-0); animation: lgSpin 8s linear infinite reverse; background: var(--bg-2); }
.lg-avatar-fallback { display: flex; align-items: center; justify-content: center; font-size: 2.6rem; }
.lg-status { position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; background: #747f8d; border: 4px solid var(--bg-0); animation: lgSpin 8s linear infinite reverse; }
.lg-status.on { background: #23a55a; box-shadow: 0 0 10px #23a55a; }
@keyframes lgSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lg-avatar-ring, .lg-avatar, .lg-status { animation: none; } }

/* Zahlen */
.lg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 30px; max-width: 620px; }
.lg-stats div { background: rgb(var(--c-raised) / 0.7); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; backdrop-filter: blur(6px); }
.lg-stats strong { display: block; font-size: 1.4rem; font-weight: 800; color: var(--accent-2); line-height: 1.1; }
.lg-stats span { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
@media (max-width: 560px) { .lg-stats { grid-template-columns: repeat(2, 1fr); } .lg-bot { flex-direction: column; text-align: center; } .lg-bot h1 { font-size: 1.9rem; } }

/* Funktionen */
.lg-section-title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 12px; }
.lg-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.lg-feature { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--radius-sm);
  background: rgb(var(--c-raised) / 0.65); border: 1px solid var(--border); backdrop-filter: blur(6px);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }
.lg-feature:hover { transform: translateY(-2px); border-color: rgb(var(--c-brand) / 0.5); box-shadow: 0 0 18px var(--glow-accent); }
.lg-feature > span { font-size: 1.3rem; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-dim); }
.lg-feature strong { display: block; font-size: 0.86rem; margin-bottom: 2px; }
.lg-feature p { font-size: 0.74rem; color: var(--text-muted); line-height: 1.45; }

/* Login-Karte */
.lg-card { padding: 34px 30px 26px; text-align: center; border-radius: 20px; background: rgb(var(--c-raised) / 0.85); backdrop-filter: blur(14px);
  border: 1px solid rgb(var(--c-brand) / 0.25); box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 50px rgb(var(--c-brand) / 0.12); }
.lg-card-avatar { width: 64px; height: 64px; margin: 0 auto 14px; }
.lg-card-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid rgb(var(--c-brand) / 0.6); box-shadow: 0 0 20px var(--glow-accent); }
.lg-card h2 { font-size: 1.35rem; font-weight: 800; }
.lg-card-sub { color: var(--text-muted); font-size: 0.84rem; margin: 6px 0 22px; }
.lg-alert { text-align: left; margin-bottom: 16px; }
.lg-discord { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 22px; font-size: 1rem; font-weight: 700; border-radius: 12px;
  background: #5865f2; box-shadow: 0 8px 24px rgba(88,101,242,.45); transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.lg-discord:hover { background: #4752c4; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(88,101,242,.55); color: #fff; }
.lg-howto { text-align: left; margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: var(--bg-1); border: 1px solid var(--border); }
.lg-howto strong { font-size: 0.78rem; }
.lg-howto ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.lg-howto li { display: flex; gap: 10px; font-size: 0.76rem; color: var(--text-dim); line-height: 1.45; }
.lg-howto li b { color: var(--text); font-weight: 600; }
.lg-admin-link { margin-top: 18px; background: none; border: none; color: var(--text-muted); font-family: var(--font); font-size: 0.76rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.lg-admin-link:hover { color: var(--accent-2); }
.lg-admin-link svg { width: 13px; height: 13px; }

/* ── Bot-Profil pro Server (Einstellungen) ─────────────────────── */
.bp-preview { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-3); margin-bottom: 12px; }
.bp-banner { height: 90px; background: linear-gradient(135deg, rgb(var(--c-accent) / 0.55), rgb(var(--c-accent) / 0.15)); background-size: cover; background-position: center; }
.bp-avatar-wrap { position: absolute; top: 48px; left: 16px; width: 78px; height: 78px; border-radius: 50%; padding: 5px; background: var(--bg-3); }
.bp-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.bp-info { padding: 46px 16px 14px; }
.bp-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.bp-bio { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.bp-bio:empty { display: none; }
.bp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.bp-actions .btn { cursor: pointer; }
.bp-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Datenschutz-Reiter ─────────────────────────────────────────── */
.pv-users { font-size: 0.76rem; color: var(--text-muted); background: var(--bg-3); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; }
.pv-users:empty { display: none; }
.pv-rows { display: flex; flex-direction: column; gap: 8px; }
.pv-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.pv-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pv-row-main strong { font-size: 0.86rem; color: var(--text); }
.pv-row-main small { font-size: 0.74rem; color: var(--text-muted); }
.pv-count { font-size: 0.8rem; font-weight: 700; color: var(--accent-2); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.pv-days { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--text-muted); margin: 0; }
.pv-days .form-input { width: 76px; padding: 6px 8px; text-align: right; }
.pv-results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.pv-result { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pv-result:hover { border-color: var(--accent); }
.pv-result img, .pv-user-head img, .pv-noavatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.pv-noavatar { display: inline-flex; align-items: center; justify-content: center; background: var(--bg-3); color: var(--text-muted); }
.pv-result span, .pv-user-head div { display: flex; flex-direction: column; min-width: 0; }
.pv-result small, .pv-user-head small { font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-user { margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.pv-user-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pv-user-head div { flex: 1; }
.pv-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pv-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.82rem; padding: 6px 10px; background: var(--bg-3); border-radius: 6px; }
.pv-list b { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.pv-note { font-size: 0.76rem; color: var(--text-muted); margin: 4px 0; }
.pv-user-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pv-user-actions .btn { flex: 1; justify-content: center; text-decoration: none; }
.pv-user-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 560px) { .pv-row { flex-wrap: wrap; } .pv-row-main { flex-basis: 100%; } }

/* ── Level & Minigames ──────────────────────────────────────────── */
.lv-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.lv-tabs button { font: inherit; font-size: 0.84rem; font-weight: 600; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-2); color: var(--text-muted); cursor: pointer; }
.lv-tabs button.active { color: var(--text); border-color: var(--accent); background: rgb(var(--c-accent) / 0.12); }
.lv-block { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); margin-bottom: 12px; }
.lv-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lv-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lv-grid3 .form-group { margin-bottom: 10px; }
.lv-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lv-row .form-select { flex: 1; min-width: 0; }
.lv-row-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.lv-num { width: 84px !important; flex-shrink: 0; }
.lv-radio { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.lv-color { width: 38px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.lv-card-preview { width: 100%; border-radius: 12px; display: block; background: var(--bg-3); aspect-ratio: 934 / 282; }
.lv-top { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.lv-user { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); overflow: hidden; }
.lv-user.open { border-color: var(--accent); }
.lv-user-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lv-user-row img, .lv-user-row .pv-noavatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.lv-rank { width: 34px; text-align: center; font-weight: 800; font-size: 0.9rem; color: var(--text-muted); flex-shrink: 0; }
.lv-user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lv-user-main small { font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-bar { display: block; height: 6px; border-radius: 3px; background: var(--bg-4, var(--bg-3)); margin-top: 6px; overflow: hidden; }
.lv-bar span { display: block; height: 100%; background: linear-gradient(90deg, rgb(var(--c-accent) / 0.7), rgb(var(--c-accent))); border-radius: 3px; }
.lv-user-lvl { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.lv-user-lvl b { color: var(--accent-2); font-size: 0.86rem; }
.lv-user-lvl small { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lv-user-edit { padding: 0 12px 12px 58px; }
.lv-user-stats { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 8px; }
.lv-user-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lv-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.lv-games .card { margin: 0; }
.lv-state { font-size: 0.8rem; color: var(--text-muted); padding: 8px 10px; background: var(--bg-2); border-radius: 6px; margin-bottom: 10px; }
.lv-state b { color: var(--text); }
.view-only .lv-edit-only { display: none !important; }
@media (max-width: 560px) { .lv-grid3 { grid-template-columns: 1fr 1fr; } .lv-user-edit { padding-left: 12px; } }

/* ── Minigames: Inhalte ─────────────────────────────────────────── */
.gm-content { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.gm-content .wk-check { margin: 0; }
.gm-count { color: var(--text-muted); font-size: 0.78rem; }
.lv-card-preview { cursor: pointer; }
canvas.lv-card-preview { height: auto; }

/* ── Pop-up: Fragen & Wörter ─────────────────────────────────────── */
.ct-box { max-width: 860px; width: 96vw; max-height: 90vh; display: flex; flex-direction: column; }
.ct-scopes { display: flex; gap: 6px; padding: 12px 20px 0; }
.ct-scopes button { font: inherit; font-size: 0.84rem; font-weight: 600; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-2); color: var(--text-muted); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.ct-scopes button.active { color: var(--text); border-color: var(--accent); background: rgb(var(--c-accent) / 0.12); }
.ct-count { font-size: 0.72rem; background: var(--bg-3); border-radius: 10px; padding: 1px 8px; color: var(--text-muted); }
.ct-note { margin: 12px 20px 0; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted); }
.ct-note strong { color: var(--text); }
.ct-toolbar { display: flex; gap: 8px; padding: 12px 20px; flex-wrap: wrap; }
.ct-toolbar #ct-search { flex: 1; min-width: 180px; }
.ct-toolbar .form-select { width: auto; max-width: 200px; }
.ct-import { margin: 0 20px 12px; padding: 12px; border: 1px dashed var(--border-bright, var(--border)); border-radius: var(--radius-sm); background: var(--bg-2); }
.ct-import-row { display: flex; gap: 8px; margin-top: 8px; }
.ct-import-row .form-input { flex: 1; }
.ct-import-ok { margin-top: 10px; font-size: 0.84rem; font-weight: 600; }
.ct-import-errors { margin: 6px 0 0; padding-left: 18px; font-size: 0.76rem; color: var(--text-muted); max-height: 140px; overflow: auto; }
.ct-list { flex: 1; overflow-y: auto; padding: 0 20px; display: flex; flex-direction: column; gap: 6px; min-height: 180px; }
.ct-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.ct-row.off { opacity: 0.55; }
.ct-row .btn-sm { padding: 5px 8px; }
.ct-main { flex: 1; min-width: 0; }
.ct-q { font-weight: 600; font-size: 0.88rem; color: var(--text); margin-bottom: 6px; }
.ct-answers { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ct-answer { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; font-weight: 600; padding: 3px 9px; border-radius: 12px; background: rgba(87, 242, 135, 0.12); color: #57f287; border: 1px solid rgba(87, 242, 135, 0.25); }
.ct-answer button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 0.7rem; opacity: 0.7; }
.ct-cat { font-size: 0.72rem; padding: 2px 8px; border-radius: 10px; background: rgb(var(--c-accent) / 0.14); color: var(--accent-2); }
.ct-hint { font-size: 0.76rem; color: var(--text-muted); }
.ct-word { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.ct-tile { width: 24px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.82rem; border-radius: 5px; background: var(--bg-3); border-bottom: 2px solid var(--accent); color: var(--text); }
.ct-tile.bad { border-bottom-color: #ed4245; color: #ed4245; }
.ct-gap { width: 10px; }
.ct-word-preview { min-height: 30px; align-items: center; }
.ct-bad-note { font-size: 0.74rem; color: #ed4245; margin-left: 8px; }
.ct-form { padding: 14px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-2); display: flex; flex-direction: column; gap: 10px; }
.ct-form-title { font-weight: 700; font-size: 0.86rem; }
.ct-f { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.ct-f small { font-weight: 400; margin-left: 6px; }
.ct-f-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ct-f-row .ct-f { flex: 1; min-width: 180px; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-1); cursor: text; min-height: 40px; }
.ct-chips input { flex: 1; min-width: 160px; border: 0; background: none; color: var(--text); font: inherit; font-size: 0.85rem; outline: none; padding: 4px; }
.ct-form-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.ct-form-err { flex: 1; font-size: 0.78rem; color: #ed4245; }
.ct-footer { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); margin-top: 12px; }
.ct-footer .wk-check { margin: 0; }
.ct-sel { font-size: 0.78rem; color: var(--text-muted); }
.ct-readonly .ct-edit { display: none !important; }

/* ── Pop-up: Rangkarte gestalten ─────────────────────────────────── */
.rc-box { max-width: 1100px; width: 96vw; max-height: 92vh; display: flex; flex-direction: column; }
.rc-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 20px; padding: 20px; overflow-y: auto; }
.rc-canvas { width: 100%; height: auto; display: block; border-radius: 14px; background: repeating-conic-gradient(var(--bg-3) 0% 25%, var(--bg-2) 0% 50%) 50% / 20px 20px; }
.rc-h { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 8px; }
.rc-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.rc-preset { font: inherit; font-size: 0.78rem; font-weight: 700; padding: 12px 10px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform 0.15s ease; }
.rc-preset:hover { transform: translateY(-2px); }
.rc-preset span { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px rgba(0, 0, 0, 0.4); }
.rc-right { display: flex; flex-direction: column; gap: 12px; }
.rc-section { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.rc-seg { display: flex; gap: 4px; background: var(--bg-3); padding: 3px; border-radius: 8px; margin-bottom: 10px; }
.rc-seg button { flex: 1; font: inherit; font-size: 0.78rem; font-weight: 600; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; }
.rc-seg button.active { background: var(--bg-1); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.rc-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc-colors label { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-muted); cursor: pointer; }
.rc-colors input[type="color"] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; flex-shrink: 0; }
.rc-range { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 10px; }
.rc-range input { flex: 1; accent-color: var(--accent); }
.rc-range b { min-width: 44px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.rc-checks { display: flex; flex-direction: column; gap: 2px; }
.rc-checks .wk-check { margin: 0; }
.rc-upload { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rc-upload-name { font-size: 0.76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-footer { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
@media (max-width: 860px) { .rc-body { grid-template-columns: 1fr; } }

/* ── Befehle ─────────────────────────────────────────────────────── */
.cm-group { margin-bottom: 18px; }
.cm-group-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 8px 4px; }
.cm-cmd { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); margin-bottom: 6px; overflow: hidden; }
.cm-cmd.open { border-color: var(--accent); }
.cm-cmd.off .cm-title { opacity: 0.55; }
.cm-head { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; }
.cm-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-title code { font-size: 0.9rem; font-weight: 700; color: var(--text); background: none; padding: 0; }
.cm-title span { font-size: 0.76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.cm-badge { font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: rgb(var(--c-accent) / 0.14); color: var(--accent-2); white-space: nowrap; }
.cm-badge.off { background: rgba(237, 66, 69, 0.15); color: #ed4245; }
.cm-badge.warn { background: rgba(254, 231, 92, 0.12); color: #fee75c; }
.cm-badge.muted { background: var(--bg-3); color: var(--text-muted); }
.cm-badge.lock { background: rgba(87, 242, 135, 0.12); color: #57f287; }
.cm-caret { color: var(--text-muted); font-size: 0.8rem; transition: transform 0.15s ease; }
.cm-cmd.open .cm-caret { transform: rotate(180deg); }
.cm-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.cm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin-top: 10px; }
.cm-cd { display: flex; gap: 6px; }
.cm-cd .form-input { width: 100px; }
.cm-cd .form-select { flex: 1; }
@media (max-width: 760px) { .cm-grid { grid-template-columns: 1fr; } .cm-badges { display: none; } }

/* ── Daten zurücksetzen & Datenschutz bei Mitgliedern ───────────── */
.rs-card { border-color: rgba(237, 66, 69, 0.35); margin-top: 16px; }
.rs-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.rs-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); cursor: pointer; }
.rs-item:has(input:checked) { border-color: #ed4245; background: rgba(237, 66, 69, 0.08); }
.rs-item.locked { opacity: 0.5; cursor: not-allowed; }
.rs-item input { width: 16px; height: 16px; accent-color: #ed4245; flex-shrink: 0; }
.rs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rs-main strong { font-size: 0.85rem; color: var(--text); }
.rs-main small { font-size: 0.74rem; color: var(--text-muted); }
.rs-count { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mb-privacy { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.mb-privacy > label { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.mb-privacy .wk-label-sub { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* Offene Auswahllisten (Rollen/Channels) nicht vom Kartenrand abschneiden lassen */
.card:has(.ar-select.open) { overflow: visible; position: relative; z-index: 30; }

/* ── Befehle: Erklärungen & Zielgruppen ─────────────────────────── */
.cm-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.cm-legend > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.cm-legend p { margin: 6px 0 0; font-size: 0.76rem; color: var(--text-muted); line-height: 1.5; }
.cm-aud { display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.cm-aud.alle { background: rgba(87, 242, 135, 0.13); color: #57f287; }
.cm-aud.team { background: rgba(88, 101, 242, 0.18); color: #9aa4ff; }
.cm-aud.admin { background: rgba(254, 231, 92, 0.14); color: #fee75c; }
.cm-howto { margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); padding: 8px 12px; }
.cm-howto summary { cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--text); }
.cm-howto ul { margin: 8px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.cm-howto strong { color: var(--text); }
.cm-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-filter #cm-search { flex: 1; min-width: 200px; }
.cm-seg { display: flex; gap: 3px; background: var(--bg-3); padding: 3px; border-radius: 8px; }
.cm-seg button { font: inherit; font-size: 0.78rem; font-weight: 600; padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.cm-seg button.active { background: var(--bg-1); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.cm-name { display: flex; align-items: center; gap: 8px; }
.cm-help { margin: 8px 0 4px; }
.cm-sub-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 14px 0 6px; }
.cm-sub-title span { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: 0.8; margin-left: 4px; }
.cm-details { font-size: 0.85rem; line-height: 1.6; color: var(--text); margin: 0; }
.cm-subs { display: flex; flex-direction: column; gap: 6px; }
.cm-subrow { padding: 8px 10px; border-radius: 8px; background: var(--bg-3); }
.cm-subrow > code { font-size: 0.82rem; font-weight: 700; color: var(--accent-2); background: none; padding: 0; margin-right: 8px; }
.cm-subrow p { margin: 4px 0 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.cm-opts { margin: 6px 0 0; padding-left: 16px; font-size: 0.78rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 3px; }
.cm-opts code { font-size: 0.76rem; }
.cm-opts b { color: #fee75c; font-weight: 600; font-size: 0.7rem; }
.cm-opts i { font-size: 0.7rem; }
.cm-example, .cm-note { font-size: 0.8rem; color: var(--text-muted); margin: 8px 0 0; line-height: 1.55; }
.cm-example code { font-size: 0.78rem; }
.cm-note strong { color: var(--text); }
@media (max-width: 760px) { .cm-legend { grid-template-columns: 1fr; } }

/* ── Befehle: Team & Admins ─────────────────────────────────────── */
.cm-ticket-roles { color: var(--text-muted); font-size: 0.78rem; }
.cm-ticket-roles b { color: var(--text); font-weight: 600; }
.cm-recommend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cm-recommend small { flex: 1; min-width: 220px; margin: 0; }
.cm-access { grid-column: 1 / -1; }
.cm-access-seg { flex-wrap: wrap; }
.cm-access-seg button { flex: 1; }
.cm-access small { display: block; margin-top: 6px; }
.cm-badge.team { background: rgba(88, 101, 242, 0.18); color: #9aa4ff; }
.cm-badge.admin { background: rgba(254, 231, 92, 0.14); color: #fee75c; }

/* ── Level-Kurve ─────────────────────────────────────────────────── */
.lv-curve-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lv-curve-presets button { font: inherit; font-size: 0.78rem; font-weight: 600; padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-2); color: var(--text-muted); cursor: pointer; }
.lv-curve-presets button.active { color: var(--text); border-color: var(--accent); background: rgb(var(--c-accent) / 0.12); }
.lv-curve-presets button:disabled { cursor: default; }
.lv-curve-presets button:disabled:not(.active) { opacity: 0.45; }
.lv-curve-hint { min-height: 1.2em; }
.lv-formula { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 10px; }
.lv-formula code { color: var(--accent-2); font-weight: 700; }
.lv-curve-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.lv-curve-table th { text-align: left; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.lv-curve-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text); }
.lv-curve-table tr:last-child td { border-bottom: 0; }
.lv-curve-table td b { color: var(--accent-2); }
.lv-reward-xp { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; min-width: 86px; }
.lv-xp-defaults { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lv-xp-defaults small { font-size: 0.74rem; color: var(--text-muted); }

/* ── Dashboard ──────────────────────────────────────────────────── */
.db-cols { margin-top: 16px; }
.db-info { display: flex; flex-direction: column; }
.db-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.db-row:last-child { border-bottom: 0; }
.db-row-icon { width: 24px; text-align: center; flex-shrink: 0; }
.db-row-label { flex: 1; font-size: 0.84rem; color: var(--text-muted); }
.db-row-value { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.88rem; font-weight: 700; color: var(--text); text-align: right; }
.db-row-value small { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); }
.db-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.db-module { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--text-muted); font: inherit; text-align: left; }
button.db-module { cursor: pointer; transition: border-color 0.15s ease; }
button.db-module:hover { border-color: var(--accent); }
.db-module.on { color: var(--text); }
.db-module-icon { flex-shrink: 0; }
.db-module-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.8rem; font-weight: 600; }
.db-module-name small { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.db-module-state { font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: var(--bg-3); color: var(--text-muted); }
.db-module.on .db-module-state { background: rgba(87, 242, 135, 0.13); color: #57f287; }
.db-perm-summary .db-good { color: #57f287; font-size: 0.8rem; font-weight: 700; }
.db-perm-summary .db-bad { color: #ed4245; font-size: 0.8rem; font-weight: 700; }
.db-perms { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.db-perm { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); }
.db-perm.missing { border-color: rgba(237, 66, 69, 0.45); background: rgba(237, 66, 69, 0.07); }
.db-perm div { display: flex; flex-direction: column; min-width: 0; }
.db-perm strong { font-size: 0.8rem; color: var(--text); }
.db-perm small { font-size: 0.7rem; color: var(--text-muted); }
.db-top { display: flex; flex-direction: column; gap: 6px; }
.db-top-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-2); }
.db-top-row img, .db-top-row .pv-noavatar { width: 32px; height: 32px; border-radius: 50%; }
.db-medal { font-size: 1.2rem; }
.db-top-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-top-lvl { display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; font-size: 0.82rem; color: var(--accent-2); }
.db-top-lvl small { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.db-activity { display: flex; flex-direction: column; }
.db-act { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.db-act:last-child { border-bottom: 0; }
.db-act-text { flex: 1; min-width: 0; color: var(--text); line-height: 1.45; }
.db-act-time { flex-shrink: 0; font-size: 0.72rem; color: var(--text-muted); }
@media (max-width: 560px) { .db-perms { grid-template-columns: 1fr; } }
/* Zweite Kachel-Reihe im Dashboard: 4 Kacheln nebeneinander statt 3 + 1 */
.stats-grid.stats-row2 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .stats-grid.stats-row2 { grid-template-columns: repeat(2, 1fr); } }
