/* ManaBot Admin – Design-System
   Farben aus dem Logo: Tiefschwarz, Königsblau, Gold. */
:root {
  color-scheme: dark;
  --bg: #0a0c11;
  --bg-2: #0f1218;
  --surface: #141821;
  --surface-2: #1a1f2b;
  --surface-3: #212736;
  --line: #262d3d;
  --line-2: #323a4d;
  --text: #eceff6;
  --text-2: #b4bccd;
  --muted: #8790a5;
  --faint: #5f687d;
  --primary: #3d6ef7;
  --primary-2: #5b86ff;
  --primary-soft: rgba(61, 110, 247, .14);
  --gold: #f6b93b;
  --gold-soft: rgba(246, 185, 59, .13);
  --yt: #ff4545;
  --yt-soft: rgba(255, 69, 69, .13);
  --tw: #a970ff;
  --tw-soft: rgba(169, 112, 255, .15);
  --bt: #3d8ef7;
  --bt-soft: rgba(61, 142, 247, .15);
  --xsrc: #d6d9de;
  --xsrc-soft: rgba(214, 217, 222, .14);
  --rdsrc: #ff6a3d;
  --rdsrc-soft: rgba(255, 106, 61, .14);
  --whsrc: #e0a53c;
  --whsrc-soft: rgba(224, 165, 60, .14);
  --cpsrc: #2dd4bf;
  --cpsrc-soft: rgba(45, 212, 191, .13);
  --dc: #5865f2;
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, .13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --err: #fb7185;
  --err-soft: rgba(251, 113, 133, .13);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  background-image:
    radial-gradient(900px 500px at -10% -20%, rgba(61, 110, 247, .16), transparent 60%),
    radial-gradient(700px 400px at 110% -10%, rgba(246, 185, 59, .07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: rgba(61, 110, 247, .45); }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 6px; }
/* Muss vor allen display-Regeln gewinnen, sonst bleiben per JS versteckte Karten sichtbar. */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------ topbar */
.topbar { position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px); background: rgba(10, 12, 17, .72);
  border-bottom: 1px solid rgba(255, 255, 255, .05); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex;
  align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-weight: 700;
  font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08),
  0 6px 18px -6px rgba(61, 110, 247, .7); }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .02em;
  margin-top: -3px; }
.nav { display: flex; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 550; font-size: 14px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .04); text-decoration: none; }
.nav a.on { color: var(--text); background: rgba(255, 255, 255, .07); }
.topbar .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.me .avatar-txt { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #7b5cff); color: #fff; font-weight: 700; font-size: 13px;
  text-transform: uppercase; }
.me .avatar-img { width: 32px; height: 32px; border-radius: 50%; display: block; object-fit: cover; }

/* ------------------------------------------------------------ layout */
main { max-width: 1240px; margin: 0 auto; padding: 32px 24px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-bottom: 26px; }
.page-head h1 { font-size: 30px; font-weight: 750; line-height: 1.15; }
.page-head .lead { color: var(--text-2); margin-top: 8px; font-size: 15.5px; max-width: 640px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px;
  font-weight: 500; margin-bottom: 18px; }
.back:hover { color: var(--text); text-decoration: none; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.sticky-col { position: sticky; top: 88px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.section-title h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title .count { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--line); padding: 1px 9px; border-radius: 999px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }

/* ------------------------------------------------------------ cards */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 40%), var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-body { padding: 18px 22px; }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px;
  padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s, opacity .15s; }
