/* Aufgabenplaner – Stylesheet (hell/dunkel, mobil) */
:root {
    --bg: #f4f6fa;
    --card: #ffffff;
    --card-2: #f8fafc;
    --border: #e2e8f0;
    --border-2: #cbd5e1;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-h: #1d4ed8;
    --primary-bg: #eff6ff;
    --ok: #15803d; --ok-bg: #dcfce7;
    --bad: #b91c1c; --bad-bg: #fee2e2;
    --warn: #b45309; --warn-bg: #fef3c7;
    --info: #1d4ed8; --info-bg: #dbeafe;
    --violet: #6d28d9; --violet-bg: #ede9fe;
    --p1: #dc2626; --p2: #f97316; --p3: #94a3b8; --p4: #cbd5e1;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, .14);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1120; --card: #131c2e; --card-2: #182338; --border: #24324a; --border-2: #334462;
        --text: #e2e8f0; --muted: #94a3b8; --primary: #3b82f6; --primary-h: #60a5fa; --primary-bg: #172554;
        --ok: #4ade80; --ok-bg: #14532d; --bad: #f87171; --bad-bg: #450a0a; --warn: #fbbf24; --warn-bg: #422006;
        --info: #93c5fd; --info-bg: #1e3a8a; --violet: #c4b5fd; --violet-bg: #2e1065;
        --p3: #64748b; --p4: #334155;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif }
a { color: var(--primary); text-decoration: none }
a:hover { text-decoration: underline }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 .25rem; letter-spacing: -.01em }
h2 { font-size: 1.08rem; margin: 0 0 .6rem }
h3 { font-size: .95rem; margin: 0 0 .5rem }
p { margin: .4rem 0 }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em }
code { background: var(--card-2); padding: .05em .35em; border-radius: 4px; border: 1px solid var(--border) }
pre.code { background: var(--card-2); border: 1px solid var(--border); padding: .7rem; border-radius: 8px; overflow-x: auto; white-space: pre-wrap }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0 }
.muted { color: var(--muted) }
.small { font-size: .85rem }
.center { text-align: center }
.right { text-align: right }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
.warn-t { color: var(--bad) }
.ok-t { color: var(--ok) }
[hidden] { display: none !important }

/* ---------- Kopfzeile ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem;
    background: var(--card); border-bottom: 1px solid var(--border); padding: .5rem 1.25rem; min-height: 56px;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); white-space: nowrap }
.brand:hover { text-decoration: none }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 800 }
.mainnav { display: flex; gap: .15rem; flex: 1; min-width: 0 }
.mainnav a { color: var(--muted); padding: .4rem .65rem; border-radius: 7px; font-weight: 500; white-space: nowrap }
.mainnav a:hover { background: var(--card-2); color: var(--text); text-decoration: none }
.mainnav a.active { color: var(--primary); background: var(--primary-bg) }
.top-actions { display: flex; align-items: center; gap: .6rem }
.quicksearch input { width: 11rem; padding: .4rem .7rem; border-radius: 20px; background: var(--card-2) }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 7px; font-size: 1.1rem; padding: .25rem .6rem; color: var(--text); cursor: pointer }
.bell { position: relative; color: var(--muted); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50% }
.bell:hover { background: var(--card-2); color: var(--text) }
.bell .count { position: absolute; top: 1px; right: -2px; background: var(--p1); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 0 5px; line-height: 16px }

.menu { position: relative }
.menu > summary { list-style: none; cursor: pointer }
.menu > summary::-webkit-details-marker { display: none }
.menu-list { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .35rem; z-index: 50 }
.menu-list.right, .new-menu .menu-list { right: 0; left: auto }
.menu-list a { display: block; padding: .5rem .7rem; border-radius: 7px; color: var(--text) }
.menu-list a:hover { background: var(--card-2); text-decoration: none }
.menu-list a small { display: block; color: var(--muted); font-size: .8rem }
.menu-head { padding: .5rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem }
.menu-head small { display: block; color: var(--muted) }

/* ---------- Layout ---------- */
.container { max-width: 1240px; margin: 1.25rem auto 3rem; padding: 0 1.25rem }
.container.wide { max-width: none }
.narrow-page { max-width: 760px; margin: 0 auto }
.narrow-page.wide-ish { max-width: 980px }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap }
.head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow) }
.card.flush { padding: 0; overflow: hidden }
.card > header { margin-bottom: .6rem }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap }
.row-end { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem }
.grid-2.top, .grid-3.top { align-items: start; gap: 1rem }
.grid-2.tight { gap: 0 .5rem }
.notice { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); padding: .6rem .9rem; border-radius: 8px; margin-bottom: 1rem }
.empty-state { text-align: center; padding: 2.5rem 1rem }
.empty-state .big { font-size: 2.5rem }
.crumbs { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: .5rem }
.subnav { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); overflow-x: auto }
.subnav a { padding: .5rem .8rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap }
.subnav a.on { color: var(--primary); border-color: var(--primary) }
.subnav a:hover { text-decoration: none; color: var(--text) }

/* ---------- Formulare ---------- */
label { display: block; font-size: .87rem; font-weight: 500; margin: .7rem 0 .25rem }
label.inl { display: inline-flex; align-items: center; gap: .35rem; margin: 0 }
.label { display: block; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .4rem }
input, select, textarea {
    width: 100%; padding: .5rem .65rem; font: inherit; font-size: .95rem; color: var(--text);
    background: var(--card); border: 1px solid var(--border-2); border-radius: 7px; margin-top: .2rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary) }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 .35rem 0 0; accent-color: var(--primary) }
input[type=color] { padding: .15rem; height: 2.4rem }
input[type=range] { padding: 0 }
input[type=file] { padding: .35rem }
textarea { resize: vertical; line-height: 1.45 }
label > input, label > select, label > textarea { font-weight: 400 }
.check { display: flex; align-items: center; gap: .3rem; font-weight: 400; margin: .3rem 0; cursor: pointer }
.check.inline { display: inline-flex; margin: 0 }
.check-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: .2rem .5rem; margin-top: .3rem }
.check-list.plain { max-height: none; border: 0; padding: 0 }
.filter-input { margin-bottom: .2rem }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start }
.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: .8rem; flex-wrap: wrap }
.form-actions.sticky { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: .75rem 0; border-top: 1px solid var(--border) }

.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; flex-wrap: wrap }
.seg label { margin: 0; font-weight: 500 }
.seg input { position: absolute; opacity: 0; pointer-events: none }
.seg span { display: block; padding: .35rem .75rem; border-radius: 6px; cursor: pointer; font-size: .88rem; color: var(--muted) }
.seg input:checked + span { background: var(--card); color: var(--text); box-shadow: var(--shadow) }
.seg input:focus-visible + span { outline: 2px solid var(--primary) }
.seg.small span { padding: .25rem .6rem; font-size: .82rem }
.seg.prio input:checked + span { color: #fff }
.seg.prio .p1 input:checked + span { background: var(--p1) }
.seg.prio .p2 input:checked + span { background: var(--p2) }
.seg.prio .p3 input:checked + span { background: #64748b }
.seg.prio .p4 input:checked + span { background: #94a3b8 }
.quick-dates, .quick-btns { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem }
.quick-dates button { font: inherit; font-size: .78rem; padding: .15rem .5rem; border-radius: 12px; border: 1px solid var(--border); background: var(--card-2); color: var(--muted); cursor: pointer }
.quick-dates button:hover { color: var(--primary); border-color: var(--primary) }

.switch { display: flex; align-items: center; gap: .5rem; cursor: pointer }
.switch input { position: absolute; opacity: 0 }
.switch span { width: 38px; height: 22px; border-radius: 11px; background: var(--border-2); position: relative; transition: .15s; flex: none }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s }
.switch input:checked + span { background: var(--primary) }
.switch input:checked + span::after { left: 19px }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .45rem .9rem;
    border: 1px solid var(--border-2); border-radius: 7px; background: var(--card); color: var(--text);
    font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.btn:hover { background: var(--card-2); text-decoration: none }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff }
.btn.primary:hover { background: var(--primary-h) }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff }
@media (prefers-color-scheme: dark) { .btn.success { color: #052e16 } }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted) }
.btn.ghost:hover { background: var(--card-2); color: var(--text) }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--bad) }
.btn.danger-ghost:hover { background: var(--bad-bg) }
.btn.small { padding: .25rem .6rem; font-size: .82rem }
.btn.big { padding: .7rem 1.4rem; font-size: 1rem }
.btn.block { width: 100%; margin-top: .8rem; padding: .6rem }
summary.btn { list-style: none }
.linkish { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0 }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 .25rem; border-radius: 4px }
.x:hover { color: var(--bad); background: var(--bad-bg) }
form.inline { display: inline }
.file-btn { position: relative; overflow: hidden; margin: .5rem 0 0 }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer }
.chip-btn { font: inherit; font-size: .72rem; padding: .05rem .45rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card-2); color: var(--muted); cursor: pointer }
.chip-btn.on { background: var(--primary-bg); color: var(--primary); border-color: transparent; font-weight: 600 }

