/* Aufgaben – Stil */
:root {
  --accent: #3b5bdb; --accent-2: #2f4ac0; --accent-soft: #e7ecff;
  --bg: #ffffff; --bg-side: #f7f7f5; --bg-hover: #f0f0ee; --bg-elev: #ffffff; --bg-input: #ffffff;
  --text: #202124; --muted: #6b6f76; --faint: #9aa0a6; --line: #e6e6e3; --line-strong: #d4d4d0;
  --p1: #d1453b; --p2: #eb8909; --p3: #2f6fdb; --p4: #9aa0a6;
  --today: #188038; --tomorrow: #c26401; --week: #7b4cc2; --overdue: #d1453b;
  --shadow: 0 8px 30px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.08);
  --radius: 10px; --side-w: 280px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --accent: #7b93f0; --accent-2: #94a8f5; --accent-soft: #262d45;
  --bg: #1c1f26; --bg-side: #171a20; --bg-hover: #262a33; --bg-elev: #242833; --bg-input: #1f232b;
  --text: #e8e9ec; --muted: #a3a8b3; --faint: #737985; --line: #2e333d; --line-strong: #3b414d;
  --p1: #ff6b5e; --p2: #ffa23a; --p3: #6d9cff; --p4: #737985;
  --today: #4cc46f; --tomorrow: #ffa23a; --week: #b08cf2; --overdue: #ff6b5e;
  --shadow: 0 8px 30px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Grundlayout ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; height: 100dvh; }
.shell.side-closed { grid-template-columns: 0 1fr; }
.side {
  background: var(--bg-side); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden;
  padding: calc(10px + var(--safe-t)) 10px 20px; display: flex; flex-direction: column; gap: 2px;
}
.side-closed .side { visibility: hidden; padding: 0; border: 0; }
.main { overflow-y: auto; position: relative; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--safe-t)) 14px 8px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); min-height: 52px;
}
.topbar .grow { flex: 1; }
.content { width: 100%; max-width: 860px; margin: 0 auto; padding: 4px 28px 120px; flex: 1; }
.content.wide { max-width: none; }
h1.view-title { font-size: 24px; margin: 6px 0 14px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
h1.view-title .sub { font-size: 13px; font-weight: 400; color: var(--muted); }

/* ---------- Seitenleiste ---------- */
.side-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 8px; }
.side-head .me { flex: 1; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; border: 0; background: none; text-align: left; min-width: 0; }
.side-head .me:hover { background: var(--bg-hover); }
.side-head .me span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.nav-add { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; padding: 8px; border-radius: 8px; border: 0; background: none; width: 100%; text-align: left; }
.nav-add:hover { background: var(--bg-hover); }
.nav-add .plus { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.nav-add .plus svg { width: 14px; height: 14px; stroke-width: 2.6; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text);
  text-decoration: none; min-height: 36px; position: relative; user-select: none;
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
:root[data-theme="dark"] .nav-item.active { color: var(--text); }
.nav-item .label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count { font-size: 12px; color: var(--muted); }
.nav-item .more { opacity: 0; border: 0; background: none; padding: 2px; border-radius: 6px; color: var(--muted); }
.nav-item:hover .more, .nav-item:focus-within .more { opacity: 1; }
@media (hover: none) { .nav-item .more { display: none; } }
.nav-item .i.today-ic { color: var(--today); }
.nav-item .i.inbox-ic { color: var(--p3); }
.nav-item .i.upcoming-ic { color: var(--week); }
.nav-item .i.filter-ic { color: var(--tomorrow); }
.nav-group { margin-top: 14px; }
.nav-group-head { display: flex; align-items: center; padding: 4px 8px; color: var(--muted); font-size: 13px; font-weight: 600; gap: 4px; }
.nav-group-head .grow { flex: 1; }
.nav-group-head button { border: 0; background: none; color: var(--muted); padding: 3px; border-radius: 6px; display: grid; place-items: center; }
.nav-group-head button:hover { background: var(--bg-hover); color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 4px; }
.hash { width: 18px; text-align: center; font-weight: 700; flex: none; }
.side-foot { margin-top: auto; padding-top: 16px; font-size: 12px; color: var(--faint); display: flex; gap: 8px; align-items: center; padding-left: 8px; }

.iconbtn { border: 0; background: none; padding: 7px; border-radius: 8px; color: var(--muted); display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--bg-hover); color: var(--text); }
.iconbtn.on { color: var(--accent); }
.syncdot { width: 8px; height: 8px; border-radius: 50%; background: var(--today); display: inline-block; }
.syncdot.busy { background: var(--tomorrow); }
.syncdot.off { background: var(--overdue); }
.status-pill { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; padding: 4px 8px; border-radius: 99px; }
.status-pill.off { background: color-mix(in srgb, var(--overdue) 12%, transparent); color: var(--overdue); }

