/* PLANBAR Projekttool — Stylesheet (CI: keine runden Ecken, Ink-Rahmen, Papier) */

@font-face {
  font-family: 'Zalando Sans';
  src: url('/assets/ZalandoSans-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --orange: #f3562e;
  --orange-hover: #d9431d;
  --rhubarb: #ffb09c;
  --pickle: #00363e;
  --seaweed: #565438;
  --matcha: #e0ebde;
  --cherry: #531f28;
  --almond: #bcad96;
  --paper: #fef7ec;
  --card: #FBFAF5;
  --ink: #171511;
  --ink-soft: #5d584f;
  --line: rgba(23, 21, 17, 0.16);
  --border: 1.5px solid var(--ink);
  --shadow: 4px 4px 0 rgba(23, 21, 17, 0.14);
}

* { box-sizing: border-box; border-radius: 0 !important; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Zalando Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--pickle); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
::selection { background: var(--rhubarb); }

.boot { padding: 40px; color: var(--ink-soft); }

/* ---------------------------------------------------------------- Basics */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: var(--border);
  padding: 9px 16px; cursor: pointer; font-weight: 650;
  transition: transform .05s ease, box-shadow .05s ease;
}
.btn:hover { box-shadow: 3px 3px 0 rgba(23,21,17,.2); transform: translate(-1px,-1px); }
.btn:active { transform: translate(0,0); box-shadow: none; }
.btn.primary { background: var(--orange); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: var(--orange-hover); }
.btn.dark { background: var(--pickle); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { border-color: var(--ink); background: var(--card); transform: none; }
.btn.danger { color: #fff; background: var(--cherry); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.input, textarea.input, select.input {
  width: 100%; background: #fff; border: var(--border);
  padding: 9px 12px; outline: none;
}
.input:focus { box-shadow: 3px 3px 0 var(--rhubarb); }
textarea.input { resize: vertical; min-height: 90px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span {
  display: block; font-size: 11px; font-weight: 750; letter-spacing: .09em;
  text-transform: uppercase; color: var(--pickle); margin-bottom: 5px;
}

.tag {
  display: inline-block; font-size: 10.5px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--pickle); border: 1.5px solid var(--pickle);
  padding: 2px 7px; background: #fff;
}
.tag.orange { color: #fff; background: var(--orange); border-color: var(--ink); }
.tag.matcha { background: var(--matcha); border-color: var(--pickle); }
.tag.cherry { color: #fff; background: var(--cherry); border-color: var(--ink); }
.tag.soft { border-color: var(--line); color: var(--ink-soft); }

.avatar {
  width: 30px; height: 30px; flex: 0 0 30px; display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--pickle); color: #fff; font-size: 12px; font-weight: 800;
  border: 1.5px solid var(--ink); user-select: none;
}
.avatar.big { width: 42px; height: 42px; flex-basis: 42px; font-size: 15px; }
.avatar.a1 { background: var(--pickle); } .avatar.a2 { background: var(--orange); }
.avatar.a3 { background: var(--seaweed); } .avatar.a4 { background: var(--cherry); }
.avatar.a5 { background: var(--almond); color: var(--ink); }

.card { background: var(--card); border: var(--border); }
.dotted-row { border-bottom: 1.5px dotted var(--line); }

.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- Login */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 26px; padding: 24px;
}
.login-box { width: 380px; max-width: 94vw; background: var(--card); border: var(--border); box-shadow: var(--shadow); padding: 30px; }
.login-box h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; }
.login-box .sub { margin: 0 0 22px; color: var(--ink-soft); font-size: 14px; }
.login-logo { height: 54px; }
.login-error { background: var(--cherry); color: #fff; padding: 8px 12px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }
.login-claim { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--pickle); font-weight: 750; }

/* ---------------------------------------------------------------- Shell */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex: 0 0 248px; background: var(--card);
  border-right: var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .logo-row { padding: 18px 18px 12px; border-bottom: 1.5px dotted var(--line); }