/* ---------- Flash ---------- */
.flashes { max-width: 1240px; margin: .8rem auto 0; padding: 0 1.25rem }
.flash { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem }
.flash button { background: none; border: 0; font-size: 1.2rem; color: inherit; cursor: pointer; opacity: .6 }
.flash-ok { background: var(--ok-bg); color: var(--ok) }
.flash-error { background: var(--bad-bg); color: var(--bad) }

/* ---------- Badges & Chips ---------- */
.badge { display: inline-block; padding: .08rem .5rem; border-radius: 10px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: var(--card-2); color: var(--muted) }
.st-new { background: var(--violet-bg); color: var(--violet) }
.st-open { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2) }
.st-in_progress { background: var(--info-bg); color: var(--info) }
.st-waiting { background: var(--warn-bg); color: var(--warn) }
.st-done { background: var(--ok-bg); color: var(--ok) }
.st-closed, .st-rejected { background: var(--card-2); color: var(--muted) }
.pr-1 { background: var(--p1); color: #fff }
.pr-2 { background: color-mix(in srgb, var(--p2) 18%, transparent); color: var(--p2) }
.pr-3 { background: var(--card-2) }
.pr-4 { background: var(--card-2); color: var(--muted) }
.ps-active { background: var(--ok-bg); color: var(--ok) }
.ps-planned { background: var(--violet-bg); color: var(--violet) }
.ps-paused { background: var(--warn-bg); color: var(--warn) }
.ps-done, .ps-archived { background: var(--card-2); color: var(--muted) }
.chip { --c: #64748b; display: inline-flex; align-items: center; gap: .3rem; padding: .05rem .5rem; border-radius: 10px; font-size: .74rem; font-weight: 500; white-space: nowrap;
    background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--text)); max-width: 16rem; overflow: hidden; text-overflow: ellipsis }
.chip.team::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c) }
.chip.ticket { --c: #7c3aed }
.swatch { --c: #64748b; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none }
.diamond { --c: var(--primary); display: inline-block; width: 10px; height: 10px; background: var(--c); transform: rotate(45deg); margin-right: .45rem; flex: none }
.count { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--muted); background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 .45rem; vertical-align: middle }
.avatar { --h: 210; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
    background: hsl(var(--h) 65% 88%); color: hsl(var(--h) 55% 30%); font-size: .72rem; font-weight: 700; letter-spacing: .02em }
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--h) 40% 25%); color: hsl(var(--h) 70% 85%) } }
.avatar.sm { width: 24px; height: 24px; font-size: .62rem }
.avatar.xs { width: 20px; height: 20px; font-size: .55rem }
.avatar.more { --h: 220; filter: saturate(0) }
.avatars { display: inline-flex }
.avatars .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--card) }
.user-menu .avatar { width: 34px; height: 34px; font-size: .8rem }

/* ---------- Kennzahlen ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem }
.stat { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; color: var(--text); box-shadow: var(--shadow); border-left: 4px solid var(--border) }
a.stat:hover { text-decoration: none; border-color: var(--primary) }
.stat b { display: block; font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums }
.stat span { font-size: .82rem; color: var(--muted) }
.stat.bad { border-left-color: var(--p1) } .stat.bad b { color: var(--bad) }
.stat.warn { border-left-color: var(--p2) } .stat.warn b { color: var(--warn) }
.stat.info { border-left-color: var(--primary) }
.stat.ok { border-left-color: var(--ok) }
.stat .bar { margin-top: .4rem }
.bar { height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); margin: .3rem 0 }
.bar span { display: block; height: 100%; background: var(--ok); border-radius: 3px }
.bar.over span { background: var(--p1) }
.bar.thin { height: 4px }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start }
.bucket { border-left: 4px solid var(--border); padding: .8rem 1rem }
.bucket > details > summary, .bucket > header { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap }
.bucket > header { cursor: default; flex-direction: column; gap: 0 }
.bucket > details > summary::-webkit-details-marker { display: none }
.bucket > details > summary h2::before { content: "▸"; display: inline-block; width: 1rem; color: var(--muted); transition: transform .15s }
.bucket > details[open] > summary h2::before { transform: rotate(90deg) }
.bucket h2 { margin: 0 }
.bucket .task-list { margin-top: .5rem }
.bucket.over { border-left-color: var(--p1) }
.bucket.today { border-left-color: var(--p2) }
.bucket.q { border-left-color: var(--primary); background: color-mix(in srgb, var(--primary-bg) 45%, var(--card)) }
.bucket.fu { border-left-color: #a855f7 }
.bucket.imp { border-left-color: var(--p2) }
.bucket.lead { border-left-color: #0ea5e9 }
.bucket.wait { border-left-color: #eab308 }
.bucket.low, .bucket.plan { border-left-color: var(--border-2) }
.feed { list-style: none; padding: 0; margin: 0 }
.feed li { padding: .45rem 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .1rem }
.feed li:last-child { border-bottom: 0 }
.feed li a { color: var(--text); display: flex; align-items: center }
.feed small { font-size: .78rem }

/* ---------- Aufgabenliste ---------- */
.task-list { display: flex; flex-direction: column }
.task-row { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .55rem .8rem .55rem .9rem; color: var(--text);
    border-bottom: 1px solid var(--border); position: relative }
.card:not(.flush) .task-row { margin: 0 -.5rem; border-radius: 7px; border-bottom: 0 }
.task-row::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--p3) }
.task-row.pr-l1::before { background: var(--p1) } .task-row.pr-l2::before { background: var(--p2) } .task-row.pr-l4::before { background: var(--p4) }
.task-row:hover { background: var(--card-2); text-decoration: none }
.task-row:last-child { border-bottom: 0 }
.task-row.closed .tr-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-2) }
.tr-main { min-width: 0; flex: 1 }
.tr-title { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis }
.tr-id { color: var(--muted); font-weight: 500; font-size: .82em; font-variant-numeric: tabular-nums; margin-right: .2rem }
.tr-meta { display: flex; gap: .35rem .5rem; flex-wrap: wrap; align-items: center; margin-top: .15rem; font-size: .8rem; color: var(--muted) }
.meta-i { white-space: nowrap }
.tr-side { display: flex; align-items: center; gap: .6rem; flex: none }
.due { font-size: .8rem; font-weight: 600; padding: .1rem .45rem; border-radius: 6px; background: var(--card-2); color: var(--muted); white-space: nowrap }
.due.over { background: var(--bad-bg); color: var(--bad) }
.due.today { background: var(--warn-bg); color: var(--warn) }
.presets { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem }
.pill { padding: .25rem .75rem; border-radius: 15px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: .85rem }
.pill:hover { color: var(--text); text-decoration: none; border-color: var(--border-2) }
.pill.on { background: var(--primary-bg); color: var(--primary); border-color: transparent; font-weight: 600 }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem }
.filters input, .filters select { width: auto; margin: 0; padding: .35rem .5rem; font-size: .85rem; max-width: 14rem }
.filters input[type=search] { min-width: 10rem }
.filters.compact { padding: .5rem }
.group-h { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 1rem 0 .2rem }
.quick-add { display: flex; gap: .4rem; margin-top: .7rem; flex-wrap: wrap }
.quick-add input, .quick-add select { margin: 0; width: auto }
.quick-add input[name=title] { flex: 1; min-width: 12rem }
.quick-add.small select { flex: 1 }