/* ---------- Aufgabenliste ---------- */
.group { margin-bottom: 22px; }
.group-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 14px; position: relative;
}
.group-head .grow { flex: 1; }
.group-head .cnt { color: var(--muted); font-weight: 400; font-size: 13px; }
.group-head .toggle { border: 0; background: none; padding: 2px; color: var(--muted); border-radius: 6px; display: grid; place-items: center; margin-left: -26px; width: 24px; }
.group-head .toggle svg { transition: transform .15s; }
.group-head.collapsed .toggle svg { transform: rotate(-90deg); }
.group-head .link { border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.group-head .link:hover { background: var(--accent-soft); }
.group-head .more { opacity: 0; }
.group-head:hover .more { opacity: 1; }
@media (hover: none) { .group-head .more { opacity: 1; } .group-head .toggle { margin-left: 0; } }
.tasks { list-style: none; margin: 0; padding: 0; min-height: 6px; }
.task {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 0 9px; border-bottom: 1px solid var(--line);
  position: relative; background: var(--bg); cursor: pointer; touch-action: pan-y;
}
.task .sub-toggle { position: absolute; left: -26px; top: 10px; border: 0; background: none; color: var(--muted); padding: 2px; border-radius: 6px; display: grid; }
.task .sub-toggle svg { transition: transform .15s; }
.task.collapsed .sub-toggle svg { transform: rotate(-90deg); }
@media (hover: none) { .task .sub-toggle { position: static; order: -1; margin: 0 -6px 0 -4px; } }
.task .body { flex: 1; min-width: 0; }
.task .title { word-wrap: break-word; overflow-wrap: anywhere; }
.task .title a { word-break: break-all; }
.task .desc { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.task .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.task .meta span { display: inline-flex; align-items: center; gap: 3px; }
.task .meta svg { width: 13px; height: 13px; }
.task .meta .proj { margin-left: auto; }
.task .actions { display: flex; gap: 0; opacity: 0; margin-top: -3px; }
.task:hover .actions, .task:focus-within .actions { opacity: 1; }
@media (hover: none) { .task .actions { display: none; } }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task.dragging { opacity: .35; }
.task.selected { background: var(--accent-soft); }
.task .avatar { margin-top: 1px; }
.due.today { color: var(--today); } .due.tomorrow { color: var(--tomorrow); } .due.week { color: var(--week); }
.due.overdue { color: var(--overdue); } .due.later { color: var(--muted); }
.lbl { color: var(--muted); }
.lbl::before { content: '@'; opacity: .7; }

/* Checkbox */
.check {
  width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid var(--p4); background: transparent; padding: 0;
  flex: none; margin-top: 1px; display: grid; place-items: center; color: transparent; position: relative;
  transition: background .12s;
}
.check svg { width: 12px; height: 12px; stroke-width: 3; }
.check:hover { color: var(--p4); }
.check.p1 { border-color: var(--p1); background: color-mix(in srgb, var(--p1) 12%, transparent); border-width: 2px; }
.check.p2 { border-color: var(--p2); background: color-mix(in srgb, var(--p2) 12%, transparent); border-width: 2px; }
.check.p3 { border-color: var(--p3); background: color-mix(in srgb, var(--p3) 12%, transparent); border-width: 2px; }
.check.p1:hover { color: var(--p1); } .check.p2:hover { color: var(--p2); } .check.p3:hover { color: var(--p3); }
.check.checked { background: var(--p4); border-color: var(--p4); color: #fff; }
.check.checked.p1 { background: var(--p1); } .check.checked.p2 { background: var(--p2); } .check.checked.p3 { background: var(--p3); }
.check.recurring::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px dashed currentColor; opacity: 0; }
.check.pop { animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.25); } }