.btn:hover { background: var(--surface-3); border-color: #3e4760; text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-color: transparent;
  color: #fff; box-shadow: 0 8px 22px -10px rgba(61, 110, 247, .9), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.gold { background: linear-gradient(180deg, #ffcb5c, var(--gold)); color: #1a1405; border-color: transparent;
  box-shadow: 0 8px 22px -10px rgba(246, 185, 59, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.gold:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: rgba(251, 113, 133, .35); }
.btn.danger-solid { background: #e11d48; border-color: transparent; color: #fff; }
.btn.danger-solid:hover { background: #f43f5e; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn.icon-only { width: 36px; padding: 0; }
.btn .spin { display: none; }
.btn.busy { pointer-events: none; opacity: .8; }
.btn.busy .spin { display: inline-block; }
.btn.busy .icon:not(.spin) { display: none; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: currentColor; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ badges & chips */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.badge.yt { background: var(--yt-soft); color: #ff8a8a; }
.badge.tw { background: var(--tw-soft); color: #c9a6ff; }
.badge.bt { background: var(--bt-soft); color: #7fb2ff; }
.badge.xsrc { background: var(--xsrc-soft); color: var(--xsrc); }
.badge.rdsrc { background: var(--rdsrc-soft); color: var(--rdsrc); }
.badge.whsrc { background: var(--whsrc-soft); color: var(--whsrc); }
.badge.cpsrc { background: var(--cpsrc-soft); color: var(--cpsrc); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.off { background: rgba(255, 255, 255, .06); color: var(--muted); }
.badge.live { background: #e11d48; color: #fff; text-transform: uppercase; letter-spacing: .06em; font-size: 11px;
  box-shadow: 0 0 0 0 rgba(225, 29, 72, .6); animation: pulse 2s infinite; }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .55); } 70% { box-shadow: 0 0 0 9px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); } }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px;
  border-radius: 8px; background: rgba(88, 101, 242, .12); color: #aab3ff; font-size: 12.5px; font-weight: 600;
  max-width: 100%; }
.chip .icon { width: 13px; height: 13px; opacity: .9; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, .18); }
.dot.err { background: var(--err); box-shadow: 0 0 0 3px rgba(251, 113, 133, .2); }

/* ------------------------------------------------------------ avatars */
.av { position: relative; width: 44px; height: 44px; border-radius: 12px; flex: none; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 750; font-size: 16px;
  background: linear-gradient(135deg, hsl(var(--h, 220) 70% 52%), hsl(calc(var(--h, 220) + 40) 70% 40%)); }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av.round { border-radius: 50%; }
.av.sm { width: 28px; height: 28px; font-size: 11px; border-radius: 8px; }
.av.lg { width: 76px; height: 76px; font-size: 28px; border-radius: 20px; }
.av-wrap { position: relative; flex: none; }
.av-wrap .plat { position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; border-radius: 7px;
  display: grid; place-items: center; border: 2px solid var(--surface); }
.av-wrap .plat .icon { width: 12px; height: 12px; }
.av-wrap.lg .plat { width: 28px; height: 28px; border-radius: 9px; right: -6px; bottom: -6px; border-width: 3px; }
.av-wrap.lg .plat .icon { width: 16px; height: 16px; }
.plat.yt { background: var(--yt); color: #fff; }
.plat.tw { background: var(--tw); color: #fff; }
.plat.bt { background: var(--bt); color: #fff; }
.plat.xsrc { background: #14171a; color: #fff; border-color: #d6d9de; }
.plat.rdsrc { background: var(--rdsrc); color: #fff; }
.plat.whsrc { background: var(--whsrc); color: #201700; }
.plat.cpsrc { background: var(--cpsrc); color: #042f2a; }
.av-stack { display: flex; }
.av-stack .av { border: 2px solid var(--surface); margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }
.av-stack .more { margin-left: -8px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 700; border: 2px solid var(--surface); }

/* ------------------------------------------------------------ hero / onboarding */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; position: relative; overflow: hidden; }
.how .step { padding: 20px 22px; display: flex; gap: 14px; align-items: flex-start; position: relative; }
.how .step + .step { border-left: 1px solid var(--line); }
.how .num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: 14px; }
.how .step:nth-of-type(1) .num { background: var(--primary-soft); color: var(--primary-2); }
.how .step:nth-of-type(2) .num { background: rgba(88, 101, 242, .15); color: #aab3ff; }
.how .step:nth-of-type(3) .num { background: var(--gold-soft); color: var(--gold); }
.how b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.how p { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.how .close { position: absolute; top: 8px; right: 8px; z-index: 2; }
.how-wrap.hidden { display: none; }

/* ------------------------------------------------------------ stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .value { font-size: 30px; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; }
.stat .sub { font-size: 12.5px; color: var(--muted); }
.stat .glyph { position: absolute; right: -14px; bottom: -18px; width: 86px; height: 86px; opacity: .06; }
.stat.yt .label .icon { color: var(--yt); }
.stat.tw .label .icon { color: var(--tw); }
.stat.bt .label .icon { color: var(--bt); }
.stat.xsrc .label .icon { color: var(--xsrc); }
.stat.rdsrc .label .icon { color: var(--rdsrc); }
.stat.whsrc .label .icon { color: var(--whsrc); }
.stat.cpsrc .label .icon { color: var(--cpsrc); }
.stat.dc .label .icon { color: var(--dc); }
.stat.gold .label .icon { color: var(--gold); }

/* ------------------------------------------------------------ toolbar / filters */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input[type=search] { padding-left: 40px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 7px 12px;
  border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.seg .n { font-size: 11px; color: var(--faint); font-weight: 700; }

/* ------------------------------------------------------------ source cards */
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.src { display: flex; flex-direction: column; gap: 14px; padding: 18px; color: inherit; position: relative;
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s, background .18s; }
.src:hover { text-decoration: none; transform: translateY(-2px); border-color: #38415a;
  box-shadow: var(--shadow-lg); }
.src .top { display: flex; gap: 14px; align-items: center; min-width: 0; }
.src .name { font-weight: 700; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src .meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; color: var(--muted); font-size: 13px; }
.src .grow { flex: 1; min-width: 0; }
.src .go { color: var(--faint); transition: transform .18s var(--ease), color .18s; }
.src:hover .go { color: var(--text-2); transform: translateX(3px); }
.src .targets { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 14px; border-top: 1px dashed var(--line); }
.src .targets .lbl { font-size: 11.5px; color: var(--faint); font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; width: 100%; margin-bottom: 1px; }
.src.paused { opacity: .62; }
.src.paused:hover { opacity: 1; }
.src.live { border-color: rgba(225, 29, 72, .45); box-shadow: 0 0 0 1px rgba(225, 29, 72, .15), var(--shadow); }
.src-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 150px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); color: var(--muted);
  font-weight: 600; transition: .18s; }
.src-add:hover { color: var(--text); border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.src-add .plus { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 8px; }

/* ------------------------------------------------------------ status & activity */
.status-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.status-row + .status-row { border-top: 1px solid var(--line); }
.status-row .grow { flex: 1; }
.status-row b { font-size: 14px; }
.status-row .when { font-size: 12.5px; color: var(--muted); }
.status-hero { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; margin-bottom: 6px; }
.status-hero.ok { background: var(--ok-soft); }
.status-hero.stale { background: var(--err-soft); }
.status-hero.unknown { background: rgba(255, 255, 255, .04); }
.status-hero .ring { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.status-hero.ok .ring { background: rgba(52, 211, 153, .2); color: var(--ok); }
.status-hero.stale .ring { background: rgba(251, 113, 133, .2); color: var(--err); }
.status-hero.unknown .ring { background: rgba(255, 255, 255, .08); color: var(--muted); }
.status-hero b { display: block; font-size: 15px; }
.status-hero span { font-size: 13px; color: var(--text-2); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 0; align-items: flex-start; }
.feed li + li { border-top: 1px solid var(--line); }
.feed .txt { flex: 1; min-width: 0; }
.feed .t1 { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .t2 { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.feed .t2 .icon { width: 12px; height: 12px; }
.feed .fail { color: var(--err); }
.pill-link { color: var(--text-2); }

/* ------------------------------------------------------------ forms */
label.f { display: block; font-size: 13.5px; font-weight: 650; color: var(--text-2); margin: 0 0 8px; }
label.f .opt { color: var(--faint); font-weight: 500; }
.input, input[type=text], input[type=url], input[type=search], textarea, select {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 11px; padding: 11px 14px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(61, 110, 247, .18); }
textarea { resize: vertical; min-height: 130px; line-height: 1.55; font-size: 14.5px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 7px; line-height: 1.45; }
.field + .field { margin-top: 20px; }
.input-row { display: flex; gap: 10px; }
.input-row input { flex: 1; }

/* switch */
.switch { position: relative; display: inline-flex; flex: none; width: 46px; height: 27px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: #2d3446; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .22s var(--ease); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(19px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.switch.blue input:checked + .track { background: var(--primary); }

/* platform picker */
.plat-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plat-pick label { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; cursor: pointer;
  border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--bg-2); transition: .18s; }
.plat-pick input { position: absolute; opacity: 0; }
.plat-pick .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.plat-pick .ic .icon { width: 24px; height: 24px; }
.plat-pick .yt .ic { background: var(--yt-soft); color: var(--yt); }
.plat-pick .tw .ic { background: var(--tw-soft); color: var(--tw); }
.plat-pick .bt .ic { background: var(--bt-soft); color: var(--bt); }
.plat-pick .xsrc .ic { background: var(--xsrc-soft); color: var(--xsrc); }
.plat-pick .rdsrc .ic { background: var(--rdsrc-soft); color: var(--rdsrc); }
.plat-pick .whsrc .ic { background: var(--whsrc-soft); color: var(--whsrc); }
.plat-pick .cpsrc .ic { background: var(--cpsrc-soft); color: var(--cpsrc); }
.plat-pick b { display: block; font-size: 15.5px; color: var(--text); }
.plat-pick span { font-size: 13px; color: var(--muted); }
.plat-pick .check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; transition: .18s; }
.plat-pick .check .icon { width: 13px; height: 13px; stroke-width: 3; }
.plat-pick label:hover { border-color: #46506a; }
.plat-pick .yt:has(input:checked) { border-color: var(--yt); background: linear-gradient(180deg, var(--yt-soft), transparent); }
.plat-pick .tw:has(input:checked) { border-color: var(--tw); background: linear-gradient(180deg, var(--tw-soft), transparent); }
.plat-pick .bt:has(input:checked) { border-color: var(--bt); background: linear-gradient(180deg, var(--bt-soft), transparent); }
.plat-pick .xsrc:has(input:checked) { border-color: var(--xsrc); background: linear-gradient(180deg, var(--xsrc-soft), transparent); }
.plat-pick .rdsrc:has(input:checked) { border-color: var(--rdsrc); background: linear-gradient(180deg, var(--rdsrc-soft), transparent); }
.plat-pick .whsrc:has(input:checked) { border-color: var(--whsrc); background: linear-gradient(180deg, var(--whsrc-soft), transparent); }
.plat-pick .cpsrc:has(input:checked) { border-color: var(--cpsrc); background: linear-gradient(180deg, var(--cpsrc-soft), transparent); }
.plat-pick .yt:has(input:checked) .check { background: var(--yt); border-color: var(--yt); color: #fff; }
.plat-pick .tw:has(input:checked) .check { background: var(--tw); border-color: var(--tw); color: #fff; }
.plat-pick .bt:has(input:checked) .check { background: var(--bt); border-color: var(--bt); color: #fff; }
.plat-pick .xsrc:has(input:checked) .check { background: #14171a; border-color: var(--xsrc); color: #fff; }
.plat-pick .rdsrc:has(input:checked) .check { background: var(--rdsrc); border-color: var(--rdsrc); color: #fff; }
.plat-pick .whsrc:has(input:checked) .check { background: var(--whsrc); border-color: var(--whsrc); color: #201700; }
.plat-pick .cpsrc:has(input:checked) .check { background: var(--cpsrc); border-color: var(--cpsrc); color: #042f2a; }

/* Blue-Tracker category picker */
.cat-pick { display: grid; gap: 10px; }
.cpick { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer;
  border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--bg-2); transition: .18s; }
.cpick input { position: absolute; opacity: 0; }
.cpick .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--bt-soft); color: var(--bt); }
.cpick .ic .icon { width: 19px; height: 19px; }
.cpick b { display: block; font-size: 14.5px; color: var(--text); }
.cpick span { font-size: 12.5px; color: var(--muted); }
.cpick .check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; transition: .18s; }
.cpick .check .icon { width: 13px; height: 13px; stroke-width: 3; }
.cpick:hover { border-color: #46506a; }
.cpick:has(input:checked) { border-color: var(--bt); background: linear-gradient(180deg, var(--bt-soft), transparent); }
.cpick:has(input:checked) .check { background: var(--bt); border-color: var(--bt); color: #fff; }

/* target picker (checkbox tiles) */
.targets-pick { display: grid; gap: 10px; }
.tpick { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line-2); background: var(--bg-2); transition: .15s; }
.tpick:hover { border-color: #46506a; }
.tpick:has(input:checked) { border-color: var(--dc); background: rgba(88, 101, 242, .08); }
.tpick .dc { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(88, 101, 242, .16);
  color: #aab3ff; flex: none; }
.tpick .grow { flex: 1; min-width: 0; }
.tpick b { display: block; font-size: 14.5px; color: var(--text); }
.tpick span { font-size: 12.5px; color: var(--muted); }

/* lookup result */
.found { display: none; align-items: center; gap: 14px; margin-top: 12px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(52, 211, 153, .35); background: var(--ok-soft); animation: pop .3s var(--ease); }
.found.show { display: flex; }
.found.err { border-color: rgba(251, 113, 133, .35); background: var(--err-soft); }
.found b { display: block; }
.found .grow { flex: 1; min-width: 0; }
.found .small { color: var(--text-2); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.steps-form { display: grid; gap: 18px; }
.fstep { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
.fstep .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  font-size: 13.5px; background: var(--surface-3); color: var(--text-2); margin-top: 2px; }
.fstep h3 { font-size: 16.5px; margin-bottom: 4px; }
.fstep .desc { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }

details.more summary { cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 600; list-style: none;
  display: inline-flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .icon { transform: rotate(90deg); }
details.more summary .icon { transition: transform .15s; }

/* ------------------------------------------------------------ detail page */
.hero { display: flex; gap: 22px; align-items: center; padding: 26px; flex-wrap: wrap; }
.hero .grow { flex: 1; min-width: 240px; }
.hero h1 { font-size: 28px; font-weight: 750; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: 14px; }
.hero .actions { display: flex; align-items: center; gap: 14px; }
.toggle-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 16px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line); }
.toggle-card b { display: block; font-size: 14px; }
.toggle-card span { font-size: 12px; color: var(--muted); }
.rename { display: none; gap: 8px; margin-top: 10px; max-width: 460px; }
.rename.show { display: flex; }

.target { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden;
  transition: border-color .2s, box-shadow .2s; }
.target + .target { margin-top: 14px; }
.target.on { border-color: rgba(88, 101, 242, .5); box-shadow: 0 0 0 1px rgba(88, 101, 242, .15); }
.target-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.target-head .dc { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(88, 101, 242, .16);
  color: #aab3ff; flex: none; }
.target-head .grow { flex: 1; min-width: 0; }
.target-head b { display: block; font-size: 15px; }
.target-head .state { font-size: 12.5px; color: var(--muted); }
.target.on .target-head .state { color: var(--ok); }
.target-body { display: none; border-top: 1px solid var(--line); padding: 20px 18px; background: rgba(0, 0, 0, .12); }
.target.on .target-body { display: block; animation: pop .25s var(--ease); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.editor .col-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; min-height: 32px; }
.editor .col-h b { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.ph-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ph { border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); border-radius: 8px;
  padding: 4px 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: .15s; }
.ph:hover { border-color: var(--primary); color: var(--text); background: var(--primary-soft); }
.ph code { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.editor-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.editor-foot .grow { flex: 1; }
.counter { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.counter.bad { color: var(--err); font-weight: 700; }
.dirty-note { display: none; font-size: 12.5px; color: var(--warn); align-items: center; gap: 6px; }
.dirty .dirty-note { display: inline-flex; }
select.preset { width: auto; height: 32px; padding: 0 30px 0 10px; font-size: 13px; border-radius: 9px; background-color: var(--surface-2);
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238790a5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }

/* Discord-Vorschau */
.dc-preview { background: #313338; border-radius: 12px; padding: 16px 16px 18px; color: #dbdee1;
  font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 15px; line-height: 1.375rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04); }
.dc-channel { display: flex; align-items: center; gap: 6px; color: #949ba4; font-size: 13px; font-weight: 600;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid #3f4147; }
.dc-channel .icon { width: 16px; height: 16px; }
.dc-msg { display: flex; gap: 14px; }
.dc-msg .dc-av { width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden; background: #5865f2; }
.dc-msg .dc-av img { width: 100%; height: 100%; object-fit: cover; }
.dc-msg .body { min-width: 0; flex: 1; }
.dc-name { display: flex; align-items: center; gap: 6px; }
.dc-name b { color: #f2f3f5; font-weight: 600; font-size: 15.5px; }
.dc-tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 3px; letter-spacing: .02em; }
.dc-time { color: #949ba4; font-size: 12px; }
.dc-content { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; margin-top: 2px; }
.dc-content a { color: #00a8fc; }
.dc-content code { background: #2b2d31; border-radius: 4px; padding: 0 3px; font-family: var(--mono); font-size: 85%; }
.dc-content blockquote { margin: 0; padding-left: 12px; border-left: 4px solid #4e5058; }
.dc-content .empty-msg { color: #949ba4; font-style: italic; }
.dc-embed { margin-top: 8px; max-width: 432px; background: #2b2d31; border-radius: 4px; border-left: 4px solid #ff0000;
  padding: 10px 14px 14px; display: grid; gap: 6px; }
.dc-embed.tw { border-left-color: #9146ff; }
/* payload-built embeds set their bar color inline (target color or payload.py defaults);
   Discord's own link previews (custom template with a bare link) carry no colored bar. */
.dc-embed.auto { border-left-color: #4e5058; }
.dc-embed .prov { font-size: 12px; color: #b5bac1; }
.dc-embed .auth { font-size: 13.5px; font-weight: 600; color: #f2f3f5; }
.dc-embed .ttl { color: #00a8fc; font-weight: 600; font-size: 15px; }
.dc-embed .ttl.plain { color: #f2f3f5; } /* payload embed without url: title is not a link */
.dc-embed .desc { color: #dbdee1; font-size: 14px; }
.dc-embed .foot { font-size: 12px; font-weight: 600; color: #b5bac1; margin-top: 4px; }
.dc-embed .thumb { margin-top: 6px; aspect-ratio: 16 / 9; border-radius: 4px; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #3d6ef7, transparent 60%), radial-gradient(circle at 80% 70%, #f6b93b, transparent 55%), #1e1f22; }
.dc-embed .thumb .play { width: 58px; height: 40px; border-radius: 12px; background: #ff0000; display: grid; place-items: center; }
.dc-embed.tw .thumb .play { background: #9146ff; }
.dc-embed .thumb .play .icon { fill: #fff; stroke: none; width: 20px; height: 20px; }
.preview-note { margin-top: 10px; font-size: 12.5px; color: var(--faint); display: flex; gap: 6px; align-items: center; }

.danger-zone { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap;
  padding: 18px 22px; border-radius: 16px; border: 1px solid rgba(251, 113, 133, .25); background: rgba(251, 113, 133, .04); }
.danger-zone b { display: block; }
.danger-zone span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ webhooks page */
.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.wh { display: flex; flex-direction: column; }
.wh .top { display: flex; gap: 14px; align-items: center; padding: 20px 20px 16px; }
.wh .dc-big { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #5865f2, #3b45c4); color: #fff; flex: none; box-shadow: 0 8px 20px -10px #5865f2; }
.wh .dc-big .icon { width: 26px; height: 26px; }
.wh .grow { flex: 1; min-width: 0; }
.wh h3 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh .masked { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.wh .mid { padding: 0 20px 18px; display: grid; gap: 14px; }
.wh .kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.wh .sender { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; }
.wh .sender img { width: 22px; height: 22px; border-radius: 50%; }
.wh .foot { margin-top: auto; display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.wh .edit { display: none; padding: 18px 20px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.wh.editing .edit { display: grid; gap: 14px; }
.howto { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.howto li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.howto li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: rgba(88, 101, 242, .18); color: #aab3ff; font-size: 12px; font-weight: 800; }
.howto kbd { font-family: var(--font); font-size: 12.5px; background: var(--surface-3); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; color: var(--text); }

/* ------------------------------------------------------------ toasts & dialogs */
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px;
  max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #1c2130;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 14px; animation: toast-in .35s var(--ease); }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
.toast .ti { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast.success .ti { background: var(--ok-soft); color: var(--ok); }
.toast.error .ti { background: var(--err-soft); color: var(--err); }
.toast.message .ti { background: var(--primary-soft); color: var(--primary-2); }
.toast .tx { flex: 1; padding-top: 2px; }
.toast button { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

dialog { border: 1px solid var(--line-2); border-radius: 20px; background: var(--surface); color: var(--text); padding: 0;
  width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(4, 6, 10, .66); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .25s var(--ease); }
.dlg { padding: 26px; }
.dlg .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; }
.dlg .ic.danger { background: var(--err-soft); color: var(--err); }
.dlg .ic.info { background: var(--primary-soft); color: var(--primary-2); }
.dlg h3 { font-size: 19px; margin-bottom: 8px; }
.dlg p { color: var(--text-2); font-size: 14.5px; }
.dlg .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.foot-note { margin-top: 48px; display: flex; justify-content: center; gap: 8px; align-items: center; color: var(--faint); font-size: 13px; text-align: center; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .grid-main { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .editor { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
  .how .step + .step { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar-in { padding: 0 16px; gap: 12px; height: 58px; }
  .brand small, .me .who { display: none; }
  .nav a { padding: 8px 10px; }
  .nav a .lbl-long { display: none; }
  main { padding: 22px 16px 64px; }
  .page-head h1 { font-size: 24px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 24px; }
  .plat-pick { grid-template-columns: 1fr; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 22px; }
  .wh-grid, .sources { grid-template-columns: 1fr; }
  .fstep { grid-template-columns: 1fr; gap: 8px; }
  .input-row { flex-direction: column; }
  .toasts { right: 16px; left: 16px; bottom: 16px; }
}

/* ---------------------------------------------------- Login, Server-Auswahl, Kanal-Dropdown */
.login-wrap { display: grid; place-items: center; min-height: 60vh; }
.login-card { max-width: 460px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.login-card h1 { font-size: 26px; margin: 0; }
.login-card .lead { color: var(--muted); margin: 0; }
.login-logo { width: 64px; height: 64px; border-radius: 16px; }
.tenant-switch { display: flex; align-items: center; }
.tenant-switch select { height: 34px; border-radius: 10px; background: rgba(255,255,255,.06);
  color: var(--fg); border: 1px solid rgba(255,255,255,.12); padding: 0 10px; font: inherit; font-size: 13px; }
.row-line { display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.07); }
.row-line:last-child { border-bottom: 0; }
.row-line .grow { flex: 1; min-width: 0; }
.row-line .hint { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.chan-pick { display: grid; gap: 14px; }
.chan-pick select { height: 38px; border-radius: 10px; background: rgba(255,255,255,.06);
  color: var(--fg); border: 1px solid rgba(255,255,255,.14); padding: 0 10px; font: inherit; }
.notice { display: flex; gap: 9px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--warn-soft); color: var(--warn); font-size: 13.5px; }
.notice .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* Inline-Zielanlage in Schritt 3 des Assistenten: kompaktes Panel, keine verschachtelten
   Formulare (liegt innerhalb des Assistenten-Formulars) - app.js schickt die Felder per fetch. */
.panel-add { margin-top: 14px; display: grid; gap: 14px; animation: pop .25s var(--ease); }
.pa-block { display: grid; gap: 10px; padding: 16px; border-radius: 14px;
  border: 1.5px solid var(--line-2); background: var(--bg-2); }
.pa-block h4 { margin: 0; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.pa-block select, .pa-block input[type=text], .pa-block input[type=url] { height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.06); color: var(--fg); border: 1px solid rgba(255,255,255,.14);
  padding: 0 10px; font: inherit; }
.pa-block .hint { margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