/* ---------- Aufgabe Detail ---------- */
.task-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; padding-left: .9rem; border-left: 4px solid var(--p3) }
.task-head.pr-l1 { border-left-color: var(--p1) } .task-head.pr-l2 { border-left-color: var(--p2) } .task-head.pr-l4 { border-left-color: var(--p4) }
.task-badges { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin-bottom: .3rem }
.task-grid, .project-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start }
.callout { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid }
.callout.question { background: var(--primary-bg); border-color: color-mix(in srgb, var(--primary) 35%, transparent) }
.callout.wait { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text) }
.answer-form { display: flex; gap: .5rem; margin-top: .5rem; align-items: flex-end }
.answer-form textarea { flex: 1 }
.prose { overflow-wrap: anywhere }
.prose > :first-child { margin-top: 0 }
.prose h2 { font-size: 1.15rem; margin: 1rem 0 .4rem } .prose h3 { font-size: 1rem; margin: .9rem 0 .3rem } .prose h4 { font-size: .95rem; margin: .8rem 0 .3rem }
.prose ul, .prose ol { padding-left: 1.3rem; margin: .4rem 0 }
.prose ul.checklist { list-style: none; padding-left: .2rem }
.prose ul.checklist li.done { color: var(--muted); text-decoration: line-through }
.details dl, dl.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; margin: 0; font-size: .9rem }
.details dt, dl.kv dt { color: var(--muted) }
.details dd, dl.kv dd { margin: 0; min-width: 0 }
.people { list-style: none; padding: 0; margin: 0 0 .4rem }
.people li { display: flex; align-items: center; gap: .45rem; padding: .2rem 0 }
.inline-edit { margin-top: .3rem }
.inline-edit > summary { cursor: pointer; color: var(--primary); list-style: none }
.inline-edit > summary::-webkit-details-marker { display: none }
.inline-edit form { margin-top: .4rem; display: flex; flex-direction: column; gap: .35rem }
.inline-edit form input, .inline-edit form select { margin: 0 }
.inline-edit.inline { display: inline-block }
.effort { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem }
.effort b { display: block; font-size: 1.15rem }
.time-form { display: flex; flex-direction: column; gap: .35rem; margin-top: .6rem }
.time-form input { margin: 0 }
.entries { list-style: none; padding: 0; margin: .4rem 0; font-size: .85rem }
.entries li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--border) }
.links { list-style: none; padding: 0; margin: 0 0 .3rem }
.links li { display: flex; justify-content: space-between; align-items: center; gap: .4rem; padding: .3rem 0 }
.links li a { display: flex; align-items: center; gap: .45rem; min-width: 0; overflow-wrap: anywhere }
.lk-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--card-2); flex: none; font-size: .85rem }
.lk-ico.nextcloud { background: #e0f2fe; color: #0082c9 }
@media (prefers-color-scheme: dark) { .lk-ico.nextcloud { background: #0c4a6e; color: #7dd3fc } }
.link-form small { line-height: 1.35 }
.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin-top: 1rem }
.att { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: .4rem; font-size: .8rem; background: var(--card-2) }
.att a { display: flex; flex-direction: column; gap: .3rem; color: var(--text); word-break: break-word }
.att img { width: 100%; height: 90px; object-fit: cover; border-radius: 5px }
.att .file-ico { font-size: 2rem; text-align: center; padding: .6rem 0 }
.att form { position: absolute; top: 2px; right: 2px }
.side-actions { display: flex; gap: .4rem; justify-content: flex-end }

.timeline { list-style: none; padding: 0; margin: 0 0 1rem; position: relative }
.timeline::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--border) }
.ev { position: relative; padding: .35rem 0 .35rem 2rem }
.ev-sys { font-size: .82rem; color: var(--muted) }
.ev-sys::before { content: ""; position: absolute; left: 7px; top: .7rem; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--border-2) }
.ev-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .88rem; margin-left: -2rem }
.ev-head .avatar { box-shadow: 0 0 0 3px var(--card) }
.ev-body { background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .75rem; margin-top: .3rem; font-size: .93rem }
.ev-kind { font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 8px; background: var(--card-2); color: var(--muted) }
.ev-question .ev-body { background: var(--primary-bg); border-color: color-mix(in srgb, var(--primary) 25%, transparent) }
.ev-question .ev-kind { background: var(--primary-bg); color: var(--primary) }
.ev-answer .ev-body { background: var(--ok-bg); border-color: transparent }
.ev-answer .ev-kind { background: var(--ok-bg); color: var(--ok) }
.ev-forward .ev-kind { background: var(--violet-bg); color: var(--violet) }
.ev-internal .ev-body { background: var(--warn-bg); border-style: dashed }
.ev-internal .ev-kind { background: var(--warn-bg); color: var(--warn) }
.composer { border-top: 1px solid var(--border); padding-top: .8rem }
.tabs { display: flex; gap: .2rem; margin-bottom: .5rem }
.tabs button { font: inherit; font-size: .88rem; padding: .35rem .75rem; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer }
.tabs button.active { background: var(--primary-bg); color: var(--primary); font-weight: 600 }
.tab-pane { display: none }
.tab-pane.active { display: block }
.tab-pane textarea { margin-bottom: .4rem }

/* ---------- Projekte ---------- */
.project-hero { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; padding: 1rem 1.2rem; border-radius: var(--radius);
    background: linear-gradient(120deg, color-mix(in srgb, var(--c) 14%, var(--card)), var(--card) 70%); border: 1px solid var(--border); border-top: 4px solid var(--c) }
.project-hero .lead { font-size: 1.02rem; max-width: 60rem }
.overview .prose { font-size: .97rem }
.proj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem }
.proj-card { --c: var(--primary); display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem; border-radius: 8px; border: 1px solid var(--border); border-left: 4px solid var(--c); color: var(--text); background: var(--card-2) }
.proj-card:hover { text-decoration: none; border-color: var(--c) }
.proj-card.archived { opacity: .6 }
.milestones { list-style: none; padding: 0; margin: 0 }
.milestones li { display: flex; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--border) }
.milestones li .diamond { margin-top: .4rem }
.milestones li.done b { text-decoration: line-through; color: var(--muted) }
.milestones li.done .diamond { opacity: .4 }
.milestones li.late .diamond { --c: var(--p1) !important }
.ms-body { flex: 1; min-width: 0 }
.ms-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .2rem }
.tree-table, .table { width: 100%; border-collapse: collapse }
.tree-table th, .tree-table td, .table th, .table td { padding: .55rem .8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle }
.tree-table th, .table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--card-2) }
.tree-table td .bar { width: 120px; display: inline-block; vertical-align: middle; margin-right: .4rem }
.tree-name { display: inline-flex; align-items: center; gap: .5rem; color: var(--text) }
.tree-table tr.area td { background: color-mix(in srgb, var(--card-2) 60%, transparent) }
tr.archived { opacity: .55 }
.table.compact td, .table.compact th { padding: .35rem .5rem }
.table td a { display: inline-flex; align-items: center; gap: .4rem }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; align-items: start }
.role-grid .card { margin: 0 }
.role-grid input { margin-bottom: .3rem }

/* ---------- Ticketformular ---------- */
.team-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .5rem; margin-bottom: .4rem }
.team-pick label { --c: var(--primary); margin: 0; cursor: pointer }
.team-pick input { position: absolute; opacity: 0 }
.team-pick span { display: flex; flex-direction: column; padding: .7rem .8rem; border: 2px solid var(--border); border-radius: 9px; height: 100%; border-left: 5px solid var(--c) }
.team-pick small { color: var(--muted); font-weight: 400 }
.team-pick input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--card)) }
.team-pick input:focus-visible + span { outline: 2px solid var(--primary) }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: .8rem; overflow-x: auto; padding-bottom: 1rem; align-items: start }
.kb-col { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 200px); min-height: 200px }
.kb-col > header { padding: .65rem .8rem; font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .45rem; border-bottom: 1px solid var(--border) }
.kb-col .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--p3) }
.st-col-new .dot { background: #8b5cf6 } .st-col-in_progress .dot { background: var(--primary) } .st-col-waiting .dot { background: #eab308 } .st-col-done .dot { background: var(--ok) }
.kb-cards { padding: .5rem; display: flex; flex-direction: column; gap: .5rem; overflow-y: auto; flex: 1; min-height: 80px }
.kb-cards.over { background: color-mix(in srgb, var(--primary) 8%, transparent); outline: 2px dashed color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: -4px; border-radius: 8px }
.kb-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .65rem; box-shadow: var(--shadow); cursor: grab; border-left: 3px solid var(--p3); display: flex; flex-direction: column; gap: .35rem }
.kb-card.pr-l1 { border-left-color: var(--p1) } .kb-card.pr-l2 { border-left-color: var(--p2) } .kb-card.pr-l4 { border-left-color: var(--p4) }
.kb-card.locked { cursor: default }
.kb-card.dragging { opacity: .45 }
.kb-card.saving { opacity: .7 }
.kb-title { color: var(--text); font-weight: 500; font-size: .9rem; line-height: 1.35 }
.kb-meta { display: flex; flex-wrap: wrap; gap: .25rem }
.kb-foot { display: flex; justify-content: space-between; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted) }
.kb-foot > span:first-child { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center }

