:root {
    --bg: #f5f3ee;
    --panel: #fffdfa;
    --text: #202521;
    --muted: #6c746d;
    --line: #ddd6ca;
    --accent: #42695a;
    --accent-dark: #274539;
    --warn: #9a6b1f;
    --danger: #9b3636;
    --good: #31734d;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 12px 24px; background: rgba(255,253,250,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { font-weight: 800; color: var(--accent-dark); }
nav { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .95rem; }
.page { width: min(1180px, 100%); margin: 0 auto; padding: 22px 28px; }
.hero, .detail { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1; letter-spacing: 0; }
h2 { margin: 0 0 8px; font-size: 1.05rem; }
p { color: var(--muted); line-height: 1.45; margin: 0 0 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button, button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 0; border-radius: 2px; padding: 0 16px; background: var(--accent); color: #fff; font-weight: 750; cursor: pointer; }
.button.secondary { background: #e9e3d7; color: var(--accent-dark); }
.small-button { min-height: 32px; padding: 0 10px; font-size: .88rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notice { padding: 14px 16px; border: 1px solid #d9c18b; background: #fff6dd; border-radius: 2px; margin-bottom: 18px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metrics article, .panel, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px; box-shadow: 0 10px 24px rgba(32,37,33,.04); }
.metrics strong { display: block; font-size: 2rem; }
.metrics span, small, .hint { color: var(--muted); }
.grid.two { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card h2 { margin-top: 14px; }
.panel { display: grid; gap: 8px; margin-bottom: 16px; align-content: start; }
.compact-panel { padding-block: 12px; }
.row { display: grid; grid-template-columns: 2fr 1.4fr auto auto; gap: 12px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 2px; background: #fff; }
.badge { display: inline-flex; justify-content: center; width: fit-content; min-width: 80px; border-radius: 2px; padding: 5px 10px; background: #ece7dd; color: var(--accent-dark); font-size: .84rem; font-weight: 800; }
.badge.warn { background: #fff0cc; color: var(--warn); }
.badge.danger { background: #ffe1dd; color: var(--danger); }
.badge.good { background: #dff3e7; color: var(--good); }
.form { display: grid; gap: 12px; }
.grid-form { grid-template-columns: repeat(2, 1fr); }
.narrow { max-width: 460px; }
label { display: grid; gap: 6px; font-weight: 700; color: var(--muted); }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 2px; padding: 9px 10px; font: inherit; color: var(--text); background: #fff; }
textarea { min-height: 96px; resize: vertical; }
.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
.search { display: flex; gap: 10px; margin-bottom: 18px; }
.auth { min-height: 70vh; display: grid; align-content: center; }
.comment { border-top: 1px solid var(--line); padding-top: 12px; }
.comment strong, .comment small { display: block; }
.timeline { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.timeline a { min-width: 180px; border-radius: 2px; padding: 12px; }
.timeline small { display: block; margin-top: 8px; }
.drop-zone { position: relative; min-height: 92px; place-items: center; border: 2px dashed #c9c0b2; border-radius: 2px; background: #faf7ef; text-align: center; color: var(--accent-dark); }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-zone:hover { border-color: var(--accent); background: #f1ede3; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.gallery-item { display: grid; gap: 8px; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; border: 1px solid var(--line); background: #eee8dd; }
.gallery-item span { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.map-shell { height: min(72vh, 760px); min-height: 520px; border: 1px solid var(--line); background: #fbfaf6; overflow: hidden; cursor: grab; touch-action: none; }
.map-shell.dragging { cursor: grabbing; }
.map-canvas { width: 100%; height: 100%; display: block; }
.map-link { fill: none; stroke: #b9b0a2; stroke-width: 2; marker-end: url(#arrow); }
.map-link.dependency { stroke: #9a6b1f; stroke-dasharray: 7 6; }
.map-canvas marker path { fill: #9a6b1f; }
.map-node rect { fill: #fffdfa; stroke: #cfc7ba; stroke-width: 1.5; rx: 1; }
.map-node.property rect { fill: #e8efe9; stroke: #42695a; }
.map-node.project rect { fill: #f8f1dd; stroke: #9a6b1f; }
.map-node.task rect { fill: #fff; }
.map-node.blockiert rect, .map-node.kritisch rect { stroke: #9b3636; stroke-width: 2.5; }
.map-node.abgeschlossen rect, .map-node.erledigt rect { stroke: #31734d; }
.map-node:hover rect { stroke: var(--accent-dark); stroke-width: 3; }
.map-node-type { fill: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.map-node-title { fill: var(--text); font-size: 16px; font-weight: 800; }
@media (max-width: 760px) {
    .topbar, .hero, .detail { display: grid; }
    .metrics, .grid.two, .grid-form { grid-template-columns: 1fr; }
    .row { grid-template-columns: 1fr; }
    .page { padding: 20px; }
}
