/* Projektboard – Styles */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --border: #e3e6ee;
  --text: #171a24;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-soft: #eef0ff;
  --danger: #dc2626;
  --ok: #16a34a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, .18);
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117; --surface: #171a23; --surface-2: #1f2330; --border: #2a2f3d;
    --text: #e8eaf1; --muted: #9aa1b2; --accent: #818cf8; --accent-2: #a5b4fc; --accent-soft: #232848;
    --danger: #f87171; --ok: #4ade80;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117; --surface: #171a23; --surface-2: #1f2330; --border: #2a2f3d;
  --text: #e8eaf1; --muted: #9aa1b2; --accent: #818cf8; --accent-2: #a5b4fc; --accent-soft: #232848;
  --danger: #f87171; --ok: #4ade80;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex-shrink: 0; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 6px 2px; margin: 0; }

.boot { display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons & Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 600; transition: transform .08s, background .15s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0f1117; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0f1117; } }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.small { height: 36px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.small { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.small svg { width: 16px; height: 16px; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 8px 2px; text-decoration: underline; text-underline-offset: 3px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { font-weight: 400; }
input:not([type=checkbox]):not([type=radio]), textarea, .select {
  width: 100%; min-width: 0; border: 1px solid var(--border); background: var(--surface); border-radius: 12px;
  padding: 10px 12px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type=date] { min-height: 44px; }
textarea { resize: vertical; min-height: 44px; }
input:focus, textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238a90a0' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.form-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-size: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.seg { display: flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 12px; }
.seg button { flex: 1; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.auth-sub { margin: -8px 0 0; color: var(--muted); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; letter-spacing: -.02em; }
.brand svg { color: var(--accent); }
.brand.big { font-size: 24px; }
.brand.big svg { width: 30px; height: 30px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.sync-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-pill.ok .dot { background: var(--ok); }
.sync-pill.pending .dot { background: #f59e0b; }
.sync-pill.syncing .dot { background: var(--accent); animation: pulse 1s infinite; }
.sync-pill.error .dot { background: var(--danger); }
.sync-pill.offline .dot { background: var(--muted); }
.sync-pill.idle .sync-text:empty { display: none; }
@keyframes pulse { 50% { opacity: .3; } }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), #ec4899); }
.avatar.lg { width: 48px; height: 48px; font-size: 20px; }

/* ---------- Ansicht ---------- */
.view { max-width: 1240px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-left)) calc(110px + env(safe-area-inset-bottom)); }
.hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hello h1 { font-size: 24px; }
.hello p { margin: 4px 0 0; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 16px; }
.stat { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: border-color .15s, transform .08s; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sc); }
.stat:active { transform: scale(.98); }
.stat.on { border-color: var(--sc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 18%, transparent); }
.stat-n { font-size: 26px; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.stat-l { font-size: 13px; color: var(--muted); font-weight: 600; }

.toolbar { display: flex; gap: 10px; }
.search { flex: 1; position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px !important; }
.toolbar .select { width: auto; flex-shrink: 0; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 4px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted); }
.chip span { font-size: 12px; background: var(--surface-2); border-radius: 99px; padding: 0 7px; line-height: 20px; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.on span { background: color-mix(in srgb, var(--bg) 20%, transparent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.card {
  cursor: pointer; outline: none;
  display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--pc); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--pc) 40%, var(--border)); }
.card:active { transform: scale(.99); }
.card.is-done { opacity: .7; }
.card.is-done h3 { text-decoration: line-through; text-decoration-color: var(--muted); }
.card-top { display: flex; align-items: center; gap: 8px; }
.card h3 { font-size: 17px; }
.card-desc { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.due { display: inline-flex; align-items: center; gap: 4px; }
.due svg { width: 14px; height: 14px; }
.due.over { color: var(--danger); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px;
  color: var(--bc); background: color-mix(in srgb, var(--bc) 14%, transparent); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bc); }
.prio.hi { color: var(--danger); display: inline-flex; margin-left: auto; }
.prio.hi svg { width: 16px; height: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-weight: 600; }

.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; border-radius: inherit; background: var(--pc, var(--accent)); transition: width .4s ease; }
.progress.big { height: 10px; flex: 1; }

.empty { grid-column: 1 / -1; text-align: center; padding: 48px 20px; border: 2px dashed var(--border); border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty-ico svg { width: 30px; height: 30px; }
.empty p { margin: 0 0 6px; color: var(--muted); max-width: 340px; }

.fab {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 15;
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px 0 18px; border-radius: 18px; border: 0;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform .1s;
}
:root[data-theme="dark"] .fab { color: #0f1117; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fab { color: #0f1117; } }
.fab:active { transform: scale(.95); }
.fab[hidden] { display: none; }

/* ---------- Detail ---------- */
.detail { max-width: 1040px; margin: 0 auto; }
.detail-nav { display: flex; align-items: center; gap: 4px; margin: -6px 0 10px -8px; }
.detail-head { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.detail-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--pc); }
.detail-head h1 { font-size: 26px; word-break: break-word; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill-select { position: relative; display: inline-flex; align-items: center; border-radius: 99px; background: color-mix(in srgb, var(--bc) 14%, transparent); color: var(--bc); }
.pill-select.neutral { --bc: var(--muted); background: var(--surface-2); color: var(--text); }
.pill-select select { appearance: none; border: 0; background: transparent; color: inherit; font-weight: 700; font-size: 13px; padding: 7px 28px 7px 12px; cursor: pointer; outline: none; }
.pill-select::after { content: ""; position: absolute; right: 12px; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); pointer-events: none; }
.pill-select select option { color: var(--text); background: var(--surface); }
.due-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); }
.due-pill svg { width: 15px; height: 15px; }
.due-pill.over { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.due-pill.muted { color: var(--muted); }
.desc { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--text); opacity: .9; }
.progress-wrap { display: flex; align-items: center; gap: 12px; }
.progress-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.progress-label b { color: var(--text); }