/* ---------- Gantt ---------- */
.gantt { --row: 34px; --label: 280px; position: relative; overflow: auto; max-height: calc(100vh - 220px); user-select: none }
.g-grid { position: relative }
.g-head { position: sticky; top: 0; z-index: 4; background: var(--card); display: flex; border-bottom: 1px solid var(--border) }
.g-head-label { position: sticky; left: 0; z-index: 5; width: var(--label); flex: none; background: var(--card); border-right: 1px solid var(--border); padding: .4rem .7rem; font-size: .78rem; font-weight: 600; color: var(--muted); display: flex; align-items: flex-end }
.g-scale { position: relative; height: 46px; flex: none }
.g-scale .g-top, .g-scale .g-bot { position: absolute; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; border-left: 1px solid var(--border); padding-left: 4px }
.g-scale .g-top { top: 0; height: 22px; line-height: 22px; font-weight: 600; color: var(--text) }
.g-scale .g-bot { top: 22px; height: 24px; line-height: 24px; border-top: 1px solid var(--border) }
.g-scale .g-bot.we { background: color-mix(in srgb, var(--card-2) 80%, transparent) }
.g-row { display: flex; height: var(--row); border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent) }
.g-row:hover { background: color-mix(in srgb, var(--primary) 4%, transparent) }
.g-label { position: sticky; left: 0; z-index: 3; width: var(--label); flex: none; background: var(--card); border-right: 1px solid var(--border); padding: 0 .7rem; display: flex; align-items: center; gap: .4rem; font-size: .84rem; overflow: hidden; white-space: nowrap }
.g-label a { color: var(--text); overflow: hidden; text-overflow: ellipsis }
.g-label.sub { padding-left: 1.7rem }
.g-label .tr-id { flex: none }
.g-row.group .g-label { font-weight: 700; background: var(--card-2) }
.g-row.group { background: color-mix(in srgb, var(--card-2) 60%, transparent) }
.g-track { position: relative; flex: none }
.g-bar { position: absolute; top: 7px; height: calc(var(--row) - 14px); border-radius: 5px; background: color-mix(in srgb, var(--c) 30%, var(--card)); border: 1px solid var(--c); overflow: hidden; font-size: .72rem; line-height: calc(var(--row) - 16px); padding: 0 .4rem; color: var(--text); white-space: nowrap; cursor: pointer; min-width: 6px }
.g-bar .g-prog { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--c) 55%, transparent); z-index: 0 }
.g-bar span { position: relative; z-index: 1 }
.g-bar.done { opacity: .55 }
.g-bar.overdue { border-color: var(--p1); box-shadow: inset 0 0 0 1px var(--p1) }
.g-bar.editable { cursor: grab }
.g-bar .g-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2 }
.g-bar.point { width: 14px !important; min-width: 14px; padding: 0; border-radius: 50%; top: 10px; height: 14px }
.g-bar.project { height: 8px; top: 13px; padding: 0; border-radius: 4px; background: var(--c); cursor: default }
.g-ms { position: absolute; top: 9px; width: 15px; height: 15px; transform: rotate(45deg); background: var(--c); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--c); margin-left: -7px; z-index: 2 }
.g-ms.done { opacity: .45 }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--p1); z-index: 2; pointer-events: none; opacity: .7 }
.g-weekend { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--muted) 9%, transparent); pointer-events: none }
.g-tip { position: fixed; z-index: 100; background: var(--text); color: var(--card); font-size: .78rem; padding: .4rem .6rem; border-radius: 6px; pointer-events: none; max-width: 320px; box-shadow: var(--shadow-lg) }

/* ---------- Auswertung ---------- */
table.bars { width: 100%; border-collapse: collapse; font-size: .88rem }
table.bars td { padding: .3rem .3rem }
table.bars .lbl { width: 40%; overflow: hidden; text-overflow: ellipsis; max-width: 0; white-space: nowrap }
table.bars .barcell { width: 40% }
.hbar { display: block; height: 14px; background: var(--primary); border-radius: 3px; min-width: 2px }
.hbar.alt { background: #0d9488 }

/* ---------- Benachrichtigungen ---------- */
.notif-list { list-style: none; margin: 0; padding: 0 }
.notif-list li a { display: flex; gap: .7rem; padding: .7rem 1rem; color: var(--text); border-bottom: 1px solid var(--border); align-items: flex-start }
.notif-list li a:hover { background: var(--card-2); text-decoration: none }
.notif-list li a small { display: block; font-size: .78rem }
.notif-list li.unread a { background: color-mix(in srgb, var(--primary-bg) 60%, transparent); font-weight: 500 }
.n-ico { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); margin-top: .45rem; flex: none }
.unread .n-ico { background: var(--primary) }
.n-ico.ev-overdue { background: var(--p1) }

/* ---------- Anmeldung ---------- */
.auth-wrap { min-height: 80vh; display: grid; place-items: center }
.auth-card { width: 100%; max-width: 400px; padding: 1.6rem }
.auth-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem }
.auth-brand h1 { margin: 0; font-size: 1.3rem }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
    .quicksearch { display: none }
    .dash-grid, .task-grid, .project-grid { grid-template-columns: minmax(0, 1fr) }
    .form-grid { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 860px) {
    .topbar { flex-wrap: wrap; padding: .5rem .8rem; gap: .5rem }
    .nav-toggle { display: block; order: 2 }
    .brand { flex: 1 }
    .top-actions { order: 3 }
    .mainnav { display: none; order: 4; flex-basis: 100%; flex-direction: column; padding: .3rem 0 }
    .nav-open .mainnav { display: flex }
    .mainnav a { padding: .6rem .7rem }
    .brand span:last-child { max-width: 9rem; overflow: hidden; text-overflow: ellipsis }
}
@media (max-width: 640px) {
    body { font-size: 15px }
    .container { padding: 0 .75rem; margin-top: .9rem }
    .flashes { padding: 0 .75rem }
    .grid-2, .grid-3 { grid-template-columns: 1fr }
    .grid-2.tight { grid-template-columns: 1fr 1fr }
    .hide-sm { display: none }
    h1 { font-size: 1.3rem }
    .stats { grid-template-columns: repeat(2, 1fr) }
    .task-row { flex-wrap: wrap; gap: .3rem }
    .tr-side { width: 100%; justify-content: space-between }
    .filters input, .filters select { max-width: none; flex: 1 1 45% }
    .new-menu .menu-list { position: fixed; left: .75rem; right: .75rem; top: 56px }
    .kanban { grid-template-columns: repeat(5, 82vw); scroll-snap-type: x mandatory }
    .kb-col { scroll-snap-align: start }
    .gantt { --label: 150px }
    .answer-form { flex-direction: column; align-items: stretch }
    .tree-table td .bar { width: 60px }
}
@media (max-width: 480px) {
    .brand span:last-child, .hide-xs { display: none }
    .topbar { flex-wrap: nowrap }
    .nav-open .topbar { flex-wrap: wrap }
    .top-actions { gap: .35rem }
    .mainnav { order: 5 }
}
@media print {
    .topbar, .composer, .head-actions, .inline-edit, .quick-add, .side-actions, .filters, .presets { display: none !important }
    body { background: #fff }
    .card { box-shadow: none; break-inside: avoid }
}

/* ---------- Projektrechte ---------- */
.acc-view { background: var(--card-2); color: var(--muted) }
.acc-work { background: var(--info-bg); color: var(--info) }
.acc-manage { background: var(--violet-bg); color: var(--violet) }
.acc-list li { gap: .4rem }
.acc-list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.acc-select { width: auto; margin: 0; padding: .1rem .3rem; font-size: .78rem }
.callout.scan { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--text) }
img.qr { width: 180px; height: 180px; image-rendering: pixelated; background: #fff; padding: 4px; border-radius: 6px }
.copy-row { display: flex; gap: .4rem; align-items: center }
.copy-row input { margin: 0; font-family: ui-monospace, monospace; font-size: .8rem }
.dep-list { list-style: none; padding: 0; margin: .2rem 0 .4rem }
.dep-list li { display: flex; justify-content: space-between; gap: .4rem; padding: .2rem 0; font-size: .9rem }
.dep-list li.done a { color: var(--muted); text-decoration: line-through }
.seen { color: var(--muted); font-size: .72rem }
.g-deps { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; color: var(--muted); overflow: visible }
.g-deps path { fill: none; stroke: currentColor; stroke-width: 1.4 }
.g-deps path.conflict { stroke: var(--p1); color: var(--p1); stroke-dasharray: 4 3 }
.g-grid { position: relative }
.wl-wrap { overflow-x: auto }
.wl th, .wl td { white-space: nowrap }
.wl-c { font-variant-numeric: tabular-nums; font-size: .85rem }
.wl-c.low, .wl-key.low { background: color-mix(in srgb, var(--ok) 12%, transparent) }
.wl-c.mid, .wl-key.mid { background: color-mix(in srgb, var(--ok) 28%, transparent) }
.wl-c.high, .wl-key.high { background: color-mix(in srgb, var(--p2) 30%, transparent) }
.wl-c.over, .wl-key.over { background: color-mix(in srgb, var(--p1) 35%, transparent); font-weight: 700 }
.wl-key { padding: .05rem .4rem; border-radius: 4px }
input.hours { width: 3.6rem; margin: 0; padding: .15rem .3rem; text-align: right }
.pill.saved { display: inline-flex; align-items: center; gap: .3rem }
.pill.saved a { color: inherit }
.save-filter > summary { list-style: none; cursor: pointer }
.save-filter form { position: absolute; z-index: 30; margin-top: .3rem; width: 260px; display: flex; flex-direction: column; gap: .4rem }
.sel-row { display: flex; align-items: center; border-bottom: 1px solid var(--border) }
.sel-row:last-child { border-bottom: 0 }
.sel-row > input { margin: 0 0 0 .8rem; flex: none; width: 1.05rem; height: 1.05rem }
.sel-row .task-row { flex: 1; min-width: 0; border-bottom: 0 }
.bulk-bar { position: sticky; top: 64px; z-index: 20; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: var(--primary-bg); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); border-radius: var(--radius); padding: .5rem .7rem; margin-bottom: .6rem }
.bulk-bar select, .bulk-bar input:not([type=checkbox]) { width: auto; margin: 0; padding: .3rem .4rem; font-size: .85rem }
.bulk-bar [data-for] { display: inline-flex; gap: .4rem; align-items: center }
.bulk-bar [hidden] { display: none !important }
.nc-btn { background: #0082c9; border-color: #0082c9; color: #fff; margin-top: 0 }
.nc-btn:hover { background: #006aa3; color: #fff }
.or { text-align: center; position: relative; margin: 1rem 0 0; color: var(--muted); font-size: .85rem }
.or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border) }
.or span { position: relative; background: var(--card); padding: 0 .6rem }

