:root {
    --bg: #0b0b0f;
    --surface: #121217;
    --surface-hover: #17171e;
    --control: #1a1a22;
    --control-hover: #22222c;
    --border: rgba(255, 255, 255, .09);
    --border-strong: rgba(255, 255, 255, .18);
    --hair: rgba(255, 255, 255, .07);
    --text: #f3f3f6;
    --muted: #a1a1ad;
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-bright: #8b5cf6;
    --accent-text: #b39dfa;
    --accent-soft: rgba(139, 92, 246, .16);
    --danger: #ff7176;
    --ok: #3ddc97;
    --warn: #fbbf24;
    --radius: 10px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { scrollbar-color: #2e2e3a transparent; scrollbar-width: thin; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; caret-color: var(--accent-text); }
::selection { background: rgba(139, 92, 246, .5); color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
h2, h3, h4, p { margin: 0; }

input, select, textarea {
    width: 100%; background: var(--control); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 11px 14px; transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, select:hover, textarea:hover { background: var(--control-hover); border-color: var(--border-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent-text); outline-offset: 2px;
}
select {
    appearance: none; cursor: pointer; padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1ad' stroke-width='2' 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 12px center;
}
select:disabled, input:disabled { opacity: .5; cursor: not-allowed; }
option { background: #1a1a22; color: var(--text); }
textarea { min-height: 170px; resize: vertical; }
input[type=checkbox] { width: 19px; height: 19px; padding: 0; accent-color: var(--accent-bright); cursor: pointer; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 7px; }

button {
    background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: var(--radius);
    padding: 10px 18px; font-weight: 600; cursor: pointer; transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); font-weight: 500; }
button.ghost:hover { background: var(--control); }
button.danger { background: transparent; color: var(--danger); padding: 6px 10px; font-weight: 600; }
button.danger:hover { background: rgba(255, 113, 118, .14); }
a { color: var(--accent-text); }
.btn { display: block; text-align: center; background: var(--accent); color: #fff; border-radius: var(--radius); padding: 12px 22px; font-weight: 600; text-decoration: none; transition: background-color .15s var(--ease); }
.btn:hover { background: var(--accent-hover); }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

/* Login */
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 40px 34px 34px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.login h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.login p { color: var(--muted); font-size: 15px; }
.login .btn { align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 24px; font-size: 16px; border-radius: 12px; margin-top: 22px; }
.login .btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login .msg { text-align: center; margin-top: 12px; }
/* Hintergrund der Login-Seite */
.login-bg { position: relative; overflow: hidden; isolation: isolate; }
.login-bg::before { content: ""; position: absolute; inset: 0; z-index: -2; background-image: radial-gradient(rgba(255, 255, 255, .2) 1px, transparent 1.5px); background-size: 28px 28px; -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 15%, transparent 75%); mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 15%, transparent 75%); }
.login-bg::after { content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: min(1100px, 130vw); height: min(760px, 110vh); transform: translate(-50%, -50%); background: radial-gradient(circle at 32% 38%, rgba(139, 92, 246, .30), transparent 52%), radial-gradient(circle at 70% 66%, rgba(88, 101, 242, .22), transparent 50%); filter: blur(24px); pointer-events: none; animation: glow-drift 22s ease-in-out infinite alternate; }
@keyframes glow-drift { from { transform: translate(-52%, -52%) scale(1); } to { transform: translate(-48%, -48%) scale(1.06); } }
.login-bg .login { background: rgba(18, 18, 23, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
@media (prefers-reduced-motion: reduce) { .login-bg::after { animation: none; } }

.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 16px; }

/* Rahmen: Top-Leiste, Seitenleiste als Karte, Inhalt */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: rgba(11, 11, 15, .92); border-bottom: 1px solid var(--border); height: 64px; padding: 0 28px; display: flex; align-items: center; gap: 22px; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }

.gicon { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; object-fit: cover; }
.gicon.big { width: 56px; height: 56px; border-radius: 16px; font-size: 24px; }
.picker { position: relative; min-width: 0; }
.picker-btn { display: flex; align-items: center; gap: 10px; background: var(--control); color: var(--text); border-color: var(--border); padding: 5px 12px 5px 5px; max-width: 320px; font-weight: 600; }
.picker-btn:hover, .picker-btn[aria-expanded="true"] { background: var(--control-hover); border-color: var(--border-strong); }
.picker-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chev { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; transition: transform .2s var(--ease); }
.picker-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.picker-pop, .user-pop { position: absolute; top: calc(100% + 10px); background: #17171e; border: 1px solid var(--border-strong); border-radius: 14px; padding: 8px; z-index: 20; box-shadow: 0 18px 44px rgba(0, 0, 0, .6); }
.picker-pop { left: 0; width: 380px; max-width: calc(100vw - 32px); }
.pop-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 6px; }
.pop-list { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.pop-row { display: flex; align-items: center; gap: 4px; }
.pop-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: transparent; color: var(--text); text-align: left; padding: 9px 12px; font-weight: 400; }
.pop-item:hover { background: rgba(255, 255, 255, .06); }
.pop-item.active { background: var(--accent-soft); }
.pop-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pop-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-text .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-check { margin-left: auto; display: grid; flex: none; }
.pop-check svg { width: 20px; height: 20px; fill: none; stroke: var(--accent-text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { background: transparent; padding: 9px; display: grid; place-items: center; color: var(--muted); border-radius: 9px; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pop-more { background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; padding: 9px 12px; width: 100%; text-align: left; margin-top: 4px; }
.pop-more:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.pop-bot { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--hair); margin: 8px 2px 0; padding: 12px 10px 4px; }
.pop-bot .gicon { border-radius: 50%; }

.user { margin-left: auto; position: relative; }
.user-box { display: flex; align-items: center; gap: 12px; background: var(--control); color: var(--text); border-color: var(--border); padding: 5px 12px 5px 5px; font-weight: 400; text-align: left; }
.user-box:hover, .user-box[aria-expanded="true"] { background: var(--control-hover); border-color: var(--border-strong); }
.user-box[aria-expanded="true"] .chev { transform: rotate(180deg); }
.user-pop { right: 0; width: 260px; max-width: calc(100vw - 32px); }
.user-pop-head { display: flex; flex-direction: column; padding: 2px 12px 12px; line-height: 1.3; }
.user-pop-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; background: transparent; color: var(--danger); text-align: left; padding: 10px 12px; font-weight: 600; border-top: 1px solid var(--hair); border-radius: 0 0 var(--radius) var(--radius); margin-top: 2px; }
.menu-item:hover { background: rgba(255, 113, 118, .14); }
.menu-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.user-text { display: flex; flex-direction: column; line-height: 1.25; }
.user-text b { font-size: 14px; font-weight: 600; }
.user-text .muted { font-size: 12px; }

.body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; flex: 1; width: 100%; max-width: 1380px; margin: 0 auto; padding: 32px 28px 80px; align-items: start; }
nav#nav { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 96px; }
nav#nav button {
    display: flex; align-items: center; gap: 12px; background: transparent; color: var(--muted);
    text-align: left; padding: 10px 12px; font-weight: 500; font-size: 15px;
}
nav#nav button:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
nav#nav button.active { background: rgba(255, 255, 255, .07); color: #fff; }
nav#nav button.active .ico { color: var(--accent-text); }
.ico { display: grid; place-items: center; flex: none; color: inherit; }
.ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.content { min-width: 0; }
.page-head { margin-bottom: 30px; }
.page-head h2 { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.page-head p { margin-top: 8px; color: var(--muted); font-size: 16px; max-width: 64ch; }
.role-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; font-weight: 600; }
.role-badge::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--accent-bright); }
.role-badge.team::before { background: var(--ok); }