.detail-cols { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
@media (min-width: 860px) { .detail-cols { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.panel h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel h2 svg { color: var(--accent); width: 18px; height: 18px; }

.add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.add-row .btn { width: 44px; height: 44px; padding: 0; flex-shrink: 0; }
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 6px; padding: 2px 0; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task .icon-btn { opacity: .5; }
.task:hover .icon-btn { opacity: 1; }
.task-title { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 10px 4px !important; border-radius: 8px !important; }
.task-title:focus { background: var(--surface-2) !important; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.check { position: relative; display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; cursor: pointer; }
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.check i { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.check i svg { width: 14px; height: 14px; stroke-width: 3; color: #fff; opacity: 0; transform: scale(.5); transition: .15s; }
.check input:checked + i { background: var(--ok); border-color: var(--ok); }
.check input:checked + i svg { opacity: 1; transform: none; }
.check input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }

.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.note { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.note-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px 2px 0; }
.note time { font-size: 12px; color: var(--muted); font-weight: 600; }
.note p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.stamp { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }

/* ---------- Dialoge ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 20, .45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.overlay.open { opacity: 1; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); transform: translateY(30px); transition: transform .25s cubic-bezier(.2,.9,.3,1); display: flex; flex-direction: column; gap: 14px; }
.overlay.open .sheet { transform: none; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 20px; }
  .sheet { border-radius: 24px; padding: 22px; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 20px; }
.sheet-head .icon-btn { margin-right: -8px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch i { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); transition: box-shadow .15s, transform .1s; }
.swatch input:checked + i { box-shadow: 0 0 0 2px var(--c); transform: scale(1.08); }
.swatch input:focus-visible + i { box-shadow: 0 0 0 2px var(--c), 0 0 0 5px var(--accent-soft); }

.account-box { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface-2); border-radius: 14px; }
.menu { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.menu button { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); text-align: left; font-weight: 600; }
.menu button:last-child { border-bottom: 0; }
.menu button svg { color: var(--muted); }
.menu button:hover { background: var(--surface-2); }
.menu button.danger, .menu button.danger svg { color: var(--danger); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 440px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--text); color: var(--bg); padding: 12px 14px 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(10px); transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.toast-btn { border: 0; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; font-weight: 700; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }

/* ---------- Responsiv ---------- */
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
  .stat { padding: 12px; }
  .stat-n { font-size: 22px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .hello h1 { font-size: 21px; }
  .detail-head { padding: 18px 16px; }
  .detail-head h1 { font-size: 22px; }
  .panel { padding: 16px 14px; }
  .fab span { display: none; }
  .fab { width: 58px; padding: 0; justify-content: center; border-radius: 20px; }
  .fab svg { width: 26px; height: 26px; }
  .brand span { font-size: 17px; }
  .toolbar .select { max-width: 44%; }
}
@media (max-width: 360px) { .row2 { grid-template-columns: 1fr; } .sync-text { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- v2: Kopfzeile mit Navigation ---------- */
.topbar-inner { display: flex; align-items: center; gap: 10px; max-width: 1240px; margin: 0 auto; min-height: 40px; }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px 0 8px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 650; font-size: 14px; flex-shrink: 0; transition: background .15s, border-color .15s; }
.back-btn:hover { border-color: var(--accent); color: var(--accent); }
.back-btn:active { transform: scale(.97); }
.crumb-sep { color: var(--border); font-size: 20px; font-weight: 300; }
.crumb-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.crumb-title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--pc); flex-shrink: 0; }

/* ---------- v2: Steuerleiste ---------- */
.controls { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.controls .chips { padding: 0; margin: 0; flex: 1; min-width: 0; }
.controls-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.group-ctl { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.group-ctl > span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.seg.small { padding: 3px; gap: 2px; border-radius: 10px; }
.seg.small button { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; flex: none; }

/* ---------- v2: Reihen (Lanes) ---------- */
.lanes { display: flex; flex-direction: column; gap: 26px; margin-top: 24px; }
.lane-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.lane-toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px 4px 2px; border-radius: 8px; min-width: 0; }
.lane-toggle:hover { background: var(--surface-2); }
.lane-toggle .chev { color: var(--muted); transition: transform .2s; }
.lane.collapsed .chev { transform: rotate(-90deg); }
.lane-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--gc); flex-shrink: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc) 20%, transparent); }
.lane-head h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }
.lane-progress { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.mini { width: 54px; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: inline-block; }
.mini i { display: block; height: 100%; background: var(--gc); border-radius: inherit; }
.lane-add { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px 0 6px; border-radius: 9px; border: 1px dashed var(--border); background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; }
.lane-add svg { width: 16px; height: 16px; }
.lane-add:hover { border-color: var(--gc); color: var(--text); border-style: solid; }
.lane-nav { display: none; gap: 2px; }
.lane.scrollable .lane-nav { display: flex; }
.flip svg { transform: rotate(180deg); }
.lane-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 320px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 4px 14px; margin: 0 -4px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; overscroll-behavior-x: contain; }
.lane-row::-webkit-scrollbar { height: 6px; }
.lane-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.lane-row > .card { scroll-snap-align: start; }
.lane.collapsed .lane-row { display: none; }
.lane.collapsed .lane-head { margin-bottom: 0; }
@media (hover: none) { .lane-nav { display: none !important; } }

/* ---------- v2: Karte ---------- */
.card:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); border-color: var(--accent); }
.card-top { min-height: 30px; }
.card-top .prio.hi { margin-left: 0; }
.card-edit { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 650; transition: color .15s, border-color .15s, background .15s; }
.card-edit svg { width: 15px; height: 15px; }
.card-edit:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) { .card .card-edit span { display: none; } .card:hover .card-edit span { display: inline; } }
.card-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: -4px; }
.card-cat svg { width: 14px; height: 14px; }

/* ---------- v2: Detail ---------- */
.detail-nav { margin: -4px 0 12px; gap: 8px; }
.danger-btn:hover { color: var(--danger); border-color: var(--danger); }
.cat-pill i { width: 9px; height: 9px; border-radius: 3px; background: var(--gc); }
.detail-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 22px; }
.detail-foot .stamp { margin-top: 6px; }
.cat-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.cat-suggest .tag { border: 0; cursor: pointer; }
.cat-suggest .tag:hover { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .back-btn span { display: none; }
  .back-btn { padding: 0; width: 38px; justify-content: center; }
  .crumb-sep { display: none; }
  .controls { padding: 10px; border-radius: 16px; }
  .controls-row { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; }
  .controls .chips { flex: none; width: 100%; }
  .group-ctl { justify-content: space-between; }
  .group-ctl .seg { flex: 1; }
  .group-ctl .seg button { flex: 1; padding: 0 4px; }
  .lane-row { grid-auto-columns: 84%; gap: 10px; margin: 0 -16px; padding: 4px 16px 12px; scroll-padding: 0 16px; }
  .lanes { gap: 22px; }
  .lane-progress { display: none; }
  .back-inline { display: none; }
  .detail-nav { justify-content: flex-end; }
}

/* ---------- v3: Volle Breite am Monitor ---------- */
.view, .topbar-inner, .detail { max-width: none; }
.view { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.topbar { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
:root { --gutter: 16px; }
@media (min-width: 900px)  { :root { --gutter: 28px; } }
@media (min-width: 1400px) { :root { --gutter: 40px; } }
@media (min-width: 2000px) { :root { --gutter: 56px; } }

/* Karten in den Reihen wachsen mit der Bildschirmbreite */
@media (min-width: 641px) {
  .lane-row { grid-auto-columns: clamp(280px, 21vw, 400px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 21vw, 400px), 1fr)); }
  .fab { right: max(var(--gutter), env(safe-area-inset-right)); }
}
@media (min-width: 1800px) { .lane-row { grid-auto-columns: clamp(300px, 17vw, 420px); } }

/* Detailseite: auf breiten Monitoren dreispaltig (Kopf links, Aufgaben, Notizen) */
@media (min-width: 1500px) {
  .detail { display: grid; grid-template-columns: minmax(340px, 0.9fr) 2.1fr; gap: 0 20px; align-items: start; }
  .detail-nav, .detail-foot { grid-column: 1 / -1; }
  .detail-head { position: sticky; top: 84px; }
  .detail-cols { margin-top: 0; grid-template-columns: 1.15fr 1fr; }
}
@media (min-width: 860px) and (max-width: 1499px) { .detail-cols { grid-template-columns: 1.15fr 1fr; } }