.mention { background: var(--primary-bg); color: var(--primary); border-radius: 4px; padding: 0 .2rem; font-weight: 500 }
.mention-box { position: absolute; z-index: 300; list-style: none; margin: 0; padding: .25rem; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); min-width: 200px }
.mention-box li { padding: .35rem .6rem; border-radius: 6px; cursor: pointer; font-size: .9rem }
.mention-box li.on, .mention-box li:hover { background: var(--primary-bg); color: var(--primary) }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden }
.public { padding-top: 1rem }
.public .auth-brand h1 { font-size: 1.25rem }
.weekly table { max-width: 100% }
@media (max-width: 640px) { .weekly { overflow-x: auto } }

/* ---------- Raumbuchung ---------- */
.week-wrap { overflow-x: auto }
.table.week { table-layout: fixed; min-width: 900px }
.table.week th:first-child { width: 170px }
.table.week th.today, .table.week td.today { background: color-mix(in srgb, var(--primary-bg) 60%, transparent) }
.table.week th.res { font-weight: 600; font-size: .88rem; text-transform: none; letter-spacing: 0; color: var(--text); background: var(--card) }
.table.week td.slot { vertical-align: top; padding: .3rem; height: 3.2rem; position: relative }
.bk { display: block; font-size: .75rem; line-height: 1.25; padding: .2rem .35rem; border-radius: 5px; margin-bottom: .2rem; background: var(--info-bg); color: var(--text); border-left: 3px solid var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.bk.requested { background: var(--warn-bg); border-left-color: #eab308 }
.bk:hover { text-decoration: none; filter: brightness(.97) }
.slot .add { position: absolute; right: .25rem; bottom: .15rem; font-size: .9rem; color: var(--muted); opacity: 0; padding: 0 .3rem; border-radius: 4px }
.slot:hover .add, .slot .add:focus { opacity: 1; background: var(--card-2) }
@media (hover: none) { .slot .add { opacity: .6 } }
tr.late-row td { background: color-mix(in srgb, var(--bad-bg) 50%, transparent) }
details.card > summary { cursor: pointer; list-style: none }
details.card > summary::-webkit-details-marker { display: none }

/* ---------- Rundgänge ---------- */
.check-card { border-left: 4px solid var(--border) }
.check-card.over { border-left-color: var(--p1) }
.check-card.soon { border-left-color: var(--p2) }
.run-h { margin: 0; padding: .6rem 1rem; background: var(--card-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border) }
.run-item { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--border) }
.run-item.r-ok { background: color-mix(in srgb, var(--ok-bg) 35%, transparent) }
.run-item.r-defect { background: color-mix(in srgb, var(--bad-bg) 45%, transparent) }
.run-item.r-na { opacity: .7 }
.run-defect { grid-column: 1 / -1; display: none; gap: .4rem; align-items: center }
.run-item.r-defect .run-defect { display: flex }
.run-defect input[name^="n["] { margin: 0; flex: 1 }
.run-defect .file-btn { margin: 0 }
.run-seg span { padding: .45rem .8rem; font-size: .9rem }
.run-seg .ok input:checked + span { background: var(--ok); color: #fff }
.run-seg .def input:checked + span { background: var(--p1); color: #fff }
@media (max-width: 640px) { .run-item { grid-template-columns: 1fr } .run-seg { width: 100% } .run-seg label { flex: 1; text-align: center } }
.lamp { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); vertical-align: middle; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent) }
.lamp.soon { background: var(--p2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p2) 20%, transparent) }
.lamp.over { background: var(--p1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p1) 20%, transparent) }
.tpl-select { width: auto; margin: 0; padding: .25rem .4rem; font-size: .82rem; max-width: 12rem }
.kb-suggest { background: var(--warn-bg); border-radius: 8px; padding: .5rem .8rem; margin-top: .4rem; font-size: .9rem }
.kb-suggest ul { margin: .2rem 0 0; padding-left: 1.2rem }

/* ---------- Budgets ---------- */
.budget { border-left: 4px solid var(--ok) }
.budget.warn { border-left-color: var(--p2) }
.budget.over { border-left-color: var(--p1) }
.bbar { display: flex; height: 12px; background: var(--card-2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: .4rem 0 .7rem }
.bbar .sp { background: var(--primary) }
.bbar .co { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--primary) 45%, transparent) 0 6px, transparent 6px 10px) }
.budget-nums { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) }

/* ---------- Helferplan ---------- */
.shift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; margin-bottom: 1rem }
.shift-grid .card, .public .shift { margin: 0 0 .6rem; border-left: 4px solid var(--p2) }
.shift.full { border-left-color: var(--ok) }
.shift.empty { border-left-color: var(--p1) }
.shift .inline-edit form { max-width: 320px }
@media print { .shift-grid { grid-template-columns: 1fr 1fr } .shift button, .shift form { display: none !important } }
input.otp { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums }

/* ---------- Navigation mit Gruppen ---------- */
.mainnav .navgroup > summary { list-style: none; cursor: pointer; color: var(--muted); padding: .4rem .65rem; border-radius: 7px; font-weight: 500; white-space: nowrap }
.mainnav .navgroup > summary::-webkit-details-marker { display: none }
.mainnav .navgroup > summary:hover { background: var(--card-2); color: var(--text) }
.mainnav .navgroup.active > summary { color: var(--primary); background: var(--primary-bg) }
.mainnav .navgroup .menu-list { min-width: 200px }
.mainnav .navgroup .menu-list a { color: var(--text); padding: .5rem .7rem }
.mainnav { overflow: visible }
@media (max-width: 1200px) { .mainnav a, .mainnav .navgroup > summary { padding: .4rem .45rem; font-size: .92rem } }
@media (max-width: 860px) {
    .mainnav .navgroup .menu-list { position: static; box-shadow: none; border: 0; padding: 0 0 0 .8rem; min-width: 0; background: transparent }
    .mainnav .navgroup > summary { padding: .6rem .7rem }
}

/* ---------- Ticket-Eingang ---------- */
.triage-row { border-bottom: 1px solid var(--border); padding-bottom: .4rem; margin-bottom: .2rem }
.triage-row:last-child { border-bottom: 0 }
.triage-form { display: flex; gap: .35rem; flex-wrap: wrap; padding: 0 .3rem .2rem 1rem }
.triage-form select { width: auto; margin: 0; padding: .25rem .4rem; font-size: .82rem; max-width: 12rem }
@media (max-width: 640px) { .triage-form select { flex: 1 1 40%; max-width: none } }

/* ---------- Projektbaum / Portfolio ---------- */
.tree-wrap { overflow-x: auto }
.portfolio td { vertical-align: middle }
.portfolio .tree-name { display: inline-flex; align-items: center; gap: .35rem }
.portfolio .tree-owner { display: block; margin-left: 2.2rem; font-size: .75rem }
.tw { border: 0; background: none; color: var(--muted); cursor: pointer; width: 1.2rem; padding: 0; font-size: .9rem; line-height: 1 }
.tw:hover { color: var(--primary) }
.tw-sp { display: inline-block; width: 1.2rem }
.light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; background: var(--border-2) }
.light.green { background: var(--ok) } .light.yellow { background: #eab308 } .light.red { background: var(--p1) }
.tl-head { min-width: 220px }
.tl { position: relative; height: 14px; background: var(--card-2); border-radius: 7px; border: 1px solid var(--border); min-width: 200px }
.tl-today { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--p1); opacity: .6 }
.tl-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; background: color-mix(in srgb, var(--c) 30%, var(--card)); border: 1px solid var(--c); overflow: hidden }
.tl-bar i { display: block; height: 100%; background: color-mix(in srgb, var(--c) 70%, transparent) }
.tl-bar.red { box-shadow: 0 0 0 1px var(--p1) }
.tree-tools { margin-left: auto; display: inline-flex; gap: .3rem }
@media (max-width: 1100px) { .hide-md { display: none } }