.add-row {
  display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 9px 0; border: 0; background: none; width: 100%; text-align: left;
}
.add-row .plus { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); }
.add-row:hover { color: var(--accent); }
.add-row:hover .plus { background: var(--accent); color: #fff; }
.add-section {
  display: flex; align-items: center; gap: 10px; color: var(--accent); font-weight: 600; font-size: 13px; width: 100%;
  border: 0; background: none; padding: 6px 0; opacity: 0; transition: opacity .15s;
}
.add-section::before, .add-section::after { content: ''; flex: 1; height: 1px; background: var(--accent); }
.add-section:hover, .add-section:focus { opacity: 1; }
@media (hover: none) { .add-section { opacity: .8; } }

.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty .big { margin-bottom: 10px; color: var(--faint); }
.empty .big svg { width: 48px; height: 48px; stroke-width: 1.3; }
.empty b { color: var(--text); display: block; margin-bottom: 4px; font-size: 16px; }

/* Board-Ansicht */
.board { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding-bottom: 20px; }
.board .column { width: 290px; flex: none; }
.board .column .group-head { border-bottom: 0; }
.board .task { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.board .task .sub-toggle { display: none; }
.board .add-row { padding: 6px 0; }

/* Demnächst */
.week-strip { display: flex; gap: 4px; margin-bottom: 18px; position: sticky; top: 52px; z-index: 4; background: var(--bg); padding: 4px 0 10px; border-bottom: 1px solid var(--line); }
.week-strip button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; }
.week-strip button b { font-size: 16px; color: var(--text); }
.week-strip button.today b { color: var(--accent); }
.week-strip button.has::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
.week-strip button:hover { background: var(--bg-hover); }
.week-strip .nav { flex: 0 0 34px; }

/* Avatare */
.avatar {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
  color: #fff; flex: none; text-transform: uppercase;
}
.avatar.lg { width: 32px; height: 32px; font-size: 14px; }

/* ---------- Ebenen: Dialoge, Menüs ---------- */
#layer > * { z-index: 50; }
.backdrop { position: fixed; inset: 0; background: rgba(15,17,22,.45); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; z-index: 40; animation: fade .12s; }
.backdrop.clear { background: transparent; }
@keyframes fade { from { opacity: 0; } }
.dialog {
  background: var(--bg-elev); border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 560px;
  max-height: 84vh; display: flex; flex-direction: column; overflow: hidden; animation: rise .15s;
}
.dialog.wide { max-width: 860px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.dialog header { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px 20px; border-bottom: 1px solid var(--line); }
.dialog header h2 { font-size: 16px; margin: 0; flex: 1; }
.dialog .dbody { padding: 16px 20px; overflow-y: auto; }
.dialog footer { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); align-items: center; }
.dialog footer .grow { flex: 1; }

.btn { border: 1px solid var(--line-strong); background: var(--bg-elev); padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.primary:disabled { opacity: .5; cursor: default; }
.btn.danger { color: var(--overdue); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); background: none; border-radius: 7px;
  padding: 4px 9px; font-size: 13px; color: var(--muted); white-space: nowrap; max-width: 100%;
}
.chip:hover { background: var(--bg-hover); }
.chip.set { color: var(--text); }
.chip .x { border: 0; background: none; padding: 0 0 0 2px; color: var(--muted); display: inline-grid; }
.chip svg { width: 15px; height: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: var(--bg-input);
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea.input { resize: vertical; min-height: 70px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; }
.err { color: var(--overdue); font-size: 13px; margin: 6px 0; }
.ok { color: var(--today); font-size: 13px; margin: 6px 0; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* Menü / Popover */
.menu {
  position: fixed; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  min-width: 220px; max-width: min(340px, calc(100vw - 16px)); padding: 6px; z-index: 60; max-height: 70vh; overflow-y: auto; animation: fade .1s;
}
.menu .mi { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 6px; text-align: left; font-size: 14px; }
.menu .mi:hover, .menu .mi.focus { background: var(--bg-hover); }
.menu .mi .grow { flex: 1; }
.menu .mi .key { font-size: 12px; color: var(--faint); }
.menu .mi.danger { color: var(--overdue); }
.menu .mi.checked::after { content: '✓'; color: var(--accent); margin-left: auto; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .mh { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; font-weight: 600; }
.menu .quickrow { display: flex; gap: 4px; padding: 4px 6px; }
.menu .quickrow button { flex: 1; border: 0; background: none; border-radius: 6px; padding: 6px; display: grid; place-items: center; }
.menu .quickrow button:hover { background: var(--bg-hover); }
.menu .search { width: 100%; margin-bottom: 4px; }

/* Datumswähler */
.datepicker { width: 290px; padding: 0; }
.datepicker .dp-input { padding: 10px; border-bottom: 1px solid var(--line); }
.datepicker .dp-input input { width: 100%; border: 0; outline: none; background: none; font-size: 14px; }
.datepicker .dp-preview { font-size: 12.5px; color: var(--muted); margin-top: 4px; min-height: 17px; }
.datepicker .dp-preview.bad { color: var(--overdue); }
.datepicker .dp-quick .mi { padding: 7px 12px; }
.datepicker .dp-quick .mi .key { margin-left: auto; }
.cal { padding: 8px 10px; border-top: 1px solid var(--line); }
.cal-head { display: flex; align-items: center; margin-bottom: 4px; font-weight: 600; font-size: 14px; }
.cal-head .grow { flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; font-size: 13px; }
.cal-grid .wd { color: var(--muted); font-size: 11px; padding: 2px 0; }
.cal-grid button { border: 0; background: none; border-radius: 50%; aspect-ratio: 1; padding: 0; }
.cal-grid button:hover { background: var(--bg-hover); }
.cal-grid button.past { color: var(--faint); }
.cal-grid button.today { color: var(--accent); font-weight: 700; }
.cal-grid button.sel { background: var(--accent); color: #fff; }
.dp-foot { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); align-items: center; }
.dp-foot input[type=time] { border: 1px solid var(--line-strong); border-radius: 7px; padding: 4px 6px; background: var(--bg-input); }

/* Editor (Schnelleingabe & Inline) */
.editor { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px 12px 0; background: var(--bg-elev); margin: 6px 0 10px; }
.editor:focus-within { border-color: var(--faint); }
.editor .ed-title { width: 100%; border: 0; outline: none; font-weight: 600; font-size: 15px; background: none; padding: 0; }
.editor .ed-desc { width: 100%; border: 0; outline: none; font-size: 13.5px; background: none; resize: none; padding: 2px 0 0; color: var(--text); min-height: 22px; }
.editor .ed-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 10px; }
.editor .ed-foot { display: flex; gap: 8px; border-top: 1px solid var(--line); padding: 8px 0; align-items: center; margin: 0 -12px; padding: 8px 12px; }
.editor .ed-foot .grow { flex: 1; }
.editor .tokens { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 6px; }
.tok { font-size: 12px; border-radius: 5px; padding: 1px 6px; background: var(--accent-soft); color: var(--accent-2); display: inline-flex; gap: 4px; align-items: center; }
:root[data-theme="dark"] .tok { color: var(--text); }
.tok button { border: 0; background: none; padding: 0; color: inherit; opacity: .7; font-size: 13px; line-height: 1; }
.quickadd { max-width: 620px; overflow: visible; }
.quickadd .editor { border: 0; margin: 0; }

/* Aufgaben-Details */
.detail { display: grid; grid-template-columns: 1fr 240px; min-height: 0; flex: 1; overflow: hidden; }
.detail .d-main { padding: 16px 20px 30px; overflow-y: auto; }
.detail .d-side { background: var(--bg-side); padding: 14px; overflow-y: auto; border-left: 1px solid var(--line); }
.detail .d-side .sect { border-bottom: 1px solid var(--line); padding: 8px 0 10px; }
.detail .d-side .sect:last-child { border: 0; }
.detail .d-side .sect > .h { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.detail .d-side .val { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 5px 6px; border-radius: 6px; text-align: left; font-size: 14px; }
.detail .d-side .val:hover { background: var(--bg-hover); }
.detail .d-head { display: flex; gap: 12px; align-items: flex-start; }
.detail .d-title { flex: 1; font-size: 19px; font-weight: 700; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin: -3px -6px; width: 100%; resize: none; overflow: hidden; background: none; outline: none; line-height: 1.35; }
.detail .d-title:hover { border-color: var(--line); }
.detail .d-title:focus { border-color: var(--line-strong); }
.detail .d-desc { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 6px; margin: 6px -6px 0 26px; width: calc(100% - 26px); resize: none; background: none; outline: none; min-height: 34px; font-size: 14px; overflow: hidden; }
.detail .d-desc:hover { border-color: var(--line); }
.detail .d-desc:focus { border-color: var(--line-strong); }
.detail h3 { font-size: 14px; margin: 22px 0 6px; display: flex; align-items: center; gap: 6px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 4px; align-items: center; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.comment .c-head .grow { flex: 1; }
.comment .c-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin-top: 2px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.comment-form textarea { min-height: 40px; }

/* Toasts */
#toasts { position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; align-items: center; pointer-events: none; }
.toast { background: #2b2d31; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; font-size: 14px; pointer-events: auto; animation: rise .15s; max-width: calc(100vw - 30px); }
.toast button { border: 0; background: none; color: #9fb3ff; font-weight: 700; padding: 0; }
.toast.err { background: #8c1d16; }

/* FAB (Handy) */
.fab {
  position: fixed; right: 18px; bottom: calc(22px + var(--safe-b)); width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); display: none; place-items: center; z-index: 20;
}
.fab svg { width: 26px; height: 26px; stroke-width: 2.4; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg-side); }
.login { width: 100%; max-width: 360px; background: var(--bg-elev); border-radius: 16px; box-shadow: var(--shadow); padding: 28px; }
.login h1 { margin: 0 0 4px; font-size: 22px; display: flex; gap: 10px; align-items: center; }
.login h1 img { width: 34px; height: 34px; }
.login p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.login .btn { width: 100%; padding: 10px; margin-top: 6px; }

/* Einstellungen */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.set-row .grow { flex: 1; }
.set-row .t { font-weight: 600; font-size: 14px; }
.set-row .d { color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users td, table.users th { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.color-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.color-grid button { height: 30px; border-radius: 8px; border: 2px solid transparent; }
.color-grid button.sel { border-color: var(--text); }

.lf-list .lf { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.lf-list .lf:hover { background: var(--bg-hover); }
.lf-list .lf .grow { flex: 1; }
.lf-list .lf .q { color: var(--muted); font-size: 13px; }

/* Drag & Drop */
.drag-ghost { position: fixed; pointer-events: none; z-index: 90; opacity: .95; box-shadow: var(--shadow); border-radius: 8px; background: var(--bg-elev); padding: 8px 12px; max-width: 420px; }
.drop-line { height: 2px; background: var(--accent); border-radius: 2px; position: relative; margin: -1px 0; }
.drop-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); }
.drop-line.indent { margin-left: 30px; }
body.dragging-active { user-select: none; cursor: grabbing; }

/* ---------- Handy ---------- */
@media (max-width: 760px) {
  .shell, .shell.side-closed { grid-template-columns: 1fr; }
  .side {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); z-index: 30; transform: translateX(-102%);
    transition: transform .2s; box-shadow: var(--shadow); visibility: visible !important; padding: calc(10px + var(--safe-t)) 10px 20px !important;
    border-right: 1px solid var(--line) !important;
  }
  .shell.side-open .side { transform: none; }
  .side-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; display: none; }
  .shell.side-open .side-scrim { display: block; }
  .content { padding: 0 16px calc(120px + var(--safe-b)); }
  h1.view-title { font-size: 22px; }
  .fab { display: grid; }
  .backdrop { padding: 0; align-items: flex-end; }
  .dialog { max-width: none; border-radius: 16px 16px 0 0; max-height: calc(100dvh - 30px - var(--safe-t)); padding-bottom: var(--safe-b); }
  .dialog.full { height: calc(100dvh - var(--safe-t)); max-height: none; border-radius: 0; }
  .detail { grid-template-columns: 1fr; overflow-y: auto; }
  .detail .d-main { overflow: visible; }
  .detail .d-side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .task { padding: 11px 0; }
  .menu { min-width: 0; }
  .board .column { width: 82vw; }
  .week-strip { top: calc(52px + var(--safe-t)); }
  .quickadd { position: fixed; left: 0; right: 0; bottom: 0; border-radius: 16px 16px 0 0; }
}
@media (min-width: 761px) {
  .side-scrim { display: none; }
  .hide-desktop { display: none !important; }
}
@media (max-width: 760px) { .hide-mobile { display: none !important; } }
.nav-item.drop-hover { background: var(--accent-soft); outline: 2px dashed var(--accent); }
