/* Layout: App-Rahmen mit Seitenleiste (Navigation/Projekte) + Arbeitsfläche + Detail-Schublade rechts */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #f4f4ee; --surface: #ffffff; --surface-2: #ececE4; --ink: #22231b; --muted: #676858; --line: #dfdfd3;
  --accent: #737022; --accent-ink: #ffffff; --brand: #aaa440; --accent-soft: rgba(170,164,64,.16); --hover: rgba(34,35,27,.05);
  --p1: #cf3f33; --p2: #dd7d12; --p3: #2f74cf; --p4: #8b8c7e; --ok: #3f8a4a; --warn: #b36b00; --danger: #c23a2e;
  --shadow: 0 12px 40px rgba(30,30,20,.16), 0 2px 6px rgba(30,30,20,.08);
  --f-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --f-body: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 8px; --side: 268px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #15160f; --surface: #1d1e16; --surface-2: #26271e; --ink: #ebebe0; --muted: #a2a392; --line: #33342a;
  --accent: #c4be5c; --accent-ink: #1a1b12; --accent-soft: rgba(196,190,92,.16); --hover: rgba(235,235,224,.06);
  --p1: #f0675b; --p2: #f39a3a; --p3: #6aa6f2; --p4: #8f907f; --ok: #6cbf78; --warn: #e3a64a; --danger: #f0675b;
  --shadow: 0 12px 40px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #15160f; --surface: #1d1e16; --surface-2: #26271e; --ink: #ebebe0; --muted: #a2a392; --line: #33342a;
  --accent: #c4be5c; --accent-ink: #1a1b12; --accent-soft: rgba(196,190,92,.16); --hover: rgba(235,235,224,.06);
  --p1: #f0675b; --p2: #f39a3a; --p3: #6aa6f2; --p4: #8f907f; --ok: #6cbf78; --warn: #e3a64a; --danger: #f0675b;
  --shadow: 0 12px 40px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3); color-scheme: dark; }