/* ---------- Fahrzeuge ---------- */
.plate { display: inline-block; font-family: ui-monospace, monospace; font-size: .82em; font-weight: 700; letter-spacing: .04em; padding: .05rem .4rem; border: 1.5px solid var(--text); border-radius: 4px; background: var(--card); color: var(--text); vertical-align: middle }
.vehicle-fields { border: 1px solid var(--border); border-radius: 8px; padding: .3rem .9rem .7rem; margin: .5rem 0 }
.vehicle-fields legend { font-size: .85rem; font-weight: 600; padding: 0 .3rem }

/* ---------- Ressourcen ---------- */
.res-pick { border: 1px solid var(--border); border-radius: 8px; overflow: hidden }
.res-cat { background: var(--card-2); padding: .3rem .7rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border) }
.res-row { display: grid; grid-template-columns: 1fr auto 5.5rem; align-items: center; gap: .6rem; margin: 0; padding: .45rem .7rem; border-bottom: 1px solid var(--border); font-weight: 400 }
.res-row:last-child { border-bottom: 0 }
.res-row .res-name small { display: block }
.res-row input { margin: 0; text-align: right }
.res-row.short .res-free { color: var(--bad); font-weight: 600 }
.res-row.short input { border-color: var(--p1) }
.res-row.none { opacity: .55 }
.res-sep th { background: var(--card-2); font-size: .75rem }
.res-load { font-size: .75rem; font-weight: 700; color: var(--ok); margin-bottom: .15rem }
.res-load.high { color: var(--warn) } .res-load.full { color: var(--bad) }
.reuse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 1rem }
.replace-rows { display: flex; flex-direction: column; gap: .3rem }
.replace-rows input { margin: 0 }

/* ---------- Konfigurierbare Boards ---------- */
.board-tabs { margin-bottom: .6rem }
.kanban-wrap { overflow-x: auto; padding-bottom: 1rem }
.kanban-wrap .kanban { grid-template-columns: repeat(var(--cols, 5), minmax(240px, 1fr)); overflow: visible; padding-bottom: .4rem }
.kb-head { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(240px, 1fr)); gap: .8rem; margin-bottom: .4rem }
.kb-colhead { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .8rem; font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .45rem }
.kb-colhead .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--p3) }
.kb-colhead.st-col-new .dot { background: #8b5cf6 } .kb-colhead.st-col-in_progress .dot { background: var(--primary) } .kb-colhead.st-col-waiting .dot { background: #eab308 } .kb-colhead.st-col-done .dot, .kb-colhead.st-col-closed .dot { background: var(--ok) }
.kb-colhead.wip-over { border-color: var(--p1); background: var(--bad-bg); color: var(--bad) }
.kanban-wrap .kb-col { max-height: none; min-height: 90px }
.kb-col.no-drop { opacity: .45; background: repeating-linear-gradient(45deg, transparent 0 8px, color-mix(in srgb, var(--muted) 10%, transparent) 8px 16px) }
.kb-lane { font-weight: 600; font-size: .85rem; margin: .8rem 0 .3rem; padding: .3rem .6rem; background: var(--card-2); border-radius: 6px; border-left: 3px solid var(--primary) }
.col-table input, .col-table select { margin: 0; padding: .25rem .4rem }
@media (max-width: 640px) {
    .kanban-wrap .kanban, .kb-head { grid-template-columns: repeat(var(--cols, 5), 82vw) }
    .kb-head { position: static }
}
.col-table input[name^="col_label"] { min-width: 8rem }
.ok-box, .warn-box { padding: .6rem .9rem; border-radius: 8px; margin: .6rem 0; overflow-wrap: anywhere }
.ok-box { background: var(--ok-bg) }
.warn-box { background: var(--bad-bg) }
.ok-box pre, .warn-box pre { white-space: pre-wrap; word-break: break-all; max-height: 22rem; overflow: auto; margin: .4rem 0 0 }

.matrix-table th.c, .matrix-table td.c { text-align: center; width: 6.5rem }
.matrix-table td.c input { width: 1.15rem; height: 1.15rem }
.matrix-table td:first-child { min-width: 12rem }

.matrix-table .mx-cell { display: inline-flex; align-items: center; gap: .35rem; margin: 0; cursor: pointer; font-weight: normal }
.matrix-table .mx-label { display: none }
@media (max-width: 700px) {
  .matrix-table thead, .matrix-table td.c.locked { display: none }
  .matrix-table, .matrix-table tbody, .matrix-table tr { display: block; width: 100% }
  .matrix-table tr { padding: .5rem 0; border-bottom: 1px solid var(--border) }
  .matrix-table td { display: block; border: 0; padding: .15rem 0 }
  .matrix-table td.c:not(.locked) { display: inline-block; width: auto; padding: .25rem .9rem .25rem 0 }
  .matrix-table .mx-label { display: inline; font-size: .85rem }
}
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--ok-bg) }
.reply-actions { display: inline-flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end }
@media (max-width: 600px) { .reply-actions { width: 100%; justify-content: stretch } .reply-actions .btn { flex: 1 1 auto } }

/* Tags */
.chip.tag { --c: #64748b; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 70%, var(--text)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent) }
.chip.tag::before { content: "#"; opacity: .55; margin-right: -.15rem }
.tag-pick { margin: .7rem 0 .2rem }
.tag-options { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem }
.tag-opt { --c: #64748b; display: inline-flex; position: relative; margin: 0; cursor: pointer; font-weight: normal }
.tag-opt[hidden] { display: none }
.tag-opt input { position: absolute; opacity: 0; pointer-events: none }
.tag-opt span { padding: .3rem .75rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 45%, var(--border)); color: var(--text); background: var(--card); font-size: .9rem }
.tag-opt span:hover { background: color-mix(in srgb, var(--c) 12%, var(--card)) }
.tag-opt input:checked + span { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600 }
.tag-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px }
.task-tags { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center }
.tag-edit summary { list-style: none; cursor: pointer }
.tag-edit summary::-webkit-details-marker { display: none }
.tag-edit { position: relative }
.tag-edit > form { position: absolute; z-index: 30; left: 0; top: calc(100% + .3rem); width: min(22rem, 85vw); margin: 0; box-shadow: 0 8px 24px rgba(0,0,0,.15) }
.tag-edit > form .tag-pick { margin-top: 0 }
.chip.project { max-width: 100%; overflow: hidden; text-overflow: ellipsis }