.sidebar .logo-row img { width: 130px; display: block; }
.sidebar nav { padding: 12px 10px; }
.side-caption {
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); padding: 14px 10px 6px;
}
.side-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; background: transparent; border: 1.5px solid transparent;
  cursor: pointer; text-align: left; font-weight: 600; color: var(--ink);
}
.side-item:hover { border-color: var(--ink); background: #fff; }
.side-item.active { background: var(--pickle); color: #fff; border-color: var(--ink); }
.side-item .glyph { width: 18px; text-align: center; font-weight: 800; }
.side-item .count { margin-left: auto; font-size: 11.5px; font-weight: 800; color: var(--orange); }
.side-item.active .count { color: var(--rhubarb); }
.side-item .key { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: var(--ink-soft); margin-left: auto; }
.side-item.active .key { color: rgba(255,255,255,.65); }

.sidebar .foot { margin-top: auto; border-top: var(--border); padding: 12px; display: flex; align-items: center; gap: 10px; }
.sidebar .foot .who { min-width: 0; }
.sidebar .foot .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .foot .who span { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.sidebar .foot .btn { margin-left: auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 28px; border-bottom: var(--border); background: var(--paper);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }
.topbar .context { color: var(--ink-soft); font-size: 13px; }

.content { padding: 26px 28px 60px; }

.search-fake {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  border: var(--border); background: #fff; padding: 7px 12px; color: var(--ink-soft);
  font-size: 13.5px; min-width: 210px;
}
.search-fake .key { margin-left: auto; font-size: 11px; font-weight: 800; border: 1.5px solid var(--line); padding: 1px 5px; color: var(--ink-soft); }

/* ---------------------------------------------------------------- Dashboard */

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.kpi { background: var(--card); border: var(--border); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .num { font-size: 32px; font-weight: 850; color: var(--orange); line-height: 1.1; }
.kpi .lbl { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pickle); margin-top: 4px; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }

.panel { background: var(--card); border: var(--border); }
.panel > header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: var(--border); background: #fff;
}
.panel > header h2 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.panel > header .spacer { flex: 1; }
.panel .body { padding: 8px 16px 14px; }
.panel .empty { padding: 22px 16px; color: var(--ink-soft); font-size: 14px; }

.task-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 2px;
  border-bottom: 1.5px dotted var(--line); cursor: pointer;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover .t-title { text-decoration: underline; text-decoration-thickness: 1.5px; }
.task-row .t-num { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); flex: 0 0 58px; }
.task-row .t-title { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .t-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.due { font-size: 11.5px; font-weight: 800; padding: 2px 7px; border: 1.5px solid var(--pickle); color: var(--pickle); }
.due.over { background: var(--cherry); border-color: var(--ink); color: #fff; }
.due.soon { background: var(--orange); border-color: var(--ink); color: #fff; }

.prio { font-size: 10.5px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.prio.hoch { color: var(--orange); }
.prio.mittel { color: var(--seaweed); }
.prio.niedrig { color: var(--ink-soft); }

.activity-row { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1.5px dotted var(--line); font-size: 13.5px; }
.activity-row:last-child { border-bottom: none; }
.activity-row .when { color: var(--ink-soft); font-size: 12px; white-space: nowrap; margin-left: auto; padding-left: 10px; }

/* ---------------------------------------------------------------- Projekte */

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.proj-card { background: var(--card); border: var(--border); box-shadow: var(--shadow); padding: 18px; cursor: pointer; }
.proj-card:hover { box-shadow: 6px 6px 0 rgba(23,21,17,.2); }
.proj-card h3 { margin: 8px 0 6px; font-size: 18px; }
.proj-card .desc { color: var(--ink-soft); font-size: 13.5px; min-height: 38px; }
.proj-card .stats { display: flex; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 1.5px dotted var(--line); font-size: 13px; }
.proj-card .stats b { color: var(--orange); }
.member-stack { display: flex; }
.member-stack .avatar { margin-left: -8px; width: 26px; height: 26px; flex-basis: 26px; font-size: 10.5px; }
.member-stack .avatar:first-child { margin-left: 0; }

/* ---------------------------------------------------------------- Board */

.board-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.seg { display: inline-flex; border: var(--border); background: #fff; }
.seg button {
  border: none; background: transparent; padding: 7px 14px; cursor: pointer;
  font-weight: 750; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  border-right: 1.5px solid var(--ink);
}
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--pickle); color: #fff; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 16px; overflow-x: auto; align-items: start; padding-bottom: 20px; }
.col { background: var(--card); border: var(--border); min-height: 220px; display: flex; flex-direction: column; }
.col > header {
  padding: 10px 12px; border-bottom: var(--border); background: #fff;
  display: flex; align-items: center; gap: 8px;
}
.col > header h3 { margin: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .09em; }
.col > header .cnt { font-weight: 850; color: var(--orange); font-size: 13px; }
.col > header .addbtn { margin-left: auto; }
.col .col-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 60px; flex: 1; }
.col.drag-over .col-body { background: var(--matcha); outline: 2px dashed var(--pickle); outline-offset: -6px; }

.tcard { background: #fff; border: var(--border); padding: 10px 12px; cursor: grab; }
.tcard:hover { box-shadow: 3px 3px 0 rgba(23,21,17,.18); }
.tcard.dragging { opacity: .45; }
.tcard .head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.tcard .num { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.tcard .title { font-weight: 650; font-size: 14px; line-height: 1.3; }
.tcard .foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.tcard .foot .avatar { width: 24px; height: 24px; flex-basis: 24px; font-size: 10px; margin-left: auto; }
.tcard .check-hint { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }

/* ---------------------------------------------------------------- Tabelle (Liste) */

.table { width: 100%; border-collapse: collapse; background: var(--card); border: var(--border); }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--pickle); padding: 10px 12px; border-bottom: var(--border); background: #fff;
}
.table td { padding: 10px 12px; border-bottom: 1.5px dotted var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #fff; }

.status-chip { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 3px 8px; border: 1.5px solid var(--pickle); color: var(--pickle); background: #fff; display: inline-block; }
.status-chip.done { background: var(--matcha); }
.status-chip.doing { background: var(--orange); color: #fff; border-color: var(--ink); }
.status-chip.review { background: var(--pickle); color: #fff; }

/* ---------------------------------------------------------------- Notizen */

.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.note-card { background: #fff; border: var(--border); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.note-card:hover { box-shadow: var(--shadow); }
.note-card h3 { margin: 0; font-size: 16px; }
.note-card .preview { color: var(--ink-soft); font-size: 13px; flex: 1; overflow: hidden; max-height: 120px; }
.note-card .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); border-top: 1.5px dotted var(--line); padding-top: 9px; }
.note-card.pinned { background: var(--card); border-width: 2.5px; }
.pin-mark { color: var(--orange); font-weight: 900; }

/* ---------------------------------------------------------------- Wiki */

.wiki-layout { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
.wiki-nav { background: var(--card); border: var(--border); padding: 10px; position: sticky; top: 86px; }
.wiki-nav .side-item { font-size: 14px; padding: 7px 10px; }
.wiki-article { background: var(--card); border: var(--border); padding: 30px 36px 40px; max-width: 860px; }
.wiki-article .pagehead { display: flex; align-items: baseline; gap: 12px; border-bottom: var(--border); padding-bottom: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.wiki-article .pagehead h1 { margin: 0; font-size: 26px; flex: 1; }
.wiki-meta { font-size: 12.5px; color: var(--ink-soft); }

.md { line-height: 1.6; }
.md h1, .md h2, .md h3 { letter-spacing: -.01em; margin: 22px 0 8px; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; border-bottom: 1.5px dotted var(--line); padding-bottom: 4px; } .md h3 { font-size: 15.5px; }
.md p { margin: 9px 0; }
.md code { background: var(--matcha); padding: 1px 5px; font-size: .88em; font-family: 'Cascadia Code', Consolas, monospace; }
.md pre { background: var(--pickle); color: #fff; padding: 14px 16px; overflow-x: auto; font-size: 13px; font-family: 'Cascadia Code', Consolas, monospace; }
.md pre code { background: transparent; color: inherit; padding: 0; }
.md blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--orange); background: #fff; }
.md table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.md th, .md td { border: 1.5px solid var(--ink); padding: 6px 10px; text-align: left; font-size: 13.5px; }
.md th { background: var(--matcha); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.md ul, .md ol { margin: 8px 0; padding-left: 24px; }
.md li { margin: 3px 0; }
.md hr { border: none; border-top: 1.5px dotted var(--ink); margin: 18px 0; }
.md a.wikilink { color: var(--orange); font-weight: 700; text-decoration-thickness: 2px; }
.md a.wikilink.missing { color: var(--cherry); text-decoration-style: dashed; }
.md input[type=checkbox] { accent-color: var(--orange); }

.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.editor-grid textarea.input { min-height: 480px; font-family: 'Cascadia Code', Consolas, monospace; font-size: 13.5px; line-height: 1.55; }
.editor-preview { background: #fff; border: 1.5px dashed var(--line); padding: 16px 20px; min-height: 480px; }

/* ---------------------------------------------------------------- Rich-Editor */

.re { position: relative; }
.re-toolbar {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  background: var(--card); border: var(--border); border-bottom: none; padding: 4px 6px;
}
.re-toolbar button {
  width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1.5px solid transparent; cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 0;
}
.re-toolbar button:hover { border-color: var(--ink); background: #fff; }
.re-sep { width: 1.5px; height: 18px; background: var(--line); margin: 0 6px; }
.re-hint { margin-left: auto; font-size: 11px; color: var(--ink-soft); padding-right: 4px; }
.re-area {
  background: #fff; border: var(--border); padding: 12px 14px;
  min-height: 90px; max-height: 60vh; overflow-y: auto; outline: none;
}
.re-area:focus { box-shadow: 3px 3px 0 var(--rhubarb); }
.re-area:empty::before { content: attr(data-placeholder); color: var(--ink-soft); opacity: .7; pointer-events: none; }
.re-area img { max-width: 100%; height: auto; cursor: pointer; }
.re-area img.re-img-sel { outline: 2.5px solid var(--orange); outline-offset: 1px; }
.re-mini .re-area { padding: 8px 10px; }
.re-mini .re-toolbar button { width: 26px; height: 24px; font-size: 12px; }

.re-imgbar {
  position: absolute; z-index: 10; display: flex; gap: 0;
  background: var(--pickle); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 rgba(23,21,17,.3);
}
.re-imgbar button {
  background: transparent; border: none; border-right: 1.5px solid rgba(255,255,255,.25);
  color: #fff; font-size: 11px; font-weight: 800; padding: 4px 8px; cursor: pointer;
}
.re-imgbar button:last-child { border-right: none; }
.re-imgbar button:hover { background: var(--orange); }
.re-handle {
  position: absolute; z-index: 10; width: 14px; height: 14px;
  background: var(--orange); border: 1.5px solid var(--ink); cursor: nwse-resize;
}
.re-savemark { color: var(--seaweed); font-weight: 700; text-transform: none; letter-spacing: 0; margin-left: 8px; }

.md img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- Anhänge */

.att-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px; border-bottom: 1.5px dotted var(--line);
}
.att-chip:last-of-type { border-bottom: none; }
.att-thumb { width: 38px; height: 38px; object-fit: cover; border: 1.5px solid var(--ink); flex: 0 0 38px; }
.att-icon {
  width: 38px; height: 38px; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink); background: var(--matcha); font-size: 16px;
}
.att-name { font-weight: 650; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.att-chip .btn { visibility: hidden; }
.att-chip:hover .btn { visibility: visible; }

/* ---------------------------------------------------------------- Team */

.team-table .avatar { margin-right: 10px; }
.role-badge { font-size: 10.5px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border: 1.5px solid var(--ink); }
.role-badge.admin { background: var(--pickle); color: #fff; }
.role-badge.member { background: #fff; }
.inactive-row { opacity: .5; }

/* ---------------------------------------------------------------- Modal */

#modal-layer:empty, #palette-layer:empty { display: none; }
.overlay {
  position: fixed; inset: 0; background: rgba(23, 21, 17, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px 40px; z-index: 50; overflow-y: auto;
}
.modal { background: var(--paper); border: 2px solid var(--ink); box-shadow: 8px 8px 0 rgba(23,21,17,.3); width: 720px; max-width: 96vw; }
.modal.narrow { width: 460px; }
.modal.wide { width: 980px; }
.modal > header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: var(--border); background: var(--card); }
.modal > header h2 { margin: 0; font-size: 17px; flex: 1; min-width: 0; }
.modal .mbody { padding: 20px; }
.modal .mfoot { padding: 14px 20px; border-top: var(--border); display: flex; gap: 10px; background: var(--card); }
.modal .mfoot .spacer { flex: 1; }
.xbtn { background: transparent; border: 1.5px solid transparent; font-size: 19px; font-weight: 800; cursor: pointer; padding: 2px 9px; }
.xbtn:hover { border-color: var(--ink); background: #fff; }

.task-modal-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 24px; }
.side-field { margin-bottom: 14px; }
.side-field > span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pickle); margin-bottom: 4px; }

.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1.5px dotted var(--line); }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 2px; }
.comment .c-head b { color: var(--ink); }

.checklist-item { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.checklist-item input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--orange); cursor: pointer; }
.checklist-item.done span { text-decoration: line-through; color: var(--ink-soft); }
.checklist-item .rm { margin-left: auto; visibility: hidden; }
.checklist-item:hover .rm { visibility: visible; }
.progressbar { height: 10px; border: 1.5px solid var(--ink); background: #fff; margin: 6px 0 10px; }
.progressbar > div { height: 100%; background: var(--orange); }

/* ---------------------------------------------------------------- Palette (Strg+K) */

.palette { background: var(--paper); border: 2px solid var(--ink); box-shadow: 8px 8px 0 rgba(23,21,17,.3); width: 640px; max-width: 94vw; }
.palette input { width: 100%; border: none; border-bottom: var(--border); background: #fff; padding: 15px 18px; font-size: 16px; outline: none; }
.palette .results { max-height: 420px; overflow-y: auto; }
.presult { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; border-bottom: 1.5px dotted var(--line); }
.presult:hover, .presult.sel { background: var(--matcha); }
.presult .kind { font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; border: 1.5px solid var(--pickle); color: var(--pickle); padding: 2px 6px; flex: 0 0 auto; width: 74px; text-align: center; }
.presult .ttl { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presult .sub { margin-left: auto; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.palette .hint { padding: 9px 16px; font-size: 12px; color: var(--ink-soft); background: var(--card); border-top: var(--border); }

/* ---------------------------------------------------------------- Toast */

#toast-layer { position: fixed; bottom: 22px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--pickle); color: #fff; border: 2px solid var(--ink); box-shadow: 4px 4px 0 rgba(23,21,17,.3); padding: 11px 16px; font-weight: 650; font-size: 14px; max-width: 380px; }
.toast.error { background: var(--cherry); }

/* ---------------------------------------------------------------- Glocke & Benachrichtigungen */

.bell {
  position: relative; border: var(--border); background: #fff;
  width: 40px; height: 37px; cursor: pointer; font-size: 15px; padding: 0;
}
.bell:hover { box-shadow: 3px 3px 0 rgba(23,21,17,.2); }
.bell-badge {
  position: absolute; top: -9px; right: -9px;
  background: var(--orange); color: #fff; border: 1.5px solid var(--ink);
  font-size: 10.5px; font-weight: 800; padding: 1px 5px; line-height: 1.3;
}
.notif-overlay { background: transparent; align-items: flex-start; justify-content: flex-end; padding: 64px 24px 0; }
.notif-panel { width: 420px; max-width: 94vw; background: var(--paper); border: 2px solid var(--ink); box-shadow: 8px 8px 0 rgba(23,21,17,.3); }
.notif-panel header { padding: 10px 14px; border-bottom: var(--border); background: var(--card); }
.notif-panel h2 { margin: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .09em; }
.notif-list { max-height: 62vh; overflow-y: auto; }
.notif-list .empty { padding: 20px 16px; color: var(--ink-soft); font-size: 13.5px; }
.notif-row { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1.5px dotted var(--line); cursor: pointer; align-items: flex-start; }
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--matcha); }
.notif-row.unread { background: #fff; box-shadow: inset 4px 0 0 var(--orange); }

.mention { color: var(--pickle); font-weight: 800; background: var(--matcha); padding: 0 3px; }

/* ---------------------------------------------------------------- Lightbox & Archiv */

.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(23, 21, 17, .85);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 94vh; border: 2px solid #fff; }

.archived-banner {
  background: var(--matcha); border: 1.5px solid var(--pickle);
  padding: 9px 14px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px; font-weight: 650; flex-wrap: wrap;
}

/* ---------------------------------------------------------------- Druck */

@media print {
  .sidebar, .topbar, .board-toolbar, .btn, .xbtn, .bell, .search-fake,
  #toast-layer, #palette-layer, #modal-layer, .wiki-nav, .re-toolbar, .re-hint { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .shell, .main { display: block; }
  .content { padding: 0; }
  .wiki-layout { display: block; }
  .wiki-article { border: none; padding: 0; max-width: none; }
  .kpi, .panel, .card, .table, .proj-card, .note-card, .tcard, .col { box-shadow: none !important; }
  .md pre { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
  a { text-decoration: none; color: inherit; }
}

/* ---------------------------------------------------------------- Responsive */

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .editor-grid, .task-modal-grid { grid-template-columns: 1fr; }
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-nav { position: static; }
}
@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-basis: auto; height: auto; position: static; border-right: none; border-bottom: var(--border); }
  .sidebar .foot { margin-top: 0; }
  .content { padding: 18px 14px 50px; }
  .topbar { padding: 12px 14px; flex-wrap: wrap; }
  .search-fake { min-width: 0; }
}