html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.app { display: grid; grid-template-columns: var(--side) 1fr; height: 100%; }
.side { background: var(--surface-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
  padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: 12px; padding-block: 14px; gap: 6px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center;
  font-family: var(--f-display); font-size: 11.5px; font-weight: 600; letter-spacing: -.02em; flex: none; }
.brand-name { font-family: var(--f-display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.brand-name small { display: block; font-family: var(--f-body); font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: .02em; }
.brand-tools { margin-left: auto; display: flex; gap: 2px; }
.add-btn { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--accent); font-weight: 600;
  padding: 8px; border-radius: var(--r); text-align: left; }
.add-btn:hover { background: var(--hover); }
.add-btn .plus { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 16px; line-height: 1; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 7px 8px; border-radius: 6px; text-align: left; width: 100%; color: var(--ink); min-width: 0; }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item .ic { width: 18px; text-align: center; flex: none; color: var(--muted); }
.nav-item.on .ic { color: var(--accent); }
.nav-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .cnt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-item .cnt.alert { color: var(--danger); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.side-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 4px; font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side-h button { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; border-radius: 4px; }
.side-h button:hover { color: var(--ink); background: var(--hover); }
.side-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--line); }
.ico-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); position: relative; flex: none; }
.ico-btn:hover { background: var(--hover); color: var(--ink); }
.badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 8px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid transparent; }
.menu-toggle { display: none; }
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; min-width: 0; }
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; }
.kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar.sm { width: 20px; height: 20px; }
.scroll { flex: 1; overflow-y: auto; min-height: 0; }
.content { max-width: 860px; margin: 0 auto; padding-block: 8px 120px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.content.wide { max-width: none; }
.view-h { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 10px 0 14px; }
.view-h h1 { font-family: var(--f-display); font-size: 30px; font-weight: 600; letter-spacing: -.015em; margin: 0; line-height: 1.1; text-wrap: balance; }
.view-h .sub { color: var(--muted); font-size: 13px; padding-bottom: 3px; }
.view-tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 7px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn[disabled] { opacity: .5; cursor: default; }

/* Aufgabenliste */
.group { margin-bottom: 22px; }
.group-h { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13.5px; }
.group-h .n { color: var(--muted); font-weight: 400; font-size: 12px; }
.group-h .act { margin-left: auto; display: flex; gap: 4px; }
.group-h.overdue { color: var(--danger); }
.task { display: flex; gap: 10px; padding: 9px 4px 9px 0; border-bottom: 1px solid var(--line); align-items: flex-start; position: relative; cursor: pointer; }
.task:hover { background: linear-gradient(90deg, transparent, var(--hover) 10%, var(--hover) 90%, transparent); }
.task.sub { padding-left: 30px; }
.task.drag-over { box-shadow: inset 0 2px 0 var(--accent); }
.task.dragging { opacity: .4; }
.chk { width: 19px; height: 19px; border-radius: 50%; border: 1.6px solid var(--p4); background: transparent; flex: none; margin-top: 1px; padding: 0; display: grid; place-items: center; color: transparent; font-size: 11px; transition: background .12s; }
.chk.p1 { border-color: var(--p1); background: color-mix(in srgb, var(--p1) 10%, transparent); }
.chk.p2 { border-color: var(--p2); background: color-mix(in srgb, var(--p2) 10%, transparent); }
.chk.p3 { border-color: var(--p3); background: color-mix(in srgb, var(--p3) 10%, transparent); }
.chk:hover { color: var(--muted); }
.chk.done { background: var(--p4); border-color: var(--p4); color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-title { overflow-wrap: anywhere; }
.task.completed .task-title { text-decoration: line-through; color: var(--muted); }
.task-desc { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 12px; color: var(--muted); align-items: center; }
.meta .due { display: inline-flex; gap: 4px; align-items: center; }
.meta .due.today { color: var(--ok); } .meta .due.over { color: var(--danger); } .meta .due.tomorrow { color: var(--warn); } .meta .due.week { color: #7c5cc4; }
.meta .lab { color: var(--muted); }
.meta .obj { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11px; background: var(--surface-2); border-radius: 4px; padding: 0 5px; color: var(--ink); }
.meta .proj { margin-left: auto; display: inline-flex; gap: 5px; align-items: center; }
.task-right { display: flex; align-items: center; gap: 6px; flex: none; }
.add-inline { display: flex; align-items: center; gap: 8px; color: var(--muted); border: 0; background: transparent; padding: 8px 0; width: 100%; text-align: left; }
.add-inline:hover { color: var(--accent); }
.add-inline .plus { color: var(--accent); font-size: 17px; width: 19px; text-align: center; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h3 { font-family: var(--f-display); font-size: 22px; color: var(--ink); margin: 0 0 6px; font-weight: 600; }
.empty p { max-width: 46ch; margin: 0 auto 14px; }

/* Board */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.col { width: 280px; flex: none; background: var(--surface-2); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.col.drag-over { outline: 2px dashed var(--accent); }
.col-h { display: flex; align-items: center; gap: 6px; font-weight: 600; padding: 4px 6px; }
.col-h .n { color: var(--muted); font-weight: 400; font-size: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: flex; gap: 8px; cursor: pointer; }
.card:hover { border-color: var(--muted); }
.card .meta .proj { margin-left: 0; }

/* Kalender */
.cal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-h strong { font-family: var(--f-display); font-size: 20px; min-width: 170px; }
.cal-wrap { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 770px; }
.cal .dh { padding: 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal .day { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); }
.cal .day.other { background: var(--bg); }
.cal .day.today .num { background: var(--accent); color: var(--accent-ink); border-radius: 50%; }
.cal .day.drag-over { box-shadow: inset 0 0 0 2px var(--accent); }
.cal .day .top { display: flex; align-items: center; justify-content: space-between; }
.cal .num { font-size: 12px; width: 22px; height: 22px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.cal .day .plusday { border: 0; background: transparent; color: var(--muted); opacity: 0; font-size: 15px; }
.cal .day:hover .plusday { opacity: 1; }
.chip { font-size: 11.5px; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); border-left: 3px solid var(--p4); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.p1 { border-left-color: var(--p1); } .chip.p2 { border-left-color: var(--p2); } .chip.p3 { border-left-color: var(--p3); }
.chip.done { text-decoration: line-through; color: var(--muted); }

/* Detail-Schublade */
.drawer-bg { position: fixed; inset: 0; background: rgba(20,20,10,.28); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 31; box-shadow: var(--shadow);
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px); }
.drawer-h { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 16px; }
.d-title { display: flex; gap: 10px; align-items: flex-start; }
.d-title textarea { flex: 1; border: 0; resize: none; font-size: 19px; font-weight: 600; background: transparent; outline: none; padding: 0; line-height: 1.3; min-width: 0; }
.d-desc { width: 100%; border: 1px solid transparent; border-radius: 6px; background: transparent; resize: vertical; min-height: 60px; padding: 6px 8px; color: var(--ink); }
.d-desc:hover, .d-desc:focus { border-color: var(--line); outline: none; }
.props { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; align-items: center; font-size: 13px; }
.props label { color: var(--muted); }
.props input, .props select { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 8px; min-width: 0; width: 100%; }
.inline-row { display: flex; gap: 6px; min-width: 0; }
.inline-row > * { min-width: 0; }
.sec-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sec-h .act { margin-left: auto; text-transform: none; letter-spacing: 0; }
.comment { display: flex; gap: 10px; }
.comment .c-b { flex: 1; min-width: 0; }
.comment .c-h { font-size: 12px; color: var(--muted); }
.comment .c-h b { color: var(--ink); font-weight: 600; }
.comment .c-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.att { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.att img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.att a { font-size: 12px; color: var(--accent); }
.composer { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.composer textarea { border: 0; outline: none; resize: vertical; background: transparent; min-height: 50px; }
.composer .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.act-line { font-size: 12px; color: var(--muted); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20,20,10,.32); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: min(620px, 100%); max-height: 80vh; overflow-y: auto; display: flex; flex-direction: column; }
.modal-h { padding: 14px 18px 0; display: flex; align-items: center; gap: 8px; }
.modal-h h2 { font-family: var(--f-display); font-size: 21px; margin: 0; font-weight: 600; }
.modal-b { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.qa-input { width: 100%; border: 0; outline: none; font-size: 17px; background: transparent; font-weight: 500; }
.qa-desc { width: 100%; border: 0; outline: none; background: transparent; color: var(--muted); resize: none; }
.qa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qchip { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; display: inline-flex; gap: 5px; align-items: center; background: var(--surface); }
.qchip.set { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.qa-sel { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-sel select, .qa-sel input { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 3px 6px; font-size: 12.5px; max-width: 100%; }
.suggest { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.suggest button { display: flex; width: 100%; gap: 8px; align-items: center; border: 0; background: transparent; padding: 6px 10px; text-align: left; }
.suggest button.on, .suggest button:hover { background: var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 7px 10px; }
.hint { font-size: 12px; color: var(--muted); }
.help-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.help-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.help-table code, code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.copybox { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 10px; white-space: pre-wrap; font-size: 12.5px; user-select: all; overflow-wrap: anywhere; }

/* Popover-Menü */
.menu { position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); padding: 4px; min-width: 200px; max-width: calc(100vw - 24px); }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* Team & Statistik */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.member { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.member:hover { border-color: var(--muted); }
.member .mh { display: flex; gap: 10px; align-items: center; min-width: 0; }
.member .mh .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .mh .tag { font-size: 11px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.stats b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; font-family: var(--f-display); }
.stats span { font-size: 11px; color: var(--muted); }
.stats .bad b { color: var(--danger); }
.bars { display: flex; gap: 8px; align-items: flex-end; height: 110px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b.goal i { background: var(--accent); }
.ring { --v: 0; width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--v) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.feed-day { font-weight: 600; margin: 18px 0 6px; font-size: 13px; }
.feed-item { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: flex-start; }
.feed-item .t { color: var(--muted); font-size: 12px; margin-left: auto; flex: none; font-variant-numeric: tabular-nums; }
.feed-item .tx { min-width: 0; overflow-wrap: anywhere; }
.list-plain { display: flex; flex-direction: column; }
.list-plain .row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.list-plain .row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: 11px; border-radius: 999px; padding: 1px 8px; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); border-radius: 8px; padding: 9px 14px; z-index: 60; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast button { border: 0; background: transparent; color: var(--brand); font-weight: 600; }
.banner { margin: 8px 0; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); font-size: 13px; }
.fab { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 35; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .18s; box-shadow: var(--shadow); padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .side.open { transform: none; }
  .menu-toggle { display: grid; }
  .kbd { display: none; }
  .view-h h1 { font-size: 25px; }
  .props { grid-template-columns: 96px 1fr; }
  .meta .proj { margin-left: 0; }
  .fab { display: grid; position: fixed; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 28px; place-items: center; box-shadow: var(--shadow); z-index: 20; }
}

/* ===== Selbst gehostet: Anmeldung, Auswahl, Druck ===== */
.auth { min-height: 100%; display: grid; place-items: center; padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px 26px; box-shadow: var(--shadow); }
.auth-h { font-family: var(--f-display); font-size: 26px; margin: 0 0 10px; font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.auth-form .btn { justify-content: center; padding: 9px 14px; }
.auth-err { color: var(--danger); margin: 0; font-size: 13px; }
.task.selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.bulkbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 45; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: calc(100vw - 24px); }
.bulkbar label.btn { gap: 4px; }
.bulkbar input[type=date] { border: 0; background: transparent; font-size: 12px; }
.member-pick { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.member-pick label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.who .btn { font-size: 12.5px; padding: 4px 10px; }
.offline { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 70; background: var(--warn); color: #fff; text-align: center; font-size: 12.5px; padding: 3px 8px; }
@media (max-width: 860px) { .who .btn[data-act="bulk"] { padding: 4px 8px; } .who .ico-btn[data-act="print"] { display: none; } }
@media print {
  .side, .topbar, .fab, .drawer, .drawer-bg, .modal-bg, .bulkbar, .toast, .add-inline, .view-tools, .chk, .offline { display: none !important; }
  .app { display: block; } .main, .scroll { overflow: visible; height: auto; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .content { max-width: none; padding: 0; }
  .task { break-inside: avoid; padding: 5px 0; }
  .task::before { content: "☐"; margin-right: 6px; }
  .meta .proj { margin-left: 8px; }
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
body:has(#bulkbar) .toast { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }

/* =====================================================================
   Version 2.3 – Optik im Todoist-Stil: weiße Arbeitsfläche, warme Seitenleiste,
   Rot als Akzent, Systemschrift, runde Prioritäts-Häkchen, Aktionen beim Überfahren
   ===================================================================== */
:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #fcfaf8; --ink: #202020; --muted: #808080; --line: #f0f0f0; --line-2: #e6e6e6;
  --accent: #dc4c3e; --accent-ink: #ffffff; --brand: #dc4c3e; --accent-soft: #ffefe5; --hover: #f5f2ef; --side-hover: #f2efed;
  --p1: #d1453b; --p2: #eb8909; --p3: #246fe0; --p4: #999999; --ok: #058527; --warn: #ad6200; --danger: #d1453b; --week: #692ec2;
  --shadow: 0 0 0 1px rgba(0,0,0,.08), 0 8px 28px rgba(0,0,0,.12);
  --f-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 6px; --side: 280px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #1e1e1e; --surface: #1e1e1e; --surface-2: #282828; --ink: #e6e6e6; --muted: #8f8f8f; --line: #2e2e2e; --line-2: #3a3a3a;
  --accent: #e05244; --accent-soft: #3a2422; --hover: #2a2a2a; --side-hover: #333; --p1: #ff7066; --p2: #ff9a14; --p3: #5297ff; --p4: #8f8f8f; --ok: #25b84c; --warn: #f0a63c; --danger: #ff7066; --week: #a970ff;
  --shadow: 0 0 0 1px rgba(255,255,255,.08), 0 8px 28px rgba(0,0,0,.5); } }
:root[data-theme="dark"] {
  --bg: #1e1e1e; --surface: #1e1e1e; --surface-2: #282828; --ink: #e6e6e6; --muted: #8f8f8f; --line: #2e2e2e; --line-2: #3a3a3a;
  --accent: #e05244; --accent-soft: #3a2422; --hover: #2a2a2a; --side-hover: #333; --p1: #ff7066; --p2: #ff9a14; --p3: #5297ff; --p4: #8f8f8f; --ok: #25b84c; --warn: #f0a63c; --danger: #ff7066; --week: #a970ff; }
body { font-size: 14px; line-height: 1.5; letter-spacing: -.003em; -webkit-font-smoothing: antialiased; }
.ic-svg { flex: none; display: block; }
.testbar { display: none; background: #f59e0b; color: #1e1e1e; text-align: center; font-size: 12px; font-weight: 700; padding: 3px; }
body.is-test .testbar { display: block; }

/* Seitenleiste */
.side { background: var(--surface-2); border-right: 0; padding-inline: 10px; gap: 2px; }
.brand { padding: 4px 6px 12px; }
.brand-mark { background: var(--accent); width: 28px; height: 28px; border-radius: 8px; font-family: var(--f-body); font-size: 10.5px; font-weight: 800; }
.brand-name { font-family: var(--f-body); font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-name small { display: none; }
.add-btn { color: var(--accent); font-weight: 600; padding: 6px 8px; margin-bottom: 4px; }
.add-btn .plus { width: 24px; height: 24px; background: var(--accent); color: #fff; }
.add-btn:hover { background: var(--side-hover); }
.nav-item { padding: 6px 8px; border-radius: 5px; font-size: 14px; color: var(--ink); gap: 9px; }
.nav-item .ic { width: 22px; display: grid; place-items: center; color: var(--muted); }
.nav-item:hover { background: var(--side-hover); }
.nav-item.on { background: var(--accent-soft); color: #c8372a; font-weight: 500; }
.nav-item.on .ic { color: var(--accent); }
.nav-item .cnt { color: var(--muted); font-size: 12px; }
.side-h { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--muted); padding: 16px 8px 4px; }
.side-foot { border-top: 0; }
.ico-btn { border-radius: 5px; }

/* Arbeitsfläche */
.topbar { padding-block: 8px; }
.search { background: var(--surface-2); border-color: transparent; border-radius: 6px; max-width: 360px; }
.search:focus-within { background: var(--surface); border-color: var(--line-2); }
.content { max-width: 820px; padding-top: 18px; }
.view-h { padding-bottom: 6px; margin-bottom: 8px; border-bottom: 0; align-items: center; }
.view-h h1 { font-family: var(--f-body); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.view-h .sub { font-size: 12px; color: var(--muted); }
.btn { border-radius: 5px; border-color: var(--line-2); font-size: 13px; font-weight: 500; padding: 5px 10px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #c3392b; }
.btn.ghost:hover, .btn:hover { background: var(--hover); }
.btn.primary:hover { background: #c3392b; }
.seg { border-radius: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* Gruppen und Aufgabenzeilen */
.group { margin-bottom: 18px; }
.group-h { border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; padding: 8px 0 6px; }
.group-h.overdue { color: var(--ink); }
.group-h.overdue .act .btn { color: var(--accent); border: 0; font-weight: 500; }
.task { gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task:hover { background: transparent; }
.task.sub { padding-left: 28px; }
.chk { width: 18px; height: 18px; border-width: 1px; margin-top: 2px; color: transparent; }
.chk svg { width: 11px; height: 11px; }
.chk.p1 { border-width: 2px; background: rgba(209,69,59,.1); } .chk.p2 { border-width: 2px; background: rgba(235,137,9,.1); } .chk.p3 { border-width: 2px; background: rgba(36,111,224,.1); }
.chk:hover { color: var(--p4); } .chk.p1:hover { color: var(--p1); } .chk.p2:hover { color: var(--p2); } .chk.p3:hover { color: var(--p3); }
.chk.done { background: var(--p4); color: #fff; }
.chk.done.p1 { background: var(--p1); } .chk.done.p2 { background: var(--p2); } .chk.done.p3 { background: var(--p3); }
.task-title { font-size: 14px; line-height: 1.45; }
.task-desc { font-size: 12px; color: var(--muted); }
.meta { gap: 2px 12px; font-size: 12px; margin-top: 2px; }
.meta > span { display: inline-flex; align-items: center; gap: 3px; }
.meta .due { color: var(--muted); }
.meta .due.today { color: var(--ok); } .meta .due.over { color: var(--danger); } .meta .due.tomorrow { color: var(--warn); } .meta .due.week { color: var(--week); }
.meta .proj { color: var(--muted); }
.meta .obj { background: var(--hover); }
.task-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .1s; flex: none; align-self: flex-start; }
.task:hover .task-acts, .task:focus-within .task-acts { opacity: 1; }
.task-acts .ta { border: 0; background: transparent; width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); border-radius: 5px; padding: 0; }
.task-acts .ta:hover { background: var(--hover); color: var(--ink); }
@media (hover: none) { .task-acts { display: none; } }
.add-inline { color: var(--muted); padding: 8px 0; gap: 8px; }
.add-inline .plus { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); }
.add-inline:hover { color: var(--accent); }
.add-inline:hover .plus { background: var(--accent); color: #fff; }
.empty h3 { font-family: var(--f-body); font-weight: 700; font-size: 17px; }

/* Board / Karten */
.col { background: transparent; }
.card { border-radius: 8px; border: 1px solid var(--line-2); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }

/* Detailansicht: wie Todoist mittig als großes Fenster */
@media (min-width: 900px) {
  .drawer { top: 6vh; bottom: 6vh; right: auto; left: 50%; transform: translateX(-50%); width: min(860px, 92vw); border-radius: 10px; border: 0; box-shadow: var(--shadow); }
  .drawer-bg { background: rgba(0,0,0,.42); }
}
.drawer-h { font-size: 13px; color: var(--muted); }
.d-title textarea { font-family: var(--f-body); font-size: 20px; font-weight: 700; }
.sec-h { font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; }

/* Schnell-Eingabe wie Todoist */
.modal { border-radius: 10px; }
.modal-h h2 { font-family: var(--f-body); font-size: 17px; font-weight: 700; }
.qa-input { font-size: 15px; font-weight: 600; }
.qa-desc { font-size: 13px; }
.qchip { border-radius: 5px; border-color: var(--line-2); color: var(--muted); }
.qchip.set { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.modal-f { border-top: 1px solid var(--line); }

/* Hinweise, Menüs */
.menu { border-radius: 8px; border: 0; box-shadow: var(--shadow); padding: 4px; }
.menu button { border-radius: 5px; font-size: 13px; }
.menu button:hover { background: var(--hover); }
.pill.ok { background: rgba(5,133,39,.12); color: var(--ok); }
.offer { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; background: var(--surface-2); }
.offer > svg { color: var(--accent); }
.push-state { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 8px; color: var(--muted); }
.push-state.on { color: var(--ok); } .push-state.denied { color: var(--danger); }
.fab { background: var(--accent); }
.auth-card .brand-mark { background: var(--accent); }
.avatar { font-family: var(--f-body); }

/* ---------- F&E App-Rahmen (identisch zu lib/fe-rahmen.php, Version 1.0.0) ---------- */
.fer-top{display:flex;align-items:center;gap:12px;min-width:0}
.fer-dd{position:relative}
.fer-appbtn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;flex:0 0 40px;border-radius:10px;border:1px solid rgba(127,127,127,.35);background:transparent;color:inherit;cursor:pointer;padding:0;font:inherit}
.fer-appbtn:hover{background:rgba(127,127,127,.12)}
.fer-appbtn:focus-visible,.fer-dd.open .fer-appbtn{outline:2px solid #2563eb;outline-offset:1px}
.fer-app{display:inline-flex;align-items:center;gap:10px;min-width:0;color:inherit;text-decoration:none;font-weight:700;font-size:17px;line-height:1.2}
.fer-app:hover{text-decoration:none}
.fer-app>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fer-appico{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex:0 0 32px;border-radius:9px;color:#fff}
.fer-appico svg{width:18px;height:18px}
.fer-env{font-style:normal;font-size:11px;font-weight:700;background:#ea580c;color:#fff;border-radius:6px;padding:1px 6px;margin-left:6px;vertical-align:middle}
.fer-menu{display:none;position:absolute;left:0;top:calc(100% + 8px);z-index:1000;min-width:260px;max-height:70vh;overflow:auto;background:#fff;color:#23241c;border:1px solid #e4e4dc;border-radius:12px;box-shadow:0 12px 32px rgba(0,0,0,.18);padding:6px;font-size:15px;font-weight:400;text-align:left}
.fer-dd.open .fer-menu{display:block}
.fer-menu a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:8px;color:#23241c!important;text-decoration:none!important;white-space:nowrap}
.fer-menu a:hover,.fer-menu a.on{background:#f3f3ee}
.fer-dot{width:11px;height:11px;flex:0 0 11px;border-radius:3px}
.fer-menu a.fer-all{border-top:1px solid #e4e4dc;margin-top:6px;border-radius:0 0 8px 8px;padding-top:12px}
.fer-user{border-top:1px solid rgba(127,127,127,.25);padding:14px 4px 6px;margin-top:8px}
.fer-me{display:flex;align-items:center;gap:12px;min-width:0}
.fer-av{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;flex:0 0 42px;border-radius:50%;background:#f5a623;color:#23241c;font-weight:700;font-size:17px}
.fer-who{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.fer-who b{font-size:16px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fer-who small{font-size:13px;opacity:.65;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fer-links{margin-top:10px;font-size:13px;line-height:1.6;opacity:.75}
.fer-links a{color:inherit!important;text-decoration:none}
.fer-links a:hover{text-decoration:underline;opacity:1}
.fer-user.fer-inline{border-top:0;margin:0;padding:0}
.fer-user.fer-inline .fer-links{margin-top:2px}
@media print{.fer-dd,.fer-user{display:none!important}
}

.rahmen-mob { display: none; }
@media (max-width: 860px) { .rahmen-mob { display: block; } .rahmen-mob .fer-appbtn { width: 36px; height: 36px; flex-basis: 36px; } }
.brand .fer-top { min-width: 0; flex: 1; }
.brand .fer-app { font-size: 15px; }
.side-foot .fer-user { margin: 10px 0 0; padding-inline: 6px; }
.brand { gap: 6px; }
.brand .fer-top { gap: 10px; }
.brand .fer-app { gap: 8px; }
.brand .fer-app .fer-env { margin-left: 4px; }
.side-foot { padding-bottom: 12px; }
.brand .fer-env { display: none; } /* Test-Hinweis zeigt der orange Balken oben */

/* ---------- 2.4.0: einheitlicher F&E-Rahmen 2.0 (Kopfzeile + Navigationsleiste links aus lib/fe-rahmen.php) ---------- */
html.fer-on, html.fer-on body { height: auto; }
html.fer-on body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; box-sizing: border-box; }
html.fer-on .app { flex: 1; min-height: 0; height: auto; grid-template-columns: 1fr; }
.app > .side { display: none !important; }
body > #search-box { display: none; }
.fer-hd .search { flex: 1 1 auto; max-width: 520px; margin: 0 auto; border-radius: 999px; background: #f5f5f1; border: 1px solid #e3e3dc; padding: 0 12px; color: #23241c; }
.fer-hd .search input { padding: 8px 0; color: #23241c; }
.fer-hd .search .kbd { opacity: .6; }
.fer-hd .fer-x.btn { font-size: 12.5px; padding: 4px 10px; color: #23241c; }
.fer-hd .fer-x.ico-btn { color: #23241c; }
.fer-sd .fer-it .fer-i svg { width: 18px; height: 18px; }
.fer-sd .fer-it .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.drawer-bg { z-index: 960; } .drawer { z-index: 961; } .modal-bg { z-index: 970; } .menu { z-index: 980; } .bulkbar { z-index: 965; } .toast { z-index: 990; } .offline { z-index: 995; }
@media (max-width: 900px) { .fer-hd .fer-x.fer-print { display: none; } html.fer-open .fab { display: none !important; } }
@media (max-width: 600px) { .fer-hd .fer-x.btn { display: none; } }
@media print { .fer-hd, .fer-sd { display: none !important; } html.fer-on body { display: block; height: auto; } }