/* Kanban 2 */
.kanban-wrap { --kb-gap: .9rem }
.kanban-wrap .kanban, .kb-head { gap: var(--kb-gap) }
.kb-colhead { border: 0; border-top: 3px solid var(--p3); background: var(--card); box-shadow: var(--shadow); border-radius: 10px; padding: .6rem .85rem }
.kb-colhead .kb-colname { flex: 1 }
.kb-colhead .count { background: var(--card-2); border-radius: 999px; padding: .05rem .55rem; font-size: .78rem; color: var(--muted); font-weight: 600 }
.kb-colhead.st-col-backlog { border-top-color: #94a3b8 } .kb-colhead.st-col-backlog .dot { background: #94a3b8 }
.kb-colhead.st-col-new { border-top-color: #8b5cf6 } .kb-colhead.st-col-open { border-top-color: var(--p3) }
.kb-colhead.st-col-in_progress { border-top-color: var(--primary) } .kb-colhead.st-col-waiting { border-top-color: #eab308 }
.kb-colhead.st-col-done, .kb-colhead.st-col-closed { border-top-color: var(--ok) } .kb-colhead.st-col-rejected { border-top-color: var(--bad) }
.kanban-wrap .kb-col { background: color-mix(in srgb, var(--card-2) 75%, transparent); border: 0; border-radius: 12px }
.kanban-wrap .kb-col.st-col-backlog { background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--muted) 6%, transparent) 10px 20px), var(--card-2) }
.kb-cards { gap: .55rem; padding: .55rem }
.kb-card { border-radius: 10px; border: 1px solid var(--border); border-left-width: 4px; padding: .6rem .7rem .55rem; gap: .4rem; transition: box-shadow .12s, transform .12s, border-color .12s; cursor: pointer }
.kb-card[draggable="true"] { cursor: grab }
.kb-card:hover { box-shadow: 0 6px 18px rgba(15,23,42,.10); transform: translateY(-1px) }
.kb-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px }
.kb-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent) }
.kb-card.is-closed { opacity: .72 }
.kb-card.is-closed .kb-title { text-decoration: line-through; text-decoration-color: var(--border-2) }
.kb-top { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: .75rem }
.kb-top .due { margin-left: auto }
.kb-title { font-weight: 600; font-size: .92rem; line-height: 1.35; color: var(--text) }
.kb-title:hover { text-decoration: none; color: var(--primary) }
.kb-meta .chip { font-size: .7rem }
.kb-nobody { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--border-2); color: var(--muted); align-items: center; justify-content: center; font-size: .75rem }
.kb-empty { display: none; margin: 0; padding: .9rem .5rem; text-align: center; font-size: .8rem; color: var(--muted); border: 1px dashed var(--border-2); border-radius: 10px }
.kb-cards:not(:has(.kb-card)) .kb-empty { display: block }
.kb-cards.over .kb-empty { display: none }
.kb-add { margin: .55rem .55rem 0 }
.kb-add > summary { list-style: none; cursor: pointer; padding: .4rem .6rem; border-radius: 8px; color: var(--muted); font-size: .85rem; font-weight: 500 }
.kb-add > summary::-webkit-details-marker { display: none }
.kb-add > summary:hover { background: var(--card); color: var(--primary) }
.kb-add form { display: flex; flex-direction: column; gap: .4rem; background: var(--card); padding: .5rem; border-radius: 10px; box-shadow: var(--shadow) }
.kb-add textarea { resize: vertical; min-height: 3rem }
.chip.backlog { --c: #64748b; border: 1px dashed color-mix(in srgb, var(--c) 60%, transparent); background: transparent; color: var(--muted) }

/* Seitenleiste */
.kb-drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.18); z-index: 60 }
.kb-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--card); z-index: 61; box-shadow: -12px 0 32px rgba(15,23,42,.18);
    transform: translateX(105%); transition: transform .18s ease-out; display: flex; flex-direction: column; border-left: 1px solid var(--border) }
.kb-drawer.open { transform: none }
.kb-drawer-body { overflow-y: auto; padding: 1rem 1.15rem 2rem; flex: 1 }
.kd-head { position: relative; border-left: 4px solid var(--p3); padding-left: .7rem; margin-bottom: .8rem }
.kd-head.pr-l1 { border-left-color: var(--p1) } .kd-head.pr-l2 { border-left-color: var(--p2) } .kd-head.pr-l4 { border-left-color: var(--p4) }
.kd-head h2 { font-size: 1.15rem; margin: .35rem 2rem .45rem 0; line-height: 1.3 }
.kd-head h2 a { color: var(--text) }
.kd-badges { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; font-size: .8rem }
.kd-close { position: absolute; top: -.3rem; right: -.3rem; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: var(--card-2); font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted) }
.kd-close:hover { color: var(--text) }
.kd-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .9rem }
.kd-actions form { margin: 0 }
.kd-facts { display: grid; grid-template-columns: 6.5rem 1fr; gap: .3rem .6rem; font-size: .88rem; margin: 0 0 .9rem }
.kd-facts dt { color: var(--muted) } .kd-facts dd { margin: 0 }
.kd-person { display: inline-flex; align-items: center; gap: .25rem; margin-right: .6rem }
.kd-desc { background: var(--card-2); border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; margin-bottom: .9rem; max-height: 16rem; overflow: auto }
.kd-sub { font-size: .9rem; margin: .4rem 0 .4rem; display: flex; justify-content: space-between; align-items: baseline }
.kd-events { list-style: none; margin: 0 0 .9rem; padding: 0; display: flex; flex-direction: column; gap: .55rem; font-size: .86rem }
.kd-events li { border-left: 2px solid var(--border); padding-left: .6rem }
.kd-events li.ev-internal { border-left-color: #eab308 } .kd-events li.ev-question, .kd-events li.ev-answer { border-left-color: var(--primary) }
.kd-events .md p { margin: .15rem 0 }
.kd-comment { position: sticky; bottom: -2rem; background: var(--card); padding: .6rem 0 .2rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .4rem }
.kd-open { margin: .8rem 0 0; text-align: right }
@media (max-width: 600px) { .kb-drawer { width: 100vw } .kd-facts { grid-template-columns: 5.5rem 1fr } }

/* Projekt anlegen: Kanban/Zeitplan mit anlegen */
.with-box { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .9rem .8rem; margin: .8rem 0; display: flex; flex-direction: column; gap: .55rem }
.with-box legend { font-weight: 600; padding: 0 .3rem }
.with-box .check { display: flex; gap: .55rem; align-items: flex-start }
.with-box .check input { margin-top: .2rem }
.with-box .check.sub { margin-left: 1.6rem }
.with-box:has([name=with_gantt]:not(:checked)) .check.sub { display: none }
.project-gantt .gantt { max-height: 26rem; overflow: auto; border: 1px solid var(--border); border-radius: 8px }
.project-gantt header .head-actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center }

/* LDAP */
.row-wrap { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin: .4rem 0 }
.small-input { font-size: .85rem; padding: .3rem .45rem }
.tiny-input { width: 4.5rem; font-size: .85rem; padding: .3rem .45rem; text-align: right }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem }
ul.plain { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-direction: column; gap: .2rem; overflow-wrap: anywhere }
.ldap-maps td { vertical-align: top } .ldap-maps td input + input { margin-top: .25rem }
.ldap-maps select { min-width: 9rem }
details.card > summary { cursor: pointer; padding: .2rem 0 }
details.card[open] > summary { margin-bottom: .6rem }
.ldap-maps .m-only { display: none }
.ldap-maps .m-inline { display: inline-flex; align-items: center; gap: .4rem; margin: 0 }
.ldap-maps td.c .check { justify-content: center; margin: 0 }
@media (max-width: 700px) {
  .ldap-maps .m-only { display: inline }
  .ldap-maps td.c, .ldap-maps td.num { text-align: left }
  .ldap-maps thead { display: none }
  .ldap-maps tr { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .5rem 0; border-bottom: 1px solid var(--border) }
  .ldap-maps td { border: 0; padding: 0 } .ldap-maps td:first-child { grid-column: 1 / -1 }
  .ldap-maps select { min-width: 0; width: 100% }
}

/* Runde 16: Board – Schnellfilter, Hinweise auf Karten, Bahnen einklappen, eigene Spalten */
.kb-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; margin: 0 0 .8rem; font-size: .88rem }
.kb-quick-l { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em }
.kb-quick select { width: auto; min-width: 0; padding: .3rem .5rem; font-size: .85rem }
.kb-chips { display: inline-flex; flex-wrap: wrap; gap: .35rem }
.kb-chips label { margin: 0; font-weight: 500 }
.kb-chips input { position: absolute; opacity: 0; pointer-events: none }
.kb-chips span { display: inline-block; padding: .25rem .65rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); cursor: pointer; font-size: .82rem; color: var(--muted) }
.kb-chips input:checked + span { background: var(--primary-bg); border-color: var(--primary); color: var(--primary) }
.kb-chips input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px }
.kb-card.kb-hidden { display: none }
.kb-warn { font-size: .76rem; line-height: 1.3; border-radius: 6px; padding: .2rem .45rem }
.kb-warn.blk { background: var(--card-2); color: var(--muted); border: 1px dashed var(--border-2) }
.kb-warn.ms { background: var(--warn-bg); color: var(--warn) }
.kb-card.stale { opacity: .72 } .kb-card.stale:hover, .kb-card.stale:focus { opacity: 1 }
.stale-t { color: var(--muted) }
button.kb-lane { display: flex; align-items: center; gap: .4rem; width: 100%; text-align: left; border: 0; color: inherit; cursor: pointer; font: inherit; font-weight: 600; font-size: .85rem }
button.kb-lane .count { margin-left: auto; font-weight: 500; color: var(--muted) }
.kb-lane-tw { display: inline-block; transition: transform .15s; color: var(--muted) }
button.kb-lane[aria-expanded="false"] .kb-lane-tw { transform: rotate(-90deg) }
.kb-row[hidden], .kb-lane-empty { display: none !important }
.kd-move { display: flex; align-items: flex-end; gap: .5rem; margin: .2rem 0 .7rem }
.kd-move label { flex: 1; margin: 0 }
.kd-warn { font-size: .85rem; background: var(--card-2); border: 1px dashed var(--border-2); border-radius: 8px; padding: .4rem .6rem; margin: 0 0 .7rem }
.cc-table td { vertical-align: middle } .cc-table input[name="cc_label[]"] { min-width: 10rem }
.cc-table .cc-tools { white-space: nowrap }
.cc-presets { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .4rem 0 .8rem }
.col-mode { margin-bottom: .8rem }
@media (max-width: 700px) {
  .cc-table thead { display: none }
  .cc-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .5rem 0; border-bottom: 1px solid var(--border) }
  .cc-table td { border: 0; padding: 0 } .cc-table td:first-child { grid-column: 1 / -1 }
  .cc-table input, .cc-table select { width: 100%; min-width: 0 }
  .cc-table td[data-l]::before { content: attr(data-l); display: block; font-size: .75rem; color: var(--muted); margin-bottom: .1rem }
}