h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 14px; max-width: 56ch; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; }
.section { margin-top: 28px; }
.section > h3 { margin-bottom: 14px; }
.narrow { max-width: 900px; display: grid; gap: 20px; }

/* Kennzahl-Karten */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; text-align: left; color: var(--text); font-weight: 400; position: relative; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
button.stat:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.stat .label { font-size: 14px; color: var(--muted); }
.stat .num { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .num small { font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat .arrow { position: absolute; top: 18px; right: 18px; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 15px 0; border-top: 1px solid var(--hair); }
.list > li:first-child { border-top: 0; }
.panel > .list:first-child > li:first-child, .panel > h3 + .list > li:first-child { padding-top: 6px; }
.check { display: flex; align-items: center; gap: 14px; }
.check .grow { flex: 1; font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); flex: none; }
.dot.ok { background: var(--ok); }
.check a { cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none; }
.check a:hover { text-decoration: underline; text-underline-offset: 3px; }
.progress { height: 8px; border-radius: 99px; background: var(--control); overflow: hidden; margin: 14px 0 6px; }
.progress i { display: block; width: 100%; height: 100%; background: var(--accent-bright); border-radius: 99px; transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .4s var(--ease); }

/* Log-Zeilen mit Schalter */
.log-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 220px) auto; gap: 16px; align-items: center; }
.log-row b { display: block; font-weight: 600; }
.log-row .muted { display: block; font-size: 13px; margin-top: 1px; }
.log-row .tdot { width: 11px; height: 11px; border-radius: 3px; background: var(--c); }
.switch { width: 46px; height: 26px; padding: 0; border-radius: 99px; background: var(--control-hover); border: 1px solid var(--border-strong); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); }
.switch:hover { background: #2a2a36; }
.switch[aria-checked="true"] { background: var(--accent); border-color: transparent; }
.switch[aria-checked="true"]:hover { background: var(--accent-hover); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

.setting { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.setting b { display: block; font-weight: 600; }
.setting .muted { display: block; margin-top: 2px; }

.entry .head-line { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent-text); border-radius: 6px; padding: 2px 9px; font-size: 13px; font-weight: 600; }
.entry .when { margin-left: auto; }
.entry .f { margin-top: 10px; }
.entry .f b { color: var(--muted); font-weight: 600; font-size: 13px; display: block; margin-bottom: 3px; }
.entry .f div { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--hair); border-radius: 8px; padding: 10px 12px; font-size: 15px; }
.empty { color: var(--muted); padding: 18px 0 4px; max-width: 46ch; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
td, th { text-align: left; padding: 13px 8px 13px 0; border-top: 1px solid var(--hair); vertical-align: middle; }
tr:first-child td, tr:first-child th { border-top: 0; }
th { font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 4px; padding-bottom: 8px; }
td:last-child, th:last-child { text-align: right; padding-right: 0; }
th.c, td.c { text-align: center; }
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.table-scroll table { min-width: 640px; }
.checks { display: flex; flex-wrap: wrap; gap: 12px 26px; margin-top: 10px; }
.checks label { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; }
code { background: var(--control); border: 1px solid var(--hair); border-radius: 6px; padding: 1px 6px; font-size: .9em; }

.msg { margin-top: 14px; font-size: 14px; min-height: 22px; font-weight: 500; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.loading { color: var(--muted); padding: 40px 0; }
.inline-select { width: auto; max-width: 220px; flex: none; }
.row h3 { white-space: nowrap; }

/* Ping-Rollen */
.role-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: center; }
.role-row .assign { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.role-add { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--hair); }

/* Discord-Vorschau (bildet die echte Nachricht nach) */
.preview { background: #313338; border-radius: 12px; padding: 18px; color: #dbdee1; font-family: "gg sans", system-ui, sans-serif; }
.dc { background: #2b2d31; border-left: 4px solid var(--bar, var(--accent-bright)); border-radius: 8px; padding: 14px 16px; }
.dc h4 { font-size: 17px; color: #fff; margin-bottom: 6px; }
.dc .dc-body { word-break: break-word; font-size: 15px; line-height: 1.4; }
.dc .dc-body > div + div, .dc .dc-body > pre + div, .dc .dc-body > div + pre { margin-top: 2px; }
.md-h1 { font-size: 1.7em; font-weight: 700; color: #fff; line-height: 1.2; margin: 10px 0 4px; }
.md-h2 { font-size: 1.4em; font-weight: 700; color: #fff; line-height: 1.25; margin: 8px 0 4px; }
.md-h3 { font-size: 1.15em; font-weight: 700; color: #fff; line-height: 1.3; margin: 6px 0 2px; }
.md-h1:first-child, .md-h2:first-child, .md-h3:first-child { margin-top: 0; }
.md-sub { font-size: 12px; color: #949ba4; }
.md-quote { position: relative; padding-left: 16px; }
.md-quote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: #4e5058; }
.md-li { display: flex; gap: 8px; padding-left: 8px; }
.md-mark { flex: none; color: #b5bac1; min-width: 1em; text-align: right; }
.dc pre { margin: 4px 0; background: #1e1f22; border-radius: 6px; padding: 8px 10px; overflow-x: auto; font-size: 14px; }
.dc pre code { background: none; border: 0; padding: 0; white-space: pre; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.dc a { color: #00a8fc; }
.spoiler { background: #1e1f22; color: transparent; border-radius: 4px; cursor: pointer; padding: 0 2px; }
.spoiler.shown { background: #3a3c42; color: inherit; }
.dc hr { border: 0; border-top: 1px solid #3f4147; margin: 12px 0 8px; }
.dc .foot { font-size: 12px; color: #949ba4; }
.dc code { background: #1e1f22; border: 0; padding: 1px 5px; border-radius: 4px; }
.ping { color: #c9cdfb; background: #3c4270; border-radius: 4px; padding: 0 3px; }

@media (max-width: 1180px) {
    .body { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 28px 22px 70px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .topbar { height: auto; flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
    .picker { order: 3; flex: 1 1 100%; }
    .picker-btn { max-width: none; width: 100%; }
    .picker-name { flex: 1; text-align: left; }
    .picker-pop { width: 100%; max-width: none; }
    .body { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 18px 16px 60px; }
    nav#nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
    nav#nav button { flex: none; padding: 9px 14px; }
    .cols { grid-template-columns: minmax(0, 1fr); }
    .page-head h2 { font-size: 27px; }
    .page-head p { font-size: 15px; }
    .panel { padding: 20px 18px; border-radius: 12px; }
}
@media (max-width: 720px) {
    .log-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .log-row select { grid-column: 1 / -1; grid-row: 2; }
    .role-row { grid-template-columns: minmax(0, 1fr) auto; }
    .role-row select, .role-row input[type=text] { grid-column: 1 / -1; }
}
@media (max-width: 640px) { .setting { grid-template-columns: 1fr; gap: 10px; } }
@media (max-width: 560px) {
    .brand-name, .user-text { display: none; }
    .user-box { padding: 4px 10px 4px 4px; gap: 8px; }
    .stat-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Log-Eintraege im Seiten-Design */
.log-entry { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.le-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.le-dot { display: block; border-radius: 12px; position: relative; }
.le-dot::after { content: ""; position: absolute; inset: 14px; border-radius: 3px; background: var(--c); }
.le-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.log-tag { display: inline-block; border-radius: 6px; padding: 2px 10px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 62%, #fff); }
.le-desc { font-size: 15px; line-height: 1.5; word-break: break-word; }
.le-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.le-field { background: var(--bg); border: 1px solid var(--hair); border-radius: 10px; padding: 10px 14px; min-width: 0; font-size: 15px; word-break: break-word; }
.le-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; letter-spacing: .02em; }
.le-foot { margin-top: 10px; font-size: 12px; color: var(--muted); word-break: break-all; }
.log-list .md-p, .log-list .md-li { color: inherit; }
.log-list .mention { background: rgba(255, 255, 255, .07); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 1px 8px 1px 6px; font-weight: 500; }
.log-list .mention.role { background: color-mix(in srgb, var(--rc, #8b5cf6) 16%, transparent); border-color: color-mix(in srgb, var(--rc, #8b5cf6) 40%, transparent); color: color-mix(in srgb, var(--rc, #8b5cf6) 55%, #fff); }
.log-list .mention.ts { color: var(--muted); }
.log-list a { color: var(--accent-text); }
.chip-avatar { display: none; width: 18px; height: 18px; border-radius: 50%; object-fit: cover; vertical-align: -4px; margin-right: 6px; }
.log-list .chip-avatar { display: inline-block; }

.mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 4px; padding: 0 3px; font-weight: 500; white-space: nowrap; }
.mention.role { background: color-mix(in srgb, var(--rc, #5865f2) 28%, transparent); color: var(--rc, #c9cdfb); }
.mention.ts { background: rgba(255, 255, 255, .08); color: #dbdee1; }

/* Berechtigungen */
.access-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.role-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.role-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: transparent; color: var(--text); font-weight: 500; text-align: left; padding: 10px 12px; border-color: transparent; }
.role-item:hover { background: rgba(255, 255, 255, .05); }
.role-item.active { background: var(--accent-soft); border-color: rgba(139, 92, 246, .35); }
.role-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-item .muted { font-size: 13px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: transparent; border: 1px solid var(--border-strong); color: var(--text); font-weight: 500; font-size: 14px; padding: 6px 14px; border-radius: 99px; }
.chip:hover { background: var(--control); border-color: var(--accent-bright); }
.perm-group { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--hair); }
.perm-head { display: flex; flex-direction: column; margin-bottom: 8px; }
.perm-head b { font-size: 16px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; }
.member-row { display: flex; gap: 14px; align-items: flex-start; }
.audit-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.audit-row .tag { justify-self: start; }
.audit-text { display: flex; flex-direction: column; min-width: 0; }
.audit-text .muted { overflow: hidden; text-overflow: ellipsis; }
input[type=search] { -webkit-appearance: none; appearance: none; }

/* Ladezustand */
.skel { display: grid; gap: 14px; padding: 10px 0; }
.skel i { display: block; height: 18px; border-radius: 8px; background: linear-gradient(90deg, var(--surface) 25%, var(--control) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 960px) {
    .access-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
    .log-entry { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
    .le-avatar { width: 32px; height: 32px; }
    .audit-row { grid-template-columns: minmax(0, 1fr) auto; }
    .audit-row .tag { grid-column: 1 / -1; }
}

/* Kein Zugriff */
.login-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 14px; color: var(--accent-text); background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .35); font-size: 24px; font-weight: 800; }
.denied-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 14px; color: var(--danger); background: rgba(255, 113, 118, .12); border: 1px solid rgba(255, 113, 118, .3); }
.login-icon svg, .denied-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login .ghost-btn { background: transparent; border: 1px solid var(--border-strong); color: var(--text); font-weight: 500; }
.login .ghost-btn:hover { background: var(--control); }

/* Tickets */
.chip.active { background: var(--accent-soft); border-color: rgba(139, 92, 246, .5); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.open::before { background: var(--ok); }
.status.closed::before { background: var(--warn); }
.type-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.type-main { display: flex; flex-direction: column; min-width: 0; }
.editor { margin-top: 20px; padding-top: 22px; border-top: 1px solid var(--hair); }
.role-checks { display: flex; flex-wrap: wrap; gap: 8px; max-height: 190px; overflow-y: auto; padding: 2px; }
.check-chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px 6px 10px; border: 1px solid var(--border-strong); border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.check-chip:hover { background: var(--control); }
.check-chip:has(input:checked) { background: var(--accent-soft); border-color: rgba(139, 92, 246, .5); }
.q-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; margin-bottom: 8px; }
.q-row .assign { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) { .q-row { grid-template-columns: minmax(0, 1fr) auto; } .q-row input[type=text] { grid-column: 1 / -1; } .type-row { flex-direction: column; } }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .stat-grid.three { grid-template-columns: minmax(0, 1fr); } }

/* Sprachwahl */
.lang-switch { display: flex; gap: 4px; padding: 4px; margin: 0 8px 8px; background: var(--control); border: 1px solid var(--border); border-radius: 10px; }
.lang-btn { flex: 1; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 10px; border-color: transparent; }
.lang-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.lang-btn.active { background: var(--accent-soft); color: var(--text); border-color: rgba(139, 92, 246, .4); }
.login .lang-switch { margin: 22px auto 0; max-width: 220px; }

/* Berechtigungen */
.tabs { margin-bottom: 18px; }
.note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 14px; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.role-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--rc, #6b6b78); box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.role-item { gap: 12px; justify-content: flex-start; }
.role-item .muted { margin-left: auto; }
.role-item-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.bar { display: block; height: 3px; border-radius: 99px; background: var(--control-hover); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--accent-bright); transform-origin: left; transform: scaleX(var(--p, 0)); }
.editor-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.editor-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.editor-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 4px; }
.perm-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px 16px 8px; background: var(--bg); }
.perm-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.perm-card header div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.perm-card header b { font-size: 15px; }
.perm-card .perm-row { padding: 10px 0; border-top: 1px solid var(--hair); font-size: 14px; }
.perm-row.is-locked { color: var(--muted); }
.lock { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.lock svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.matrix { border-collapse: collapse; width: 100%; min-width: 0; }
.matrix th, .matrix td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--hair); font-size: 14px; }
.matrix th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--surface); min-width: 220px; }
.mx-role { display: inline-flex; align-items: center; gap: 8px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.mx-group td { background: var(--bg); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mx-cell { text-align: center !important; }
.mx-on svg { width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mx-off { color: var(--border-strong); }
@media (max-width: 1180px) { .perm-grid { grid-template-columns: minmax(0, 1fr); } }


/* Protokoll: Rechte-Aenderungen */
.perm-chips { margin-top: 6px; gap: 6px; }
.perm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 500; border: 1px solid var(--border); }
.perm-chip b { font-weight: 700; }
.perm-chip.add { color: var(--ok); background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .3); }
.perm-chip.del { color: var(--danger); background: rgba(255, 113, 118, .1); border-color: rgba(255, 113, 118, .3); }

/* Ping-Rollen */
.role-cards { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.role-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.role-card.new { margin-top: 14px; border-style: dashed; border-color: var(--border-strong); }
.rc-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.rc-title svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round; }
.rc-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: center; }
.rc-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rc-name input { min-width: 0; }
.switch-field { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; cursor: pointer; }
.role-card.new .rc-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; }
@media (max-width: 860px) { .rc-fields, .role-card.new .rc-fields { grid-template-columns: minmax(0, 1fr) auto; } .rc-fields > :nth-child(1), .rc-fields > :nth-child(2) { grid-column: 1 / -1; } }

/* Bewegung: alles gleitet statt zu springen */
:root { --t: .22s var(--ease); }
button, .btn, .chip, .check-chip, .pop-item, .role-item, .menu-item, .icon-btn, .lang-btn, #nav button, .stat, .perm-chip, .role-card, .perm-card, .log-entry, .tag, .mention, .switch-field {
    transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t), box-shadow var(--t), transform var(--t);
}
.switch { transition: background-color var(--t), border-color var(--t), opacity var(--t); }
.switch::after { transition: transform .28s var(--ease); }
.bar i { transition: transform .45s var(--ease); }
button:active:not(:disabled) { transform: scale(.98); }
.switch:active:not(:disabled) { transform: none; }
.role-dot, .tdot { transition: background-color var(--t); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.picker-pop:not(.hidden), .user-pop:not(.hidden) { animation: pop-in .18s var(--ease); transform-origin: top; }
#page > * { animation: rise .35s var(--ease) both; }
#page > .skel { animation: none; }
.msg:not(:empty) { animation: rise .25s var(--ease); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* Info-Symbol mit Mini-Fenster */
.publish-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.info { position: relative; display: inline-flex; }
.info-btn { width: 22px; height: 22px; padding: 0; border-radius: 50%; background: transparent; border: 1px solid var(--border-strong); color: var(--muted); font: italic 700 13px/1 Georgia, serif; display: grid; place-items: center; }
.info-btn:hover, .info.open .info-btn { background: var(--accent-soft); border-color: rgba(139, 92, 246, .5); color: var(--text); }
.info-pop { position: absolute; z-index: 15; top: calc(100% + 8px); left: -10px; width: 260px; max-width: min(280px, 78vw); padding: 10px 12px; background: #17171e; border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55); color: var(--text); font-size: 13px; font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: 0; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity var(--t), transform var(--t), visibility 0s linear .22s; pointer-events: none; }
.info:hover .info-pop, .info:focus-within .info-pop, .info.open .info-pop { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