/* ======================================================================
   v5: Ansichts-Schalter, Aufgaben auf Karten, Experten-Ansicht
   ====================================================================== */
.hello-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.mode-switch { display: inline-flex; padding: 4px; gap: 2px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.mode-switch button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 650; font-size: 14px; }
.mode-switch button svg { width: 17px; height: 17px; }
.mode-switch button.on { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .mode-switch button.on { color: #0f1117; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mode-switch button.on { color: #0f1117; } }
.mode-switch button:not(.on):hover { background: var(--surface-2); color: var(--text); }

/* Offene Aufgaben auf Karten (Basic) */
.card-tasks { list-style: none; margin: 2px 0 0; padding: 6px 0 0; border-top: 1px dashed var(--border); display: flex; flex-direction: column; }
.card-tasks li { display: flex; align-items: center; gap: 4px; font-size: 14px; min-height: 32px; }
.card-tasks li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tasks li.more { color: var(--muted); font-size: 12.5px; font-weight: 600; padding-left: 36px; min-height: 22px; }
.check.sm { width: 32px; height: 32px; margin-left: -6px; }
.check.sm i { width: 18px; height: 18px; border-radius: 6px; }
.check.sm i svg { width: 12px; height: 12px; }
.check:hover i { border-color: var(--ok); }

/* Experten-Leiste */
.ex-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 16px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.ex-tabs { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.ex-tabs::-webkit-scrollbar { display: none; }
.ex-tabs button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 650; font-size: 14px; white-space: nowrap; }
.ex-tabs button svg { width: 17px; height: 17px; }
.ex-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.ex-tabs button.on svg { color: var(--accent); }
.ex-filter { display: flex; gap: 8px; flex: 1; min-width: 0; justify-content: flex-end; }
.ex-filter .search { flex: 1; max-width: 340px; }
.ex-filter input, .ex-filter .select { height: 42px; padding-top: 0; padding-bottom: 0; }
.ex-filter .select { width: auto; max-width: 200px; }
.ex-hint { margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
.ex-hint svg { width: 14px; height: 14px; vertical-align: -2px; }
.touch-only { display: none !important; }
@media (hover: none) { .touch-only { display: inline-flex !important; } .hover-only { display: none !important; } }
.red { color: var(--danger) !important; }
.amber { color: #d97706 !important; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-l { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-v { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.kpi-v small { font-size: 16px; color: var(--muted); font-weight: 650; }
.kpi-s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .hbar, .kpi .stackbar { margin-top: auto; }
.kpi-ring { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
.kpi.alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.kpi.alert .kpi-v { color: var(--danger); }
.stackbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.stackbar i { display: block; }
.hbar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hbar > div { height: 100%; border-radius: inherit; transition: width .5s ease; }

/* Dashboard-Raster */
.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-top: 14px; }
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.dcard > header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.dcard > header h3 { font-size: 15px; margin-right: auto; }
.w4 { grid-column: span 4; } .w6 { grid-column: span 6; } .w8 { grid-column: span 8; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 160px; height: 160px; flex-shrink: 0; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.legend li span { flex: 1; color: var(--muted); }
.legend i, .legend.inline i, .mixline i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.legend.inline { flex-direction: row; gap: 14px; flex: none; font-size: 12.5px; color: var(--muted); }
.legend.inline span { display: inline-flex; align-items: center; gap: 6px; }
.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.barlist-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 650; margin-bottom: 5px; }
.barlist-top span { display: inline-flex; align-items: center; gap: 8px; }
.barlist-top i { width: 10px; height: 10px; border-radius: 3px; }
.barlist-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.vbars { display: flex; gap: 18px; height: 150px; align-items: stretch; padding: 0 6px; }
.vbar { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.vbar-col { flex: 1; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 10px; padding-top: 26px; }
.vbar-col > div { width: 100%; min-height: 4px; border-radius: 10px 10px 0 0; position: relative; transition: height .5s ease; }
.vbar-col span { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-weight: 800; font-size: 14px; color: var(--text); }
.vbar-l { text-align: center; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.mixline { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.mixline span { display: inline-flex; align-items: center; gap: 6px; }
.mixline b { color: var(--text); }
.chart { width: 100%; height: auto; display: block; }
.duelist, .otasks, .ranklist { list-style: none; margin: 0; padding: 0; }
.duelist li { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.duelist li:hover, .ranklist li:hover { background: var(--surface-2); }
.due-date { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; flex-shrink: 0; }
.due-date b { font-size: 17px; }
.due-date span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.due-date.red { background: color-mix(in srgb, var(--danger) 13%, transparent); }
.due-date.red span, .due-date.amber span { color: inherit; }
.due-date.amber { background: color-mix(in srgb, #f59e0b 15%, transparent); }
.due-main { flex: 1; min-width: 0; }
.due-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-rel { font-size: 12.5px; color: var(--muted); }
.otasks li { display: flex; align-items: center; gap: 6px; padding: 2px 0; border-bottom: 1px solid var(--border); min-height: 42px; }
.otasks li:last-child { border-bottom: 0; }
.ot-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ot-proj { border: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; padding: 3px 9px 3px 8px; border-radius: 7px;
  background: color-mix(in srgb, var(--pc) 13%, transparent); color: var(--text); border-left: 3px solid var(--pc); }
.ot-proj:hover { background: color-mix(in srgb, var(--pc) 22%, transparent); }
.ot-due { font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; min-width: 50px; text-align: right; }
.ranklist { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; }
.ranklist li { display: grid; grid-template-columns: minmax(0, 1.2fr) 1.5fr auto; align-items: center; gap: 12px; padding: 7px 6px; border-radius: 10px; cursor: pointer; }
.rk-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-name i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.rk-val { font-size: 12.5px; color: var(--muted); white-space: nowrap; min-width: 74px; text-align: right; }
.rk-val b { color: var(--text); }

/* Board (Kanban) */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; scrollbar-width: thin; }
.bcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 180px; transition: background .15s, box-shadow .15s; }
.bcol.drop { background: color-mix(in srgb, var(--bc) 12%, var(--surface-2)); box-shadow: inset 0 0 0 2px var(--bc); }
.bcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 0 6px; }
.bcol-head > i { width: 10px; height: 10px; border-radius: 50%; background: var(--bc); }
.bcol-head h3 { font-size: 14.5px; }
.bcol-head .lane-count { background: var(--surface); }
.bcol-prog { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.bcol-prog .hbar { flex: 1; height: 5px; background: var(--surface); }
.bcol-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.bcol-empty { border: 2px dashed var(--border); border-radius: 12px; padding: 18px 10px; text-align: center; font-size: 13px; color: var(--muted); }
.bcol-add { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); font-weight: 650; font-size: 13.5px; padding: 8px; border-radius: 10px; text-align: left; }
.bcol-add svg { width: 16px; height: 16px; }
.bcol-add:hover { background: var(--surface); color: var(--text); }
.bcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(16,24,40,.06); cursor: grab; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; gap: 8px; outline: none; transition: box-shadow .15s, border-color .15s; }
.bcard:hover { border-color: color-mix(in srgb, var(--pc) 50%, var(--border)); box-shadow: var(--shadow); }
.bcard:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.bcard h4 { margin: 0; font-size: 14.5px; line-height: 1.3; font-weight: 650; word-break: break-word; }
.bcard-labels { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.bl-color { width: 34px; height: 7px; border-radius: 99px; background: var(--pc); }
.blabel { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--gc) 15%, transparent); color: color-mix(in srgb, var(--gc) 75%, var(--text)); white-space: nowrap; }
.blabel.hi { --gc: #ef4444; }
.progress.thin { height: 4px; }
.bcard-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bbadge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.bbadge svg { width: 13px; height: 13px; }
.bbadge.red { background: var(--danger); color: #fff !important; }
.bbadge.amber { background: #f59e0b; color: #fff !important; }
.bbadge.green { background: var(--ok); color: #fff; }
.bc-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); }
.bc-btn svg { width: 15px; height: 15px; }
.bc-btn:hover { background: var(--surface-2); color: var(--accent); }
.bcard.dragging { opacity: .35; }
.bghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg); cursor: grabbing; border-color: var(--accent); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
.mv-dot { width: 12px; height: 12px; border-radius: 50%; }
.menu button:disabled { opacity: .6; cursor: default; }

/* Tabelle */
.tbl-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 980px; }
.tbl th { position: sticky; top: 0; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 12px 12px; background: var(--surface); border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none; }
.tbl th:hover, .tbl th.sorted { color: var(--text); }
.sort-ar { font-size: 9px; margin-left: 5px; color: var(--accent); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot td { border-top: 2px solid var(--border); border-bottom: 0; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.tname { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.tname i { width: 4px; height: 22px; border-radius: 2px; background: var(--pc); flex-shrink: 0; }
.col-name { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tbl thead .col-name { z-index: 2; }
.tprog { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.tprog .hbar { flex: 1; }
.tprog b { font-size: 12.5px; min-width: 36px; text-align: right; }
.tsub { font-size: 11.5px; color: var(--muted); }
.prio-txt { font-weight: 650; font-size: 13px; }
.prio-txt.p-hoch { color: #ef4444; } .prio-txt.p-mittel { color: #d97706; } .prio-txt.p-niedrig { color: var(--ok); }
.col-act { width: 44px; text-align: right; }

/* Zeitplan (Gantt) */
.tl-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.tl-legend span { display: inline-flex; align-items: center; gap: 7px; }
.tl-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 4px; }
.lg-today { width: 2px !important; height: 14px !important; background: var(--danger); border-radius: 0 !important; }
.lg-bar { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.lg-fill { background: var(--accent); }
.lg-over { background: transparent; outline: 2px solid var(--danger); }
.tl { --lw: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: thin; }
.tl-inner { position: relative; }
.tl-head { display: flex; border-bottom: 1px solid var(--border); position: relative; }
.tl-corner { width: var(--lw); flex-shrink: 0; position: sticky; left: 0; z-index: 4; background: var(--surface); padding: 0 16px; display: flex; align-items: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-right: 1px solid var(--border); }
.tl-scale { position: relative; height: 54px; flex-shrink: 0; }
.tl-month { position: absolute; top: 0; height: 30px; border-left: 1px solid var(--border); display: flex; align-items: center; overflow: hidden; }
.tl-month span { position: sticky; left: calc(var(--lw) + 8px); padding: 0 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.tl-week { position: absolute; top: 30px; height: 24px; padding-left: 5px; font-size: 11px; color: var(--muted); border-left: 1px solid color-mix(in srgb, var(--border) 60%, transparent); display: flex; align-items: center; white-space: nowrap; }
.tl-body { position: relative; padding: 6px 0; }
.tl-grid { position: absolute; top: 0; bottom: 0; left: var(--lw); pointer-events: none; }
.tl-mline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.tl-wline { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--border) 50%, transparent); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--danger); z-index: 2; }
.tl-today span { position: absolute; top: -2px; left: 50%; transform: translate(-50%, -100%); background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 5px; white-space: nowrap; display: none; }
.tl-row { display: flex; align-items: center; height: 48px; position: relative; }
.tl-row:hover .tl-label, .tl-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.tl-label { width: var(--lw); flex-shrink: 0; position: sticky; left: 0; z-index: 3; background: var(--surface); height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 14px; cursor: pointer; border-right: 1px solid var(--border); }
.tl-label > i { width: 4px; height: 26px; border-radius: 2px; background: var(--pc); flex-shrink: 0; }
.tl-label div { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tl-label b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 100%; flex-shrink: 0; }
.tl-bar { position: absolute; top: 10px; height: 28px; border-radius: 8px; background: color-mix(in srgb, var(--pc) 24%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pc) 55%, transparent); overflow: hidden; cursor: pointer; display: flex; align-items: center; transition: transform .1s, box-shadow .15s; z-index: 1; }
.tl-bar:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tl-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pc); opacity: .85; }
.tl-bar > span { position: relative; padding: 0 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); text-shadow: 0 0 6px var(--surface), 0 0 2px var(--surface); }
.tl-bar.over { outline: 2px solid var(--danger); outline-offset: 1px; }
.tl-bar.done { opacity: .55; }
.tl-out { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; pointer-events: none; }

/* Responsiv Experten-Ansicht */
@media (max-width: 1500px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1200px) {
  .w4 { grid-column: span 6; } .w8 { grid-column: span 12; } .w6 { grid-column: span 12; }
  .dash > .w4:nth-of-type(3) { grid-column: span 12; }
}
@media (max-width: 900px) {
  .ex-bar { flex-direction: column; align-items: stretch; }
  .ex-filter { justify-content: stretch; flex-wrap: wrap; }
  .ex-filter .search { max-width: none; flex: 1 1 100%; }
  .ex-filter .select { flex: 1; max-width: none; }
  .ex-tabs button { flex: 1; justify-content: center; }
}
@media (max-width: 640px) {
  .hello { flex-direction: column; align-items: stretch; gap: 12px; }
  .hello-actions { justify-content: stretch; }
  .mode-switch { flex: 1; }
  .mode-switch button { flex: 1; justify-content: center; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-v { font-size: 24px; }
  .kpi-ring .ring { width: 54px; height: 54px; }
  .dash { gap: 10px; }
  .w4, .w6, .w8, .dash > .w4:nth-of-type(3) { grid-column: span 12; }
  .dcard { padding: 14px; }
  .donut { width: 130px; height: 130px; }
  .ex-tabs button { padding: 0 8px; gap: 5px; font-size: 13px; }
  .ex-tabs button svg { display: none; }
  .board { grid-auto-columns: 86%; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 0 16px; }
  .bcol { scroll-snap-align: start; }
  .bcard { cursor: pointer; }
  .tl { --lw: 128px; }
  .tl-label { padding: 0 8px; gap: 6px; }
  .ot-proj { max-width: 34%; }
  .ranklist li { grid-template-columns: minmax(0, 1fr) 80px auto; gap: 8px; }
}

/* v5.1: Aktivitätsdiagramm (HTML), Board-Feinschliff, FAB nur beim Scrollen am PC */
.actchart { display: flex; gap: 8px; height: 240px; }
.ac-y { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 26px; font-size: 11px; color: var(--muted); text-align: right; min-width: 18px; }
.ac-y span { transform: translateY(-50%); }
.ac-y span:last-child { transform: translateY(50%); }
.ac-plot { flex: 1; display: flex; position: relative; gap: 4px; }
.ac-grid { position: absolute; inset: 0 0 26px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.ac-grid i { display: block; border-top: 1px dashed var(--border); }
.ac-grid i:last-child { border-top-style: solid; }
.ac-week { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.ac-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding: 0 12%; }
.ac-b { flex: 1; max-width: 34px; border-radius: 6px 6px 2px 2px; position: relative; min-height: 0; transition: height .5s ease; }
.ac-b.created { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ac-b.done { background: var(--ok); }
.ac-b span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--muted); }
.ac-l { height: 26px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ac-week.now .ac-l { color: var(--text); font-weight: 750; }
.ac-week.now::before { content: ""; position: absolute; inset: -4px -2px 0; background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 10px; }
@media (max-width: 640px) { .actchart { height: 200px; } .ac-l { font-size: 10px; } .ac-bars { padding: 0 6%; gap: 2px; } .ac-b span { display: none; } }
.bcard-meta { flex-wrap: nowrap; gap: 2px; }
.bbadge { padding: 2px 5px; }
@media (min-width: 641px) {
  .fab { transition: opacity .2s, transform .2s; }
  body:not(.scrolled) .fab { opacity: 0; pointer-events: none; transform: translateY(16px); }
}

/* v5.2 Feinschliff */
.tl-month { overflow: clip; }
@media (max-width: 640px) {
  .kpi-ring { flex-direction: column; align-items: flex-start; }
  .kpi-ring .kpi-s { white-space: normal; }
  .tl-month span { font-size: 12px; }
}

/* ======================================================================
   v7: Termine & Dauer für Aufgaben
   ====================================================================== */
.tchip { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; height: 26px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; cursor: pointer; transition: border-color .15s, background .15s; }
.tchip svg { width: 13px; height: 13px; }
.tchip small { font-size: 11px; font-weight: 600; opacity: .75; padding-left: 4px; border-left: 1px solid currentColor; margin-left: 2px; }
.tchip:hover { border-color: var(--accent); color: var(--accent); }
.tchip.run { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.tchip.soon { color: #d97706; border-color: color-mix(in srgb, #f59e0b 45%, transparent); }
.tchip.red { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.tchip.done { opacity: .6; text-decoration: line-through; }
.tdate-add { opacity: .45; }
.task:hover .tdate-add, .tdate-add:focus-visible { opacity: 1; color: var(--accent); }
@media (hover: none) { .tdate-add { opacity: .7; } }
.card-tasks .tchip { height: 22px; padding: 0 6px; font-size: 11.5px; }
.card-tasks .tchip svg { width: 12px; height: 12px; }
.otasks .tchip { height: 24px; }

/* Termin-Dialog */
.td-task { display: flex; align-items: center; gap: 8px; margin: -6px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; font-weight: 600; }
.td-task svg { color: var(--accent); width: 18px; height: 18px; }
.dur-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.dur-chips .chip { height: 30px; font-size: 13px; }
.td-end { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--border); min-height: 46px; }
.td-end span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.td-end b { font-size: 15px; }
.td-end em { font-style: normal; font-size: 12.5px; font-weight: 650; color: #d97706; }
.form-actions .spacer { flex: 1; }

/* Termine-Liste mit Aufgaben */
.duelist li.due-task .due-date { border-radius: 50%; width: 42px; height: 42px; margin: 2px; }
.due-rel .pdot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--pc); margin-right: 5px; }

/* Zeitplan: Aufgabenzeilen */
.tl-tog { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: -6px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); flex-shrink: 0; }
.tl-tog svg { transition: transform .2s; }
.tl-tog.open svg { transform: rotate(90deg); }
.tl-tog:hover { background: var(--surface-2); color: var(--text); }
.tl-tog-sp { width: 18px; flex-shrink: 0; }
.tl-row.sub { height: 38px; }
.tl-label.sub { padding-left: 34px; gap: 4px; background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.tl-label.sub .check.sm { margin-left: -8px; }
.tl-sublabel { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; cursor: pointer; }
.tl-sublabel b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sublabel span { font-size: 11px; color: var(--muted); }
.strike { text-decoration: line-through; color: var(--muted); }
.tl-bar.task { top: 9px; height: 20px; border-radius: 6px; background: color-mix(in srgb, var(--pc) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pc) 70%, transparent); border-left-width: 4px; }
.tl-bar.task > span { font-size: 11.5px; font-weight: 650; padding: 0 7px; }
.tl-bar.task.done { background: color-mix(in srgb, var(--ok) 30%, var(--surface)); border-color: var(--ok); opacity: .75; }
.tl-bar.task.run { box-shadow: 0 0 0 2px color-mix(in srgb, var(--pc) 30%, transparent); }
.tl-bar.task.red { outline: 2px solid var(--danger); outline-offset: 1px; }
.tl-bar.derived { border-style: dashed; }
.tl-out.sub { font-size: 11.5px; }
.lg-task { background: color-mix(in srgb, var(--accent) 14%, transparent); border-left: 4px solid var(--accent); border-radius: 3px !important; }
.tl-all { margin-left: auto; padding: 0; }

@media (max-width: 640px) {
  .task .tchip small { display: none; }
  .task .tchip { padding: 0 6px; }
  .tl-label.sub { padding-left: 14px; }
  .tl-sublabel span { display: none; }
  .tl-row.sub { height: 34px; }
}

@media (max-width: 640px) { .tl { --lw: 150px; } .tl-corner { padding: 0 10px; font-size: 11px; } }

/* ======================================================================
   v8: Erledigte Aufgaben
   ====================================================================== */
.done-btn { gap: 7px; height: 42px; }
.done-btn svg { color: var(--ok); width: 18px; height: 18px; }
.done-btn b { font-size: 12px; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); border-radius: 99px; padding: 1px 8px; }
.card-tasks .done-link { min-height: 28px; }
.card-tasks .done-link button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; color: var(--ok); font-size: 12.5px; font-weight: 650; }
.card-tasks .done-link button svg { width: 14px; height: 14px; }
.card-tasks .done-link button:hover { text-decoration: underline; text-underline-offset: 3px; }
.kpi.clickable { cursor: pointer; transition: border-color .15s, transform .08s; }
.kpi.clickable:hover { border-color: var(--ok); }
.kpi.clickable:active { transform: scale(.98); }

.done-controls { margin: 16px 0 14px; }
.done-top { display: grid; grid-template-columns: repeat(3, 1fr) 1.6fr; gap: 12px; }
.spark-card { gap: 6px; }
.spark { flex: 1; display: flex; align-items: flex-end; gap: 4px; min-height: 52px; }
.sp-col { flex: 1; height: 100%; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 4px; }
.sp-col i { display: block; width: 100%; background: var(--ok); border-radius: 4px; opacity: .8; }
.sp-col.now i { opacity: 1; }
.sp-col.now { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 50%, transparent); }
.sp-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.done-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 10px; }
.done-list { display: flex; flex-direction: column; gap: 14px; }
.dgroup { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 12px 16px 6px; box-shadow: var(--shadow); }
.dgroup > header { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.dgroup > header h3 { font-size: 15px; }
.dg-proj { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font-weight: 700; font-size: 15px; }
.dg-proj i { width: 10px; height: 10px; border-radius: 3px; background: var(--pc); }
.dg-proj:hover { color: var(--accent); }
.dlist { list-style: none; margin: 0; padding: 0; }
.dlist li { display: flex; align-items: center; gap: 8px; min-height: 44px; border-bottom: 1px solid var(--border); }
.dlist li:last-child { border-bottom: 0; }
.dlist .check.sm input:checked + i { background: var(--ok); border-color: var(--ok); }
.dlist .check.sm:hover input:checked + i { background: var(--surface); border-color: var(--danger); }
.dlist .check.sm:hover input:checked + i svg { color: var(--danger); }
.dl-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.dl-time { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 92px; text-align: right; }
.dlist .tchip { height: 22px; }

@media (max-width: 1100px) { .done-top { grid-template-columns: repeat(3, 1fr); } .spark-card { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .hello-actions { flex-wrap: wrap; }
  .done-btn { flex: 1 1 100%; justify-content: center; }
  .done-top { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .done-top .kpi { padding: 10px; }
  .done-top .kpi-v { font-size: 22px; }
  .done-top .kpi-l { font-size: 10.5px; }
  .done-top .kpi-s { font-size: 11px; white-space: normal; }
  .dgroup { padding: 10px 12px 4px; }
  .dl-time { min-width: 0; font-size: 11px; }
  .dlist .ot-proj { max-width: 30%; }
  .dlist .tchip { display: none; }
}
@media (max-width: 640px) {
  .dl-title { white-space: normal; overflow: visible; line-height: 1.3; padding: 6px 0; font-size: 14px; }
  .dlist li { align-items: center; }
}

/* ======================================================================
   v9: Basic-Navigation & Anstehende Aufgaben
   ====================================================================== */
.bnav { display: flex; gap: 4px; padding: 4px; margin: 16px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); width: fit-content; max-width: 100%; }
.bnav a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; color: var(--muted); font-weight: 650; font-size: 14.5px; white-space: nowrap; transition: background .15s, color .15s; }
.bnav a svg { width: 18px; height: 18px; }
.bnav a b { font-size: 12px; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.bnav a b.red-badge { background: var(--danger); color: #fff; margin-left: -4px; }
.bnav a:hover { background: var(--surface-2); color: var(--text); }
.bnav a.on { background: var(--text); color: var(--bg); }
.bnav a.on b:not(.red-badge) { background: color-mix(in srgb, var(--bg) 22%, transparent); color: var(--bg); }
.bnav + .stats { margin-top: 14px; }

.up-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.up-k { text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .08s; }
.up-k:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.up-k:active { transform: scale(.98); }
.up-k.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.up-k.alert.sel { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }

.up-strip-card { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.up-strip-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.up-strip-card h3 { font-size: 15px; }
.up-strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; }
.us-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px 8px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); min-width: 0; transition: background .15s, border-color .15s; }
.us-day:hover { background: var(--surface-2); }
.us-day.we { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.us-day.today { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.us-day.sel { background: var(--accent-soft); border-color: var(--accent); }
.us-wd { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.us-day.today .us-wd { color: var(--accent); }
.us-bar { width: 70%; max-width: 26px; height: 54px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 6px; }
.us-bar i { display: block; width: 100%; background: var(--accent); border-radius: 6px; opacity: .85; }
.us-day b { font-size: 13px; }
.us-n { font-size: 11px; color: var(--muted); font-weight: 650; min-height: 14px; line-height: 14px; }

.up-controls { margin-top: 14px; }
.up-chips { padding: 12px 0 0 !important; }
.up-list { margin-top: 16px; }
.up-g.up-a { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.up-g.up-a > header h3 { color: var(--danger); }
.up-g.up-b > header h3 { color: var(--accent); }
.up-g > header { flex-wrap: wrap; }
.up-items li { gap: 10px; min-height: 58px; padding: 6px 0; }
.up-date { width: 42px; height: 42px; flex-shrink: 0; border-radius: 11px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.up-date b { font-size: 16px; }
.up-date span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.up-date.red { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.up-date.red span { color: inherit; }
.up-date.today { background: var(--accent-soft); color: var(--accent); }
.up-date.today span { color: inherit; }
.up-date.none { color: var(--muted); font-weight: 700; }
.up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.up-title { font-weight: 600; font-size: 14.5px; line-height: 1.3; word-break: break-word; }
.up-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.up-proj { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; color: var(--muted); font-weight: 600; font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-proj i { width: 8px; height: 8px; border-radius: 2px; background: var(--pc); flex-shrink: 0; }
.up-proj:hover { color: var(--accent); }
.up-rel { color: var(--muted); }
.up-rel.red { color: var(--danger); font-weight: 650; }
.up-rel.today { color: var(--accent); font-weight: 650; }
.up-set { height: 30px; padding: 0 10px; font-size: 12.5px; color: var(--muted); }
.up-set svg { width: 15px; height: 15px; }
.up-items .tchip { height: 28px; }

@media (max-width: 640px) {
  .bnav { width: 100%; }
  .bnav a { flex: 1; justify-content: center; padding: 0 6px; gap: 5px; font-size: 13.5px; }
  .bnav a svg { display: none; }
  .bnav a b { min-width: 0; padding: 1px 6px; font-size: 11px; }
  .up-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .up-kpis .kpi { padding: 10px 12px; }
  .up-kpis .kpi-v { font-size: 22px; }
  .up-strip-card { padding: 12px 10px; }
  .up-strip { grid-template-columns: repeat(14, 44px); overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px; }
  .up-strip::-webkit-scrollbar { display: none; }
  .up-items li { gap: 8px; }
  .up-set span { display: none; }
  .up-set { width: 34px; padding: 0; }
  .up-items .tchip span { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 640px) {
  .up-items .tchip { display: inline-flex; width: 34px; height: 34px; padding: 0; justify-content: center; }
  .up-items .tchip span { display: none; }
}

/* v10: Anstehend in der Experten-Ansicht */
.up-controls.compact { padding: 10px 12px; }
.up-controls.compact .up-chips { padding: 0 !important; }
.ex-body > .up-kpis { margin-top: 0; }
.dc-more { padding: 0; margin-left: auto; font-size: 12.5px; }
.dcard > header h3 + .lane-count { margin-right: 0; }
.dcard > header:has(.dc-more) h3 { margin-right: 0; }
@media (max-width: 640px) {
  /* 6 Reiter: als 3×2-Raster statt seitlich scrollen */
  .ex-tabs { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .ex-tabs button { justify-content: center; padding: 0 4px; }
}

/* ======================================================================
   v11: Schnellerfassung, Aufgaben ohne Projekt, Notizen
   ====================================================================== */
.qa { display: flex; gap: 8px; align-items: center; margin-top: 14px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.qa:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.qa-in { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 8px; color: var(--accent); }
.qa-in input { border: 0 !important; box-shadow: none !important; padding: 8px 4px !important; background: transparent !important; color: var(--text); }
.qa-opts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.qa-sel, .qa-date { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 4px 0 10px; border-radius: 11px; background: var(--surface-2); color: var(--muted); }
.qa-sel svg, .qa-date svg { width: 16px; height: 16px; flex-shrink: 0; }
.qa-sel select { border: 0; background: transparent; color: var(--text); font-weight: 600; font-size: 14px; padding: 0 6px 0 0; max-width: 190px; outline: none; cursor: pointer; }
.qa-date input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 4px !important; min-height: 0 !important; height: 38px; width: 138px; font-size: 14px; color: var(--text); }
.qa-btn { height: 40px; }

.inbox-panel { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid #64748b; border-radius: 16px; padding: 10px 16px 6px; box-shadow: var(--shadow); }
.inbox-panel > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.inbox-panel h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.inbox-panel h3 svg { width: 18px; height: 18px; color: var(--muted); }
.inbox-panel header .muted svg { width: 13px; height: 13px; vertical-align: -2px; }
.inbox-panel .link-btn { padding: 4px 0; }
.ib-list li { min-height: 46px; }
.ib-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.ib-move { height: 30px; padding: 0 10px; font-size: 12.5px; color: var(--muted); }
.ib-move svg { width: 14px; height: 14px; }
.ib-move:hover { color: var(--accent); }
.t-move { opacity: .45; }
.task:hover .t-move, .t-move:focus-visible { opacity: 1; color: var(--accent); }
@media (hover: none) { .t-move { opacity: .7; } }
.inbox-detail .hello { margin-bottom: 14px; }
.inbox-detail .panel h2 .lane-count { margin-left: 4px; }
.mv-search { margin-top: -4px; }
.mv-list { max-height: 50vh; overflow-y: auto; }
.mv-list button { gap: 10px; }
.mv-list .mv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-list button[hidden] { display: none; }
.h2-link { margin-left: auto; font-size: 12.5px; font-weight: 600; padding: 0; text-decoration: none; color: var(--accent); }
.h2-link:hover { text-decoration: underline; }

/* Notizen */
.notes-controls { margin-top: 14px; }
.notes-controls.compact { margin-top: 0; padding: 10px 12px; }
.notes-controls .toolbar { align-items: center; }
.notes-controls .select { width: auto; max-width: 240px; }
.notes-controls.compact .toolbar .select { flex: 1; max-width: 320px; }
.notes-controls.compact .toolbar { justify-content: space-between; }
.notes-wrap { margin-top: 16px; }
.notes-sec { display: flex; align-items: center; gap: 6px; margin: 4px 2px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.notes-sec svg { width: 14px; height: 14px; }
.notes-grid { columns: 4 260px; column-gap: 14px; margin-bottom: 18px; }
.note-card { break-inside: avoid; margin: 0 0 14px; position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; outline: none; transition: transform .1s, box-shadow .15s, border-color .15s; }
.note-card.tinted { background: color-mix(in srgb, var(--nc) 16%, var(--surface)); border-color: color-mix(in srgb, var(--nc) 45%, var(--border)); }
.note-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.note-card:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.note-card h3 { font-size: 15.5px; padding-right: 28px; word-break: break-word; }
.nc-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 15.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.note-card:not(:has(h3)) .nc-text { padding-right: 24px; }
.nc-text a { color: var(--accent); text-decoration: underline; word-break: break-all; }
.note-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.note-card footer time { white-space: nowrap; }
.nc-pin { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); opacity: 0; transition: opacity .15s; }
.nc-pin svg { width: 16px; height: 16px; }
.nc-pin.on { opacity: 1; color: var(--accent); }
.nc-pin.on svg { fill: currentColor; }
.note-card:hover .nc-pin, .note-card:focus-within .nc-pin { opacity: 1; }
.nc-pin:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
@media (hover: none) { .nc-pin { opacity: .6; } }

.sheet.tinted-sheet { background: color-mix(in srgb, var(--nc) 13%, var(--surface)); }
.ne-head-actions { display: flex; align-items: center; gap: 2px; margin-right: -8px; }
.ne-pin.on { color: var(--accent); }
.ne-pin.on svg { fill: currentColor; }
.ne-title { font-size: 18px !important; font-weight: 700; border-color: transparent !important; background: transparent !important; padding-left: 2px !important; box-shadow: none !important; }
.ne-title:focus { border-color: var(--border) !important; }
.ne-text { min-height: 180px; font-size: 15px !important; line-height: 1.55; resize: vertical; background: color-mix(in srgb, var(--surface) 70%, transparent) !important; }
.ne-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.ne-row .field:first-child { flex: 1 1 260px; }
.ne-proj { flex: 1 1 200px; }
.ne-colors { gap: 8px; }
.ne-colors .swatch i { width: 28px; height: 28px; }
.ne-colors .swatch.none i { background: var(--surface); box-shadow: 0 0 0 1px var(--border); position: relative; overflow: hidden; }
.ne-colors .swatch.none i::after { content: ""; position: absolute; left: 50%; top: -20%; height: 140%; width: 2px; background: var(--danger); transform: rotate(45deg); }
.ne-colors .swatch.none input:checked + i { box-shadow: 0 0 0 2px var(--text); }

/* Navigation: 4 Reiter / Experten: 7 Reiter */
@media (max-width: 640px) {
  .bnav a { font-size: 12.5px; gap: 4px; padding: 0 4px; }
  .bnav a b:not(.red-badge) { display: none; }
  .bnav a.on b:not(.red-badge) { display: inline; }
  .ex-tabs { grid-template-columns: repeat(4, 1fr); }
  .ex-tabs button { font-size: 12px; height: 34px; }
  .qa { flex-direction: column; align-items: stretch; padding: 6px; gap: 6px; }
  .qa-opts { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
  .qa-sel select { max-width: none; width: 100%; }
  .qa-sel { min-width: 0; }
  .qa-date input { width: 118px; font-size: 13px; }
  .qa-btn span { display: none; }
  .qa-btn { width: 44px; padding: 0; }
  .inbox-panel { padding: 8px 12px 4px; }
  .ib-move span { display: none; }
  .ib-move { width: 34px; padding: 0; }
  .notes-grid { columns: 2 150px; column-gap: 10px; }
  .note-card { margin-bottom: 10px; padding: 12px; }
  .nc-text { font-size: 13.5px; max-height: 12em; }
  .notes-controls .toolbar { flex-wrap: wrap; }
  .notes-controls .search { flex: 1 1 100%; }
  .notes-controls .select { flex: 1; max-width: none; }
  .notes-controls .btn span { display: none; }
  .notes-controls .btn { width: 44px; padding: 0; }
}
@media (max-width: 360px) { .notes-grid { columns: 1; } }
@media (max-width: 640px) {
  .qa-opts { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 44px; }
  .qa-date { min-width: 0; padding-left: 8px; }
  .qa-date input { width: 100%; min-width: 0; }
}

/* ======================================================================
   v12: Konsolidierte Navigation (Kopfzeile / untere Leiste) & kompakte Übersicht
   ====================================================================== */
.topbar { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
.topbar-inner { gap: 10px; }
.crumb { flex-shrink: 1; }
.crumb-title { max-width: 260px; }
.topnav { display: flex; gap: 2px; margin-left: 10px; min-width: 0; }
.tn-item { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 650; font-size: 14px; white-space: nowrap; transition: background .15s, color .15s; }
.tn-item svg { width: 17px; height: 17px; }
.tn-item b { font-size: 11.5px; padding: 0 6px; line-height: 18px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.tn-item b.red-badge { background: var(--danger); color: #fff; }
.tn-item:hover { background: var(--surface-2); color: var(--text); }
.tn-item.on { background: var(--accent-soft); color: var(--accent); }
.tn-item.on b:not(.red-badge) { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.topbar .mode-switch { box-shadow: none; padding: 3px; border-radius: 11px; }
.topbar .mode-switch button { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 5px; }
.topbar .mode-switch button svg { width: 16px; height: 16px; }
.top-new { height: 36px; padding: 0 14px 0 10px; }
.tabbar { display: none; }
.more-menu button.cur { color: var(--accent); }
.more-menu button.cur svg { color: var(--accent); }
.more-menu button span:first-of-type { flex: 1; }

@media (min-width: 1400px) { .topnav .more { display: none; } }
@media (max-width: 1399px) {
  .topnav .ov { display: none; }
  .topbar .mode-switch span { display: none; }
  .topbar .mode-switch button { padding: 0 8px; }
  .topbar .sync-text { display: none; }
  .topbar .sync-pill { padding: 0 11px; }
}
@media (max-width: 1199px) {
  .topbar .brand span { display: none; }
  .tn-item b:not(.red-badge) { display: none; }
  .tn-item { padding: 0 10px; }
}

/* Handy & Tablet: untere Leiste */
@media (max-width: 1023px) {
  .topnav, .top-new { display: none; }
  .topbar .brand span { display: inline; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 4px max(6px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(16, 24, 40, .06); }
  .tb-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px; min-width: 0; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 650; }
  .tb-ic { display: grid; place-items: center; width: 54px; height: 30px; border-radius: 99px; transition: background .15s; }
  .tb-ic svg { width: 22px; height: 22px; }
  .tb-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .tb-item.on { color: var(--accent); }
  .tb-item.on .tb-ic { background: var(--accent-soft); }
  .tb-badge { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 14px; text-align: center; border: 2px solid var(--surface); }
  .tb-plus { justify-self: center; width: 54px; height: 54px; border-radius: 18px; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; transform: translateY(-12px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .1s; }
  .tb-plus:active { transform: translateY(-12px) scale(.94); }
  .tb-plus svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .view { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .topbar .mode-switch span { display: none; }
  .topbar .sync-text { display: none; }
  .topbar .sync-pill { padding: 0 11px; }
}
:root[data-theme="dark"] .tb-plus { color: #0f1117; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-plus { color: #0f1117; } }
@media (max-width: 1023px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar { box-shadow: 0 -4px 20px rgba(0, 0, 0, .3); } }
@media (max-width: 380px) { .topbar .brand span { display: none; } }

/* „+ Neu“-Menü */
.new-task-box { display: flex; flex-direction: column; gap: 6px; }
.nt-l, .new-grid-l { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.new-task-box .qa { margin-top: 0; box-shadow: none; flex-direction: column; align-items: stretch; }
.new-task-box .qa-opts { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; }
.new-task-box .qa-sel select { max-width: none; width: 100%; }
.new-task-box .qa-date input { width: 100%; }
.new-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.new-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-align: left; transition: border-color .15s, background .15s; }
.new-grid button svg { color: var(--accent); width: 22px; height: 22px; margin-bottom: 2px; }
.new-grid b { font-size: 15px; }
.new-grid span { font-size: 12.5px; color: var(--muted); }
.new-grid button:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Schnellerfassung: einzeilig, Optionen erst beim Tippen */
.qa { margin-top: 12px; padding: 6px 6px 6px 8px; }
.qa:not(.open) .qa-opts { display: none; }
.qa-in input { height: 36px; }
.qa:not(.open) { box-shadow: none; }

/* Eingang einklappbar */
.inbox-panel { margin-top: 10px; padding: 8px 14px; }
.inbox-panel > header { flex-wrap: nowrap; }
.inbox-panel.collapsed > header { border-bottom: 0; padding-bottom: 0; }
.ib-toggle { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; border: 0; background: none; padding: 2px 4px 2px 0; font-weight: 700; font-size: 14.5px; color: var(--text); }
.ib-toggle .chev { color: var(--muted); transition: transform .2s; }
.inbox-panel.collapsed .ib-toggle .chev { transform: rotate(-90deg); }
.ib-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.inbox-panel header .spacer { flex: 0 0 0; }
.inbox-panel:not(.collapsed) header .spacer { flex: 1; }
.inbox-panel .link-btn { flex-shrink: 0; }

/* Suche + Status-Chips + Filter in einer Zeile */
.ov-controls { margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.ov-controls .search { flex: 0 1 320px; min-width: 180px; }
.ov-controls .search input { height: 40px; padding-top: 0; padding-bottom: 0; }
.ov-controls .chips { flex: 1; padding: 0; margin: 0; min-width: 0; }
.chip.warn span { background: var(--danger); color: #fff; }
.chip.warn:not(.on) { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.filter-btn { position: relative; height: 40px; flex-shrink: 0; gap: 6px; }
.filter-btn svg { width: 18px; height: 18px; }
.fb-n { font-style: normal; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; line-height: 18px; border-radius: 99px; background: var(--accent); color: #fff; text-align: center; padding: 0 5px; }
.fs-seg { flex-wrap: wrap; }
.fs-seg button { flex: 1 1 auto; padding: 0 10px; }
.fs-chips { flex-wrap: wrap; overflow: visible; padding: 0; margin: 0; }
.lanes { margin-top: 18px; }
.grid { margin-top: 14px; }
.ex-bar { margin: 10px 0 14px; padding: 6px; border-radius: 14px; }
.ex-bar .ex-filter { justify-content: flex-start; }
.ex-bar .ex-filter .search { max-width: none; flex: 1; }
.ex-filter input, .ex-filter .select { height: 40px; }
.ex-body > .kpis:first-child, .ex-body > .up-kpis:first-child { margin-top: 0; }
.done-top:first-child, .view > .done-controls:first-child { margin-top: 4px; }
.view > .notes-controls:first-child { margin-top: 4px; }

@media (max-width: 640px) {
  .view { padding-top: 12px; }
  .ov-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .ov-controls .search { min-width: 0; }
  .ov-controls .chips { grid-column: 1 / -1; }
  .filter-btn span { display: none; }
  .filter-btn { width: 44px; padding: 0; }
  .filter-btn .fb-n { position: absolute; top: -5px; right: -5px; }
  .qa:not(.open) { flex-direction: row; }
  .ib-preview { display: none; }
  .inbox-panel header .spacer { flex: 1; }
  .new-grid button { padding: 12px; }
  .ex-bar { margin-top: 8px; }
  .lanes { margin-top: 14px; gap: 18px; }
}
@media (max-width: 640px) {
  .ov-controls .search { grid-row: 1; grid-column: 1; }
  .ov-controls .filter-btn { grid-row: 1; grid-column: 2; }
  .ov-controls .chips { grid-row: 2; grid-column: 1 / -1; }
}