/* Runde 16: Zeitplan – Gruppen/Arbeitspakete einklappen, kritischer Pfad, Basisplan, Verbinden per Ziehen */
.gantt-tools { flex-wrap: wrap; gap: .4rem; align-items: center }
.chip-toggle { display: inline-flex; align-items: center; gap: .35rem; margin: 0; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 999px; font-size: .82rem; font-weight: 500; background: var(--card); cursor: pointer }
.chip-toggle input { margin: 0; width: auto }
.chip-toggle:has(input:checked) { border-color: var(--primary); background: var(--primary-bg); color: var(--primary) }
.g-fold { border: 0; background: none; padding: 0; width: 1rem; flex: none; cursor: pointer; color: var(--muted); font-size: .8rem; line-height: 1 }
.g-fold-sp { width: 1rem; flex: none }
.g-bar { overflow: visible }
.g-bar span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.g-bar .g-prog { border-radius: 4px 0 0 4px; overflow: hidden }
.g-bar.summary { top: 10px; height: 12px; line-height: 12px; padding: 0; background: color-mix(in srgb, var(--c) 70%, var(--text)); border-color: transparent; border-radius: 2px; cursor: default; font-size: 0 }
.g-bar.summary::before, .g-bar.summary::after { content: ''; position: absolute; bottom: -5px; border: 5px solid transparent; border-top-color: color-mix(in srgb, var(--c) 70%, var(--text)) }
.g-bar.summary::before { left: -1px; border-left-color: color-mix(in srgb, var(--c) 70%, var(--text)) } .g-bar.summary::after { right: -1px; border-right-color: color-mix(in srgb, var(--c) 70%, var(--text)) }
.g-bar.summary .g-prog { background: color-mix(in srgb, var(--c) 40%, var(--card)); opacity: .55 }
.show-crit .g-bar.crit { border-color: var(--p1); box-shadow: 0 0 0 2px color-mix(in srgb, var(--p1) 45%, transparent) }
.show-crit .g-bar:not(.crit):not(.summary):not(.project) { opacity: .55 }
.show-crit .g-deps path.crit { stroke: var(--p1); color: var(--p1); stroke-width: 2 }
.g-base { display: none; position: absolute; top: calc(var(--row) - 9px); height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 55%, transparent); pointer-events: none }
.show-base .g-base { display: block }
.g-ms.base { display: none; background: transparent; box-shadow: none; border: 2px dashed var(--muted); z-index: 1 }
.show-base .g-ms.base { display: block }
.g-ms.warn { box-shadow: 0 0 0 2px var(--warn) }
.g-weekend.free { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 14%, transparent) 0 3px, transparent 3px 7px) }
.g-bar .g-link { position: absolute; right: -6px; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%; background: var(--card); border: 2px solid var(--c); cursor: crosshair; z-index: 3; opacity: 0; transition: opacity .1s }
.g-bar:hover .g-link, .gantt.linking .g-link { opacity: 1 }
.g-bar .g-handle { right: 4px; width: 7px }
.gantt.linking .g-bar { cursor: crosshair }
.g-deps path.g-hit { stroke: transparent; stroke-width: 10; pointer-events: stroke; cursor: pointer; marker-end: none }
.g-deps path.g-hit:hover { stroke: color-mix(in srgb, var(--p1) 25%, transparent) }
.g-linkline { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 150; overflow: visible }
.g-linkline line { stroke: var(--primary); stroke-width: 2; stroke-dasharray: 5 4 }
.g-tip-bad { color: #fca5a5 }
.undo-toast { display: flex; align-items: center; gap: .7rem }
.gantt-legend .lg-i { white-space: nowrap }
.lg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--primary); vertical-align: -1px }
.lg-sum { display: inline-block; width: 22px; height: 7px; background: var(--muted); border-radius: 2px; vertical-align: 1px }
.dep-add { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .4rem }
.dep-add input[name=depends_on] { flex: 1 1 12rem; min-width: 0 }
.dep-add select { width: auto }
.dep-add .inline-l { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-weight: 400 }
.dep-add small { flex-basis: 100% }

/* Runde 16: Projektsteuerung, Statusbericht, Logbuch, Aufgabenpakete, Projekt-Board */
.steer-nav { margin-bottom: 1rem }
.steer-nav .count { font-size: .75rem; color: var(--muted); margin-left: .2rem }
.light-big { display: inline-block; width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--border-2) }
.light-big.green { background: var(--ok) } .light-big.yellow { background: #eab308 } .light-big.red { background: var(--p1) }
.report-head { display: flex; gap: .8rem; align-items: center; margin: .3rem 0 .8rem }
.report-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem }
.report-cols h3 { font-size: .85rem; margin: 0 0 .3rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em }
.report-cols .prose ul { margin: 0; padding-left: 1.1rem }
.report-history { margin-top: .8rem } .report-old { margin: .4rem 0 .4rem .6rem } .report-old summary { cursor: pointer; font-size: .88rem }
.stats.compact .stat b { font-size: 1.3rem }
.log-list { list-style: none; margin: 0 0 .6rem; padding: 0 }
.log-list > li { display: flex; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--border) }
.log-list > li:last-child { border-bottom: 0 }
.log-list > li.closed { opacity: .6 }
.log-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem }
.log-actions { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: center; margin-top: .15rem }
.log-form { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem }
.log-ico { width: 1.6rem; text-align: center; color: var(--muted); flex: none }
.log-date { flex: none; width: 5.2rem; font-size: .82rem; color: var(--muted); padding-top: .1rem }
.risk-score { display: inline-flex; align-items: center; justify-content: center; min-width: 1.8rem; height: 1.8rem; padding: 0 .35rem; border-radius: 6px; font-weight: 700; font-size: .85rem; flex: none; background: var(--ok-bg); color: var(--ok) }
.risk-score.yellow { background: var(--warn-bg); color: var(--warn) } .risk-score.red { background: var(--bad-bg); color: var(--bad) }
.steer-facts .risk-score { min-width: 0; height: auto; padding: 0 .35rem; font-size: .72rem }
.steer-facts { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; flex-direction: column; gap: .2rem }
.light-seg .light { vertical-align: -1px }
.import-group { border: 1px solid var(--border); border-radius: 8px; padding: .4rem .8rem .6rem; margin: 0 0 .7rem }
.import-group legend { padding: 0 .3rem } .import-group legend .check { margin: 0 }
.import-group > .check { margin: .2rem 0 .2rem 1.4rem }
.import-align { display: flex; flex-direction: column; gap: .3rem }
.import-align select, .import-align input { width: auto; display: inline-block }
.portfolio .kb-colhead.ps-col-planned { border-top-color: #8b5cf6 } .portfolio .kb-colhead.ps-col-active { border-top-color: var(--primary) }
.portfolio .kb-colhead.ps-col-paused { border-top-color: #eab308 } .portfolio .kb-colhead.ps-col-done { border-top-color: var(--ok) }
.portfolio .ps-col-planned .dot { background: #8b5cf6 } .portfolio .ps-col-active .dot { background: var(--primary) } .portfolio .ps-col-paused .dot { background: #eab308 } .portfolio .ps-col-done .dot { background: var(--ok) }
.pf-card { border-left-color: var(--c) !important; cursor: grab } .pf-card.locked { cursor: default }
.pf-card .kb-meta { display: flex; flex-direction: column; gap: .15rem }
.pf-report { font-size: .74rem; color: var(--muted); margin-left: auto }
.pf-card .kb-top { display: flex; align-items: center; gap: .4rem }
.wl-tot { color: var(--muted); font-weight: 400 }
@media (max-width: 800px) { .report-cols { grid-template-columns: 1fr } }

/* Runde 17: Aufbewahrung & Bilder */
.inline-h { display: inline; font-size: 1.05rem; margin: 0 .5rem 0 0 }
#aufbewahrung summary { cursor: pointer }
.ret-box { display: flex; flex-direction: column; gap: .3rem; margin: .6rem 0 }
.ret-box .label { margin-top: .4rem }
.ret-prev { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: .35rem .6rem; margin: .3rem 0 0 }
.ret-team { margin: .4rem 0 }
.ret-team summary { cursor: pointer }
.ret-info { margin: .6rem 0 0 }
