/* DMF Aufgaben – Design
   Markenfarben: Hellgrün #a2c617 · Dunkelgrün #84a214 · Dunkelgrau #4a4a4a · Hellgrau #575757 */
:root {
  --lime: #a2c617; --lime-600: #84a214; --lime-700: #6b8410; --lime-50: #f2f7df; --lime-100: #e4efbd; --on-lime: #1e2606;
  --graphite: #4a4a4a; --grey: #575757;
  --bg: #f2f3ef; --surface: #ffffff; --surface-2: #f7f8f4; --surface-3: #eef0ea; --border: #e1e4dc; --border-2: #cfd3c8;
  --text: #24261f; --text-2: #575a52; --text-3: #8a8d84;
  --side: #3f403d; --side-2: #4a4a4a; --side-text: #e9eae6; --side-muted: #a9aba4;
  --p1: #d63c3c; --p2: #e57a1e; --p3: #cf9d00; --p4: #84a214; --p5: #9a9e95;
  --danger: #d63c3c; --danger-bg: #fdecec; --warn: #b77400; --warn-bg: #fff4dc; --info: #2f6fbf; --info-bg: #e9f1fb;
  --ring-track: rgba(0,0,0,.08);
  --radius: 14px; --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(30,32,25,.06), 0 1px 1px rgba(30,32,25,.04);
  --shadow-2: 0 8px 28px rgba(30,32,25,.12), 0 2px 6px rgba(30,32,25,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Bahnschrift", "DIN Alternate", "DIN Next LT Pro", "D-DIN", "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191a18; --surface: #232421; --surface-2: #2a2b28; --surface-3: #30322e; --border: #363833; --border-2: #474a43;
    --text: #ecede8; --text-2: #b7bab1; --text-3: #8b8e86; --side: #131412; --side-2: #1f201d;
    --lime-50: #2a3112; --lime-100: #364016; --danger-bg: #3a1f1f; --warn-bg: #3a2f14; --info-bg: #1b2a3c; --ring-track: rgba(255,255,255,.1);
    --shadow-2: 0 10px 30px rgba(0,0,0,.45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #191a18; --surface: #232421; --surface-2: #2a2b28; --surface-3: #30322e; --border: #363833; --border-2: #474a43;
  --text: #ecede8; --text-2: #b7bab1; --text-3: #8b8e86; --side: #131412; --side-2: #1f201d;
  --lime-50: #2a3112; --lime-100: #364016; --danger-bg: #3a1f1f; --warn-bg: #3a2f14; --info-bg: #1b2a3c; --ring-track: rgba(255,255,255,.1);
  --shadow-2: 0 10px 30px rgba(0,0,0,.45); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: .1px; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lime-700); }
:root[data-theme="dark"] a { color: var(--lime); }
.ico { width: 20px; height: 20px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--lime-600); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.btn-primary:hover { background: #95b614; border-color: #95b614; }
.btn-dark { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.btn-dark:hover { background: #3c3c3c; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: transparent; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 16px; }
.btn-icon { width: 40px; padding: 0; }
.btn-block { width: 100%; }
.btn .badge { margin-left: 2px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .2px; }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--lime-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 30%, transparent); }
.input.is-uncertain { border-color: #e0a800; background: var(--warn-bg); }
.input.is-error { border-color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hint { font-size: 12.5px; color: var(--text-3); }
.uncertain-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: #f5be00; color: #3a2c00; font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.switch input { appearance: none; flex: none; width: 42px; height: 24px; border-radius: 12px; background: var(--border-2); position: relative; cursor: pointer; transition: background .2s; margin-top: 1px; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked { background: var(--lime-600); }
.switch input:checked::after { transform: translateX(18px); }
.switch b { display: block; font-weight: 600; }
.switch small { color: var(--text-3); }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.fieldset > legend, .fs-title { font-family: var(--font-head); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-3); padding: 0 6px; margin-left: -6px; }
.fs-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0; }
.deadline-box { border: 2px solid var(--graphite); border-radius: 12px; padding: 12px; background: var(--surface-2); }
:root[data-theme="dark"] .deadline-box { border-color: var(--lime-600); }
.deadline-box .fs-title { color: var(--text); font-size: 14px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 11px; font-size: 14px; }
.alert .ico { margin-top: 1px; }
.alert-warn { background: var(--warn-bg); color: color-mix(in srgb, var(--warn) 85%, var(--text)); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--info-bg); color: color-mix(in srgb, var(--info) 80%, var(--text)); }
.alert-ok { background: var(--lime-50); color: var(--lime-700); }
:root[data-theme="dark"] .alert-ok { color: var(--lime); }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(320px, 46%) 1fr; }
.auth-brand { background: linear-gradient(160deg, #4a4a4a 0%, #383937 70%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border: 46px solid rgba(162,198,23,.16); }
.auth-brand img { width: 260px; max-width: 80%; }
.auth-brand h1 { font-size: 36px; line-height: 1.12; margin: 28px 0 14px; }
.auth-brand h1 em { font-style: normal; color: var(--lime); }
.auth-brand p { color: #cfd1cb; max-width: 440px; }
.auth-points { display: grid; gap: 10px; margin-top: 28px; }
.auth-points div { display: flex; gap: 10px; align-items: center; color: #e6e7e3; }
.auth-points .ico { color: var(--lime); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 26px; margin-bottom: 6px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-3); margin: 20px 0; }
.tabs button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.auth-mobile-logo { display: none; }

/* ---------- App-Rahmen ---------- */
.shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 268px, transparent 268px); }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; overflow-y: auto; }
.side-logo { padding: 4px 10px 18px; }
.side-logo img { width: 170px; display: block; }
.side .btn-primary { margin: 4px 4px 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 8px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--side-muted); padding: 10px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--side-text); text-decoration: none; font-weight: 500; cursor: pointer; }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.on { background: rgba(162,198,23,.16); color: #fff; box-shadow: inset 3px 0 0 var(--lime); }
.nav a .ico { color: var(--side-muted); }
.nav a.on .ico { color: var(--lime); }
.nav a .count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--side-muted); }
.nav a .count.hot { background: var(--p1); color: #fff; padding: 1px 7px; border-radius: 9px; }
.nav a .count.new { background: var(--lime); color: var(--on-lime); padding: 1px 7px; border-radius: 9px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--lime); color: var(--on-lime); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.side-foot .who small { color: var(--side-muted); }
.side-foot .btn-ghost { color: var(--side-muted); }
.side-foot .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .mobile-logo { display: none; }
.search { flex: 1; max-width: 520px; position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search input { padding-left: 40px; background: var(--surface); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 11px var(--font); color: var(--text-3); border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 6px; }
.topbar .spacer { flex: 1; }
.bell { position: relative; }
.bell .badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: 10.5px; }
.content { padding: 8px 28px 120px; max-width: 1180px; width: 100%; }
.offline-bar { display: flex; align-items: center; gap: 8px; justify-content: center; background: var(--warn-bg); color: var(--warn); font-size: 13px; padding: 6px; font-weight: 600; }

/* ---------- Kopfbereich „Heute“ ---------- */
.hello { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: stretch; margin: 8px 0 18px; }
.hello-text h1 { font-size: 30px; line-height: 1.15; }
.hello-text .date { color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 12.5px; margin-bottom: 6px; }
.mood { display: flex; align-items: center; gap: 18px; padding: 14px 22px 14px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); min-width: 360px; }
.mood h3 { font-size: 18px; }
.mood p { margin: 3px 0 8px; color: var(--text-2); font-size: 13.5px; }
.mood .progress { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-head); }
.mood .progress b { font-size: 28px; }
.mood .progress span { color: var(--text-3); font-size: 13px; }
.smiley { flex: none; }
.smiley .smiley-ring { transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.smiley .eyes { transform-origin: 50px 42px; animation: blink 5.5s infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.smiley.is-happy { animation: bounce 1.2s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.mood.pop .smiley { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-4deg); } 100% { transform: scale(1); } }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; cursor: pointer; text-align: left; transition: border-color .15s, transform .1s; display: block; width: 100%; }
.stat:hover { border-color: var(--border-2); transform: translateY(-1px); }
.stat .k { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.stat .v { font-family: var(--font-head); font-size: 28px; font-weight: 600; margin-top: 2px; line-height: 1.1; }
.stat.danger .v { color: var(--p1); }
.stat.ok .v { color: var(--lime-600); }
.stat .ico { width: 16px; height: 16px; }

/* ---------- Listen ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 12px; flex-wrap: wrap; }
.view-head h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.view-head h2 .ico { width: 22px; height: 22px; color: var(--lime-600); }
.view-head p { margin: 2px 0 0; color: var(--text-3); font-size: 13.5px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .9px; color: var(--text-3); font-family: var(--font-head); font-weight: 600; }
.section-title .n { background: var(--surface-3); color: var(--text-2); border-radius: 8px; padding: 0 7px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.task { --pc: var(--p5); display: flex; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s, opacity .3s; }
.task::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pc); }
.task:hover { border-color: var(--border-2); box-shadow: var(--shadow-2); }
.task.P1 { --pc: var(--p1); } .task.P2 { --pc: var(--p2); } .task.P3 { --pc: var(--p3); } .task.P4 { --pc: var(--p4); } .task.P5 { --pc: var(--p5); }
.task.is-critical { background: linear-gradient(90deg, color-mix(in srgb, var(--p1) 7%, var(--surface)), var(--surface) 40%); border-color: color-mix(in srgb, var(--p1) 35%, var(--border)); }
.task.is-done { opacity: .62; }
.task.is-done h3 { text-decoration: line-through; text-decoration-color: var(--text-3); }
.task.leaving { opacity: 0; transform: translateX(20px); }
.check { flex: none; width: 54px; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; padding: 0 0 0 6px; }
.check span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-2); display: inline-flex; align-items: center; justify-content: center; transition: all .2s; color: transparent; }
.check:hover span { border-color: var(--lime-600); color: var(--lime-600); }
.check span .ico { width: 15px; height: 15px; stroke-width: 3; }
.task.is-done .check span { background: var(--lime-600); border-color: var(--lime-600); color: #fff; }
.task-body { flex: 1; min-width: 0; padding: 12px 14px 12px 0; cursor: pointer; }
.task-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.task h3 { font-family: var(--font); font-weight: 650; font-size: 15.5px; margin: 3px 0 2px; line-height: 1.3; }
.task .sub { color: var(--text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .sub b { font-weight: 600; color: var(--text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip .ico { width: 14px; height: 14px; }
.chip.deadline { background: var(--graphite); color: #fff; font-weight: 600; }
.chip.deadline.danger { background: var(--p1); }
.chip.deadline.warn { background: var(--p2); }
.chip.window { background: transparent; border: 1px dashed var(--border-2); }
.chip.window.warn { border-color: var(--p2); color: var(--p2); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.new { background: var(--lime); color: var(--on-lime); font-weight: 700; }
.chip.lime { background: var(--lime-50); color: var(--lime-700); }
:root[data-theme="dark"] .chip.lime { color: var(--lime); }
.prio { display: inline-flex; align-items: center; gap: 0; height: 22px; border-radius: 6px; overflow: hidden; font-weight: 700; font-size: 12px; border: 1px solid var(--pc, var(--p5)); }
.prio .l { background: var(--pc, var(--p5)); color: #fff; padding: 0 7px; display: inline-flex; align-items: center; height: 100%; }
.prio .s { padding: 0 7px; color: var(--text); }
.prio.manual .l::after { content: "✎"; margin-left: 4px; font-weight: 400; }
.crit { display: inline-flex; align-items: center; gap: 4px; color: var(--p1); font-weight: 700; font-size: 12px; }
.crit .ico { width: 15px; height: 15px; animation: flicker 1.6s ease-in-out infinite; }
@keyframes flicker { 50% { opacity: .55; } }
.task-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; padding: 12px 14px 12px 0; gap: 8px; flex: none; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius); }
.empty .ico { width: 34px; height: 34px; color: var(--lime-600); margin-bottom: 8px; }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 4px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips .chip { background: var(--lime-50); color: var(--lime-700); cursor: pointer; }
.filter-chips .chip .ico { width: 12px; height: 12px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 10px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- Seitenpanel (Detail / Formular) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20,21,18,.42); z-index: 60; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--bg); z-index: 61; box-shadow: var(--shadow-2); display: flex; flex-direction: column; animation: slide .25s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--border); padding-top: calc(14px + var(--safe-t)); }
.drawer-head h2 { font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.drawer-foot { display: flex; gap: 8px; padding: 12px 18px calc(12px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--border); flex-wrap: wrap; }
.drawer-foot .spacer { flex: 1; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, calc(100% - 32px)); max-height: calc(100% - 48px); background: var(--bg); border-radius: 20px; z-index: 61; box-shadow: var(--shadow-2); display: flex; flex-direction: column; overflow: hidden; animation: zoom .2s ease; }
.modal.narrow { width: min(520px, calc(100% - 32px)); }
@keyframes zoom { from { transform: translate(-50%, -48%) scale(.98); opacity: 0; } }

.detail-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.score-ring { --pc: var(--p5); width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--pc) calc(var(--v) * 1%), var(--surface-3) 0); display: grid; place-items: center; }
.score-ring > div { width: 66px; height: 66px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; line-height: 1; }
.score-ring b { font-family: var(--font-head); font-size: 24px; display: block; }
.score-ring small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.detail-hero h3 { font-size: 19px; line-height: 1.25; }
.breakdown { display: grid; gap: 9px; }
.bd-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.bd-row .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bd-row .bar i { display: block; height: 100%; background: var(--lime-600); border-radius: 3px; }
.bd-row.deadline .bar i { background: var(--graphite); }
:root[data-theme="dark"] .bd-row.deadline .bar i { background: var(--lime); }
.bd-row b { font-family: var(--font-head); }
.bd-total { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 9px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 7px 12px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.summary-text { white-space: pre-wrap; margin: 0; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.att .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.att .name:hover { text-decoration: underline; }
.drop { border: 2px dashed var(--border-2); border-radius: 14px; padding: 22px; text-align: center; color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; background: var(--surface); }
.drop.over, .drop:hover { border-color: var(--lime-600); background: var(--lime-50); }
.drop .ico { width: 28px; height: 28px; color: var(--lime-600); }
.log { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.log-item { padding-left: 14px; border-left: 2px solid var(--border); }
.log-item b { font-weight: 600; }
.log-item .muted { font-size: 12px; }
.assign-box { background: var(--lime-50); border: 1px solid var(--lime-100); border-radius: var(--radius); padding: 14px; }

/* ---------- Erfassung ---------- */
.capture-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.capture-tabs button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.capture-tabs button .ico { width: 24px; height: 24px; }
.capture-tabs button.on { border-color: var(--lime-600); background: var(--lime-50); color: var(--text); box-shadow: inset 0 0 0 1px var(--lime-600); }
.capture-tabs button.on .ico { color: var(--lime-600); }
.rec { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 6px; }
.rec-btn { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--lime); color: var(--on-lime); cursor: pointer; display: grid; place-items: center; position: relative; box-shadow: 0 8px 24px rgba(132,162,20,.35); transition: transform .1s; }
.rec-btn .ico { width: 38px; height: 38px; }
.rec-btn:active { transform: scale(.97); }
.rec-btn.on { background: var(--p1); color: #fff; box-shadow: 0 8px 24px rgba(214,60,60,.35); }
.rec-btn.on::before, .rec-btn.on::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--p1); opacity: 0; animation: pulse 1.6s ease-out infinite; }
.rec-btn.on::after { animation-delay: .8s; }
@keyframes pulse { from { transform: scale(.9); opacity: .7; } to { transform: scale(1.35); opacity: 0; } }
.rec-time { font-family: var(--font-head); font-size: 22px; font-variant-numeric: tabular-nums; }
.mail-preview { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; font-size: 14px; }
.mail-preview .mbody { white-space: pre-wrap; max-height: 180px; overflow: auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--text-2); }
.file-pill { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; }
.file-pill .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review { display: flex; flex-direction: column; gap: 12px; }
.review-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.review-card.off { opacity: .5; }
.review-card .rc-head { display: flex; align-items: center; gap: 10px; }
.review-card .rc-head input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--lime-600); }
.review-card .rc-head .input { font-weight: 650; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--lime-100); border-top-color: var(--lime-600); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 28px; color: var(--text-2); font-weight: 600; }

/* ---------- Einstellungen ---------- */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.settings-nav button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-weight: 600; color: var(--text-2); }
.settings-nav button:hover { background: var(--surface-3); }
.settings-nav button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.settings-nav .nav-label { color: var(--text-3); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 14px; }
.panel h3 { font-size: 18px; margin-bottom: 4px; }
.panel > p.lead { margin: 0 0 16px; color: var(--text-2); font-size: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl input.input { min-height: 34px; padding: 5px 8px; }
.tbl .num { width: 76px; text-align: right; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--p5); }
.status-dot.active::before { background: var(--lime-600); } .status-dot.pending::before { background: var(--p2); } .status-dot.rejected::before, .status-dot.disabled::before { background: var(--p1); }
.key-state { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.key-state .ico { color: var(--lime-600); }
.cat-block { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.cat-block summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); cursor: pointer; list-style: none; }
.cat-block summary::-webkit-details-marker { display: none; }
.cat-block summary .grow { flex: 1; font-weight: 650; }
.cat-block .inner { padding: 6px 10px 10px; }

/* ---------- Benachrichtigungen / Toast ---------- */
.pop-panel { position: fixed; top: 62px; right: 20px; width: min(400px, calc(100% - 24px)); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-2); z-index: 70; padding: 8px; animation: zoom2 .15s ease; }
@keyframes zoom2 { from { opacity: 0; transform: translateY(-6px); } }
.notif { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--lime-50); }
.notif .ico { color: var(--lime-600); margin-top: 2px; }
.toasts { position: fixed; bottom: calc(24px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--graphite); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-2); font-weight: 500; animation: up .25s ease; max-width: min(560px, calc(100vw - 32px)); }
.toast.err { background: var(--p1); }
.toast button { background: none; border: 0; color: var(--lime); font-weight: 700; cursor: pointer; padding: 0; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 95; }
.confetti-layer i { position: fixed; width: 9px; height: 13px; border-radius: 2px; animation: confetti 1.5s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), calc(var(--dy) + 260px)) rotate(var(--rot)); opacity: 0; } }

/* ---------- Ersteinrichtung ---------- */
.onb { min-height: 100%; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--lime-50), transparent), var(--bg); }
.onb-card { width: 100%; max-width: 680px; }
.onb-card > img { width: 220px; display: block; margin: 0 auto 26px; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.steps i.on { background: var(--lime-600); }

/* ---------- Mobile Navigation ---------- */
.bottom-nav { display: none; }
.fab { display: none; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .hello { grid-template-columns: 1fr; }
  .mood { min-width: 0; }
}
@media (max-width: 900px) {
  body { font-size: 15.5px; }
  .shell { grid-template-columns: 1fr; background: none; }
  .side { display: none; }
  .topbar { padding: calc(10px + var(--safe-t)) 14px 10px; gap: 8px; }
  .topbar .mobile-logo { display: block; height: 30px; }
  .topbar .search { display: none; }
  .topbar .search.open { display: block; position: absolute; left: 10px; right: 10px; top: calc(8px + var(--safe-t)); max-width: none; }
  .content { padding: 4px 14px calc(110px + var(--safe-b)); }
  .hello-text h1 { font-size: 24px; }
  .mood { padding: 12px; gap: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stats .stat:first-child { grid-column: 1 / -1; }
  .stat .v { font-size: 24px; }
  .task-right { display: none; }
  .check { width: 48px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + var(--safe-b)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--text-3); text-decoration: none; padding: 4px 0; position: relative; cursor: pointer; }
  .bottom-nav a.on { color: var(--lime-700); }
  :root[data-theme="dark"] .bottom-nav a.on { color: var(--lime); }
  .bottom-nav a .ico { width: 23px; height: 23px; }
  .bottom-nav a .badge { position: absolute; top: 0; left: 55%; min-width: 17px; height: 17px; font-size: 10px; }
  .bottom-nav .fab-slot { display: flex; justify-content: center; }
  .bottom-nav .fab-slot button { width: 56px; height: 56px; margin-top: -24px; border-radius: 18px; border: 0; background: var(--lime); color: var(--on-lime); box-shadow: 0 8px 20px rgba(132,162,20,.4); display: grid; place-items: center; cursor: pointer; }
  .bottom-nav .fab-slot button .ico { width: 28px; height: 28px; }
  .drawer { width: 100%; }
  .modal { left: 0; top: 0; transform: none; width: 100%; max-height: none; height: 100%; border-radius: 0; animation: slideup .25s ease; }
  .modal.narrow { width: 100%; }
  @keyframes slideup { from { transform: translateY(30px); opacity: 0; } }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-2.keep { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 6px; font-size: 12.5px; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .settings-nav button { white-space: nowrap; }
  .settings-nav .nav-label { display: none; }
  .capture-tabs { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .capture-tabs button { padding: 10px 2px; font-size: 11.5px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: block; width: 210px; margin: 0 auto 18px; }
  .pop-panel { top: calc(56px + var(--safe-t)); right: 12px; }
  .detail-hero { grid-template-columns: 1fr; text-align: left; }
  .tbl-wrap { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .side, .topbar, .bottom-nav, .check { display: none !important; } .shell { display: block; } }
.cat-block summary .num { width: 84px; flex: none; text-align: right; min-height: 34px; }
.test-bar { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; background: var(--graphite); color: #fff; font-size: 13px; padding: 7px 12px; padding-top: calc(7px + var(--safe-t)); }
.test-bar .ico { width: 16px; height: 16px; color: var(--lime); }
.test-bar a { color: var(--lime); font-weight: 700; cursor: pointer; text-decoration: underline; }

/* ---------- v1.2: Status, Checkliste, Notizen, Profilbild ---------- */
:root { --st-progress: #e57a1e; --st-progress-bg: #fff1e3; --st-returned: #d63c3c; --st-returned-bg: #fdecec; --st-done: #6f9a12; }
:root[data-theme="dark"] { --st-progress-bg: #3a2a18; --st-returned-bg: #3a1f1f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-progress-bg: #3a2a18; --st-returned-bg: #3a1f1f; } }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 76px; height: 76px; font-size: 26px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; padding-bottom: 6px; }

/* Status-Kreis links an der Karte */
.task.st-in_bearbeitung .check span { border-color: var(--st-progress); background: var(--st-progress-bg); color: var(--st-progress); }
.task.st-zurueck .check span { border-color: var(--st-returned); background: var(--st-returned); color: #fff; }
.task.st-erledigt .check span { background: var(--lime-600); border-color: var(--lime-600); color: #fff; }
.task.is-returned { border-color: color-mix(in srgb, var(--st-returned) 55%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--st-returned) 35%, transparent), var(--shadow-1); background: linear-gradient(90deg, var(--st-returned-bg), var(--surface) 45%); }
.task.is-returned::before { background: var(--st-returned); }
.returned-reason { color: var(--st-returned); white-space: normal; display: flex; gap: 5px; align-items: flex-start; margin: 2px 0; }
.returned-reason .ico { width: 15px; height: 15px; margin-top: 2px; }
.returned-reason b { color: var(--st-returned); }
.chip.st-progress { background: var(--st-progress-bg); color: var(--st-progress); font-weight: 700; }
.chip.st-returned { background: var(--st-returned); color: #fff; font-weight: 700; }
.chip.st-done { background: var(--lime-50); color: var(--st-done); font-weight: 700; }
:root[data-theme="dark"] .chip.st-done { color: var(--lime); }
.chip.cl-chip { position: relative; padding-bottom: 2px; }
.chip.cl-chip i { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--w); background: var(--lime-600); border-radius: 0 2px 2px 0; }
.chip.cl-chip.full { background: var(--lime-50); color: var(--st-done); }

/* Status-Schalter in der Detailansicht */
.status-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.status-seg button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); font-weight: 600; cursor: pointer; color: var(--text-2); }
.status-seg button .ico { width: 17px; height: 17px; }
.status-seg button:hover:not([disabled]):not(.on) { background: var(--surface-2); }
.status-seg .s-offen.on { border-color: var(--graphite); color: var(--text); box-shadow: inset 0 0 0 1px var(--graphite); }
.status-seg .s-in_bearbeitung { color: var(--st-progress); }
.status-seg .s-in_bearbeitung.on { background: var(--st-progress); border-color: var(--st-progress); color: #fff; }
.status-seg .s-erledigt { color: var(--st-done); }
.status-seg .s-erledigt.on { background: var(--lime-600); border-color: var(--lime-600); color: #fff; }
.status-seg .s-zurueck { color: var(--st-returned); border-color: color-mix(in srgb, var(--st-returned) 45%, var(--border-2)); }
.status-seg .s-zurueck.on { background: var(--st-returned); color: #fff; opacity: 1; }
.return-form { padding: 12px; border-radius: 12px; background: var(--st-returned-bg); }

/* Checkliste */
.cl-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 10px 0 6px; }
.cl-bar i { display: block; height: 100%; background: var(--lime-600); border-radius: 4px; transition: width .4s ease; }
.cl-list, .form-cl { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
.cl-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.cl-item label { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.cl-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--lime-600); flex: none; }
.cl-item.done span { text-decoration: line-through; color: var(--text-3); }
.cl-item .btn-icon { opacity: .5; }
.cl-item:hover .btn-icon { opacity: 1; }
.cl-add { display: flex; gap: 8px; margin-top: 6px; }
.cl-add .input { min-height: 36px; }

/* Notizen / Chat */
.chat-list { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; padding: 4px 2px 8px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg.mine { flex-direction: row-reverse; }
.msg .bubble { max-width: 82%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.msg.mine .bubble { background: var(--lime-50); border-color: var(--lime-100); border-radius: 14px 14px 4px 14px; }
.msg.ret .bubble { background: var(--st-returned-bg); border-color: color-mix(in srgb, var(--st-returned) 40%, var(--border)); }
.msg .meta { font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; }
.msg .meta b { color: var(--text-2); }
.msg .txt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.ret-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--st-returned); font-weight: 700; }
.ret-tag .ico { width: 12px; height: 12px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--border); padding-top: 10px; }
.chat-input textarea { min-height: 40px; max-height: 140px; resize: vertical; }

/* Formular: optionale Zeitangaben, Anhänge bei Sprache */
.opt-times { border: 1px dashed var(--border-2); border-radius: 12px; padding: 10px 12px; }
.opt-times summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text-2); list-style: none; }
.opt-times summary::-webkit-details-marker { display: none; }
.attach-mini { border: 1px dashed var(--border-2); border-radius: 12px; padding: 12px; background: var(--surface); }
.attach-mini .label { display: inline-flex; align-items: center; gap: 6px; }
.attach-mini .label .ico { width: 16px; height: 16px; }

/* ---------- v1.3: Strukturen ---------- */
.aff-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aff-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; color: var(--text); }
.aff-card .ico { color: var(--text-3); width: 22px; height: 22px; }
.aff-card small { color: var(--text-3); font-size: 12.5px; line-height: 1.35; }
.aff-card.on { border-color: var(--lime-600); background: var(--lime-50); box-shadow: inset 0 0 0 1px var(--lime-600); }
.aff-card.on .ico { color: var(--lime-600); }
.join-code { font-family: var(--font-head); font-size: 22px; letter-spacing: 2px; }
.key-show { font-size: 12.5px; overflow-wrap: anywhere; word-break: break-all; }
.code-input { font-family: var(--font-head); font-size: 17px; letter-spacing: .5px; }
@media (max-width: 900px) { .aff-cards { grid-template-columns: 1fr; } }

/* ---------- v1.4: Push & E-Mail ---------- */
.push-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--lime-600); border-left-width: 4px; }
.push-banner > .ico { color: var(--lime-700); }
:root[data-theme="dark"] .push-banner > .ico { color: var(--lime); }
.push-banner .grow { flex: 1; min-width: 200px; }
.push-state { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.push-state .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); flex: none; }
.push-state.on .dot { background: var(--lime-600); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 25%, transparent); }
.push-state.warn .dot { background: var(--warn); }
.device-list { display: grid; gap: 6px; }
.device-list .dev { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.device-list .dev .grow { flex: 1; min-width: 0; }
.stat-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.stat-mini > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.stat-mini b { display: block; font-size: 20px; }
.preset-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 9px; }
.ev-list li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.ev-list li .ico { color: var(--lime-700); margin-top: 2px; }
:root[data-theme="dark"] .ev-list li .ico { color: var(--lime); }
.push-state { flex-wrap: wrap; }
.push-state .grow { flex: 1; min-width: 180px; }
.push-banner { margin-top: 2px; }

/* ---------- v1.5: DOS-Zusammenfassung ---------- */
.dos-panel { border-left: 4px solid var(--lime-600); }
.dos-short { margin: 10px 0 6px; display: grid; gap: 2px; }
.dos-short dt { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; margin-top: 6px; }
.dos-short dd { margin: 0; white-space: pre-wrap; }
.dos-contents { display: grid; gap: 7px; }
.dos-contents > div, .dos-contents > label { display: flex; gap: 8px; align-items: center; }
.dos-contents .ico { color: var(--lime-700); flex: none; }
:root[data-theme="dark"] .dos-contents .ico { color: var(--lime); }
.dos-files { margin: 2px 0 0 4px; padding-left: 18px; display: grid; gap: 3px; }
.dos-form textarea { resize: vertical; }

/* ---------- Update-Hinweis ---------- */
.update-bar { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 14px; background: #4a4a4a; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 24px); }
.update-bar .ico { color: #a2c617; flex: none; }
@media (max-width: 760px) { .update-bar { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* ---------- v1.6: lokale KI, mehrere Zuständige, Start heute/später ---------- */
.av-stack { display: flex; align-items: center; }
.av-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.av-stack .avatar + .avatar { margin-left: -7px; }
.av-more { margin-left: 3px; font-size: 11px; font-weight: 700; color: var(--text-3); }
.asg-list { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.assignee-pick { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0; border-radius: 12px; }
.assignee-pick.is-uncertain { outline: 2px solid #e0a800; outline-offset: 4px; }
.assignee-pick .pick { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; user-select: none; transition: border-color .15s, background .15s; }
.assignee-pick .pick input { position: absolute; opacity: 0; pointer-events: none; }
.assignee-pick .pick:hover { border-color: var(--lime-600); }
.assignee-pick .pick.on { border-color: var(--lime-600); background: color-mix(in srgb, var(--lime) 16%, var(--surface)); }
.assignee-pick .pick.on::after { content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--lime-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat; }
.assignee-pick .pick:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 35%, transparent); }
.start-seg button { display: inline-flex; align-items: center; gap: 6px; }
.src-text { margin-top: 6px; font-size: 13px; }
.src-text summary { cursor: pointer; color: var(--text-2); }
.src-text p { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface); white-space: pre-wrap; }
.drop-thin { border: 1.5px dashed var(--border-2); border-radius: 12px; padding: 10px 12px; min-height: 46px; display: flex; flex-direction: column; justify-content: center; }
.drop-thin.over { border-color: var(--lime-600); background: color-mix(in srgb, var(--lime) 10%, transparent); }
.busy-stage { font-weight: 600; text-align: center; }
.svc { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.svc .grow { flex: 1; min-width: 0; }
.st-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--danger, #c0392b); }
.st-dot.ok { background: var(--lime-600); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 25%, transparent); }
.st-dot.warn { background: #e0a800; }
.model-opt { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); }
.model-opt.on { border-color: var(--lime-600); background: color-mix(in srgb, var(--lime) 10%, var(--surface)); }
.model-opt input { accent-color: var(--lime-600); }
.model-opt .grow { flex: 1; min-width: 0; }
.ok-txt { color: var(--lime-700); font-weight: 600; }
:root[data-theme="dark"] .ok-txt { color: var(--lime); }
.pull-box { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.pull-box.err { border-color: var(--danger, #c0392b); }
.pull-box .bar { height: 6px; border-radius: 3px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.pull-box .bar i { display: block; height: 100%; background: var(--lime-600); transition: width .4s; }
.local-ai-panel > .row .ico { color: var(--lime-700); width: 22px; height: 22px; }
:root[data-theme="dark"] .local-ai-panel > .row .ico { color: var(--lime); }
.leave-wrap { border-top: 1px solid var(--border); padding-top: 10px; }
.mode-seg button { display: inline-flex; align-items: center; gap: 6px; }
.cloud-wrap > summary { list-style: none; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.cloud-wrap > summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) { .assignee-pick .pick { font-size: 13px; padding: 5px 10px 5px 6px; } }

/* ================================================================ v1.7: Tagesplanung, Wochenplanung, Team, Zuständigkeit */
.danger-txt { color: var(--p1); font-weight: 700; }
.warn-txt { color: var(--warn); font-weight: 700; }
.ink { color: var(--text); }
.chip.time { background: var(--surface-3); color: var(--text-2); font-weight: 600; }
.chip.warn-soft { background: var(--warn-bg); color: var(--warn); }
.chip.ok-soft { background: var(--lime-50); color: var(--lime-700); font-weight: 700; }
:root[data-theme="dark"] .chip.ok-soft { color: var(--lime); }
.chip.late { background: var(--danger-bg); color: var(--danger); font-weight: 700; }
.wcol-head small { display: block; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg button .ico { width: 15px; height: 15px; }
.stat .t { font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.stat.warn .v { color: var(--p2); }

/* Einplanen-Knopf auf der Karte */
.plan-btn { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 8px 4px 9px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.plan-btn .ico { width: 14px; height: 14px; }
.plan-btn:hover { border-color: var(--lime-600); color: var(--text); }
.plan-btn.manual { border-color: var(--lime-600); background: color-mix(in srgb, var(--lime) 14%, var(--surface)); color: var(--text); }
.plan-btn.sm { padding: 3px 8px; font-size: 11.5px; align-self: flex-start; }
.plan-pop { top: auto; right: auto; width: 270px; }
.pop-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; }
.pop-item:hover { background: var(--surface-2); }
.pop-item.on { background: color-mix(in srgb, var(--lime) 18%, var(--surface)); }
.pop-item .ico { width: 16px; height: 16px; color: var(--text-3); }

/* Dein Tag: Zeitleiste und Wochenstreifen */
.daybar { margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.timebar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.timebar i { display: block; height: 100%; }
.timebar i.done { background: var(--lime-600); }
.timebar i.open { background: var(--graphite); }
:root[data-theme="dark"] .timebar i.open { background: #c9cbc5; }
.timebar i.open.over { background: var(--p1); }
.timebar i.free { flex: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.done { background: var(--lime-600); } .legend i.open { background: var(--graphite); } .legend i.free { background: var(--surface-3); border: 1px solid var(--border-2); }
.weekstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.wday { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 9px 11px; font: inherit; color: var(--text); cursor: pointer; }
.wday small { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: var(--text-3); }
.wday b { font-size: 15px; }
.wday.today { border: 2px solid var(--lime-600); }
.wday.over { border-color: var(--p1); background: color-mix(in srgb, var(--p1) 6%, var(--surface)); }
.wday.over b { color: var(--p1); }
.wday.past { opacity: .55; }
.mini { display: block; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.mini i { display: block; height: 100%; background: var(--lime-600); border-radius: 99px; }
.wday.over .mini i, .wcol.over .mini i, .mini.over i { background: var(--p1); }
.section-title { display: flex; align-items: center; gap: 8px; }

/* Wochenplanung */
.weekgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: start; margin-top: 12px; }
.wcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 7px; min-height: 120px; }
.wcol.today { border: 2px solid var(--lime-600); }
.wcol.over { border-color: var(--p1); }
.wcol.past { opacity: .6; }
.wcol.later { background: transparent; border-style: dashed; }
.wcol-head { padding: 4px 4px 6px; border-bottom: 1px solid var(--border); }
.wcol-head small { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .02em; }
.wcol-head b { font-size: 16px; }
.wcol.over .wcol-head b { color: var(--p1); }
.mini-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 9px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.mini-card b { font-size: 13.5px; line-height: 1.3; }
.mini-card .chip { font-size: 11px; padding: 1px 6px; }
.mini-card.moving { border: 1.5px dashed var(--info); }
.mini-card.late { border-left: 4px solid var(--p1); }
.lvl { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; color: #fff; font-weight: 700; font-size: 11px; background: var(--p5); }
.lvl.P1 { background: var(--p1); } .lvl.P2 { background: var(--p2); } .lvl.P3 { background: var(--p3); } .lvl.P4 { background: var(--p4); }

/* Deadline-Nachfrage */
.kv-box { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; font-size: 14px; }
.kv-box span { color: var(--text-3); }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); }
.opt.on { border-color: var(--lime-600); background: color-mix(in srgb, var(--lime) 10%, var(--surface)); }
.opt input[type=radio] { margin-top: 3px; accent-color: var(--lime-700); }

/* Formular: Dauer und Einplanen */
.dur-box { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.dur-quick { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.chip-btn.on { border-color: var(--lime-600); background: color-mix(in srgb, var(--lime) 20%, var(--surface)); color: var(--text); }
.link-btn { border: 0; background: none; padding: 0; color: var(--lime-700); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
:root[data-theme="dark"] .link-btn { color: var(--lime); }
.plan-seg { align-items: center; }
.seg-date { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px 2px 9px; border-radius: 8px; color: var(--text-2); }
.seg-date.on { background: var(--surface); box-shadow: var(--shadow-1); color: var(--text); }
.seg-date input { border: 0; background: transparent; font: inherit; font-size: 13px; color: inherit; padding: 2px; }

/* Zuständigkeit gruppiert */
.assignee-pick.grouped { display: flex; flex-direction: column; gap: 8px; }
.asg-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.asg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 4px; border-radius: 999px; background: color-mix(in srgb, var(--lime) 18%, var(--surface)); border: 1.5px solid var(--lime-600); font-size: 13px; font-weight: 600; }
.asg-chip.hl { background: #fff4c2; border-color: #e0a800; color: #3a2c00; }
.asg-chip button { border: 0; background: transparent; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 50%; color: inherit; }
.asg-chip button .ico { width: 13px; height: 13px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; }
.asg-search { position: relative; }
.asg-search > .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.asg-search .input { padding-left: 34px; }
.asg-list-box { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); max-height: 340px; overflow-y: auto; padding: 6px; }
.asg-group { margin-left: calc(var(--d, 0) * 14px); }
.asg-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 8px 8px; border-radius: 8px; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; }
.asg-head:hover { background: var(--surface-2); }
.asg-head .ico { width: 14px; height: 14px; color: var(--text-3); }
.asg-members { display: flex; flex-direction: column; gap: 2px; padding: 0 0 4px 18px; }
.assignee-pick.grouped .pick { display: flex; width: 100%; border-radius: 9px; border: 1.5px solid transparent; padding: 6px 10px 6px 6px; }
.assignee-pick.grouped .pick.on { border-color: var(--lime-600); }
.assignee-pick.grouped .pick.hl { background: #fff4c2; border-color: #e0a800; color: #3a2c00; }
.assignee-pick.grouped .pick.amb { background: #fff9e0; border: 1.5px dashed #e0a800; }
.assignee-pick.grouped .pick.me { margin-bottom: 4px; border-bottom: 1px solid var(--border); border-radius: 9px 9px 0 0; }
:root[data-theme="dark"] .assignee-pick.grouped .pick.hl, :root[data-theme="dark"] .asg-chip.hl { background: #4a3d00; color: #ffe9a3; }
:root[data-theme="dark"] .assignee-pick.grouped .pick.amb { background: #3a3200; }

/* Team-Übersicht */
.team-table-wrap { overflow-x: auto; padding: 0; }
.team-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.team-table th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.team-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.team-table tr[data-member] { cursor: pointer; }
.team-table tr[data-member]:hover td { background: var(--surface-2); }
.team-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.team-table .mini { width: 120px; }
.ev-card { padding: 12px 14px; }
.team-task { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 11px; font: inherit; color: var(--text); cursor: pointer; }
.team-task.late { border-left: 4px solid var(--p1); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--text-3); font-size: 13px; } .kv dd { margin: 0; }

/* Einstellungen: Arbeitszeit, Struktur, Push */
.day-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.day-pick label { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 36px; border: 1.5px solid var(--border); border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer; background: var(--surface); color: var(--text-2); }
.day-pick label.on { border-color: var(--lime-600); background: color-mix(in srgb, var(--lime) 22%, var(--surface)); color: var(--text); }
.day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.req-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.req-row:last-child { border-bottom: 0; }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree ul { margin-left: 22px; padding-left: 14px; border-left: 2px solid var(--border); }
.org-tree li { margin: 6px 0; }
.org-node { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.org-node.lead { border-color: var(--lime-600); background: color-mix(in srgb, var(--lime) 10%, var(--surface)); }
.dev-st { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--text-3); }
.dev-st .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); flex: none; }
.dev-st.ok { color: var(--lime-700); } .dev-st.ok .dot { background: var(--lime-600); }
:root[data-theme="dark"] .dev-st.ok { color: var(--lime); }
.dev-st.bad { color: var(--p1); } .dev-st.bad .dot { background: var(--p1); }
.push-help summary { cursor: pointer; list-style: none; }
.push-help summary::-webkit-details-marker { display: none; }
.help-list { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.help-list code { font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.sub-tbl th { font-size: 11.5px; color: var(--text-3); text-align: left; font-weight: 700; padding: 4px 6px; }
.sub-tbl .num { text-align: right; }
.input.num.is-empty { border-style: dashed; }

@media (max-width: 900px) {
  .task-right { display: flex; padding: 10px 10px 10px 0; justify-content: flex-start; }
  .task-right .av-stack { display: none; }
  .plan-btn { flex-direction: column; gap: 1px; padding: 5px 7px; border-radius: 10px; font-size: 10.5px; }
  .plan-btn > .ico:last-child { display: none; }
  .weekgrid { grid-template-columns: 1fr; }
  .req-row { grid-template-columns: 1fr; }
  .team-table th:nth-child(4), .team-table td:nth-child(4), .team-table th:nth-child(6), .team-table td:nth-child(6), .team-table th:nth-child(8), .team-table td:nth-child(8), .team-table th:nth-child(9), .team-table td:nth-child(9) { display: none; }
}

/* ================================================================ v1.8: Umsatz / Wertungspunkte (grün) */
:root { --wp: #17602c; --wp-bg: #e2f3e6; --wp-border: #4caf6a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wp: #8fe0a4; --wp-bg: #183a22; --wp-border: #3d8f55; } }
:root[data-theme="dark"] { --wp: #8fe0a4; --wp-bg: #183a22; --wp-border: #3d8f55; }
.chip.wp { background: var(--wp-bg); color: var(--wp); font-weight: 700; }
.wp-txt { color: var(--wp); }
.hello { grid-template-columns: 1fr auto auto; }
.wp-tile { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 190px; text-align: left; font: inherit; cursor: pointer;
  background: color-mix(in srgb, var(--wp-bg) 70%, var(--surface)); border: 2px solid var(--wp-border); border-radius: 20px; padding: 14px 18px; color: var(--wp); box-shadow: var(--shadow-1); }
.wp-tile .k { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; }
.wp-tile .v { font-size: 32px; line-height: 1.1; }
.wp-tile .v small { font-size: 17px; }
.wp-tile .s { font-size: 13px; opacity: .92; }
.wp-tile .s.strong { font-weight: 700; }
.wp-tile:hover { border-color: var(--wp); }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat.wp-stat { background: color-mix(in srgb, var(--wp-bg) 60%, var(--surface)); border-color: color-mix(in srgb, var(--wp-border) 55%, var(--border)); }
.stat.wp-stat .v, .stat.wp-stat .k, .stat.wp-stat .t { color: var(--wp); }
.rev-box > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; list-style: none; }
.rev-box > summary::-webkit-details-marker { display: none; }
.rev-box > summary .ico { width: 16px; height: 16px; color: var(--wp); }
.rev-sum-chip { margin-left: auto; }
.rev-who { display: flex; flex-wrap: wrap; gap: 8px; }
.rev-who button { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--border-2); background: var(--surface); border-radius: 12px; padding: 7px 14px 7px 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); min-height: 44px; cursor: pointer; }
.rev-who button.on { border-color: var(--wp-border); background: var(--wp-bg); color: var(--wp); }
.rev-who .plus { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.rev-search { margin-top: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.rev-hits { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.rev-hit { display: flex; align-items: center; gap: 10px; border: 1.5px solid transparent; background: transparent; border-radius: 9px; padding: 6px 10px; font: inherit; font-size: 14px; color: var(--text); min-height: 40px; cursor: pointer; text-align: left; }
.rev-hit:hover { background: var(--surface-2); }
.rev-hit.on { border-color: var(--wp-border); background: var(--wp-bg); color: var(--wp); font-weight: 700; }
.wp-input { display: flex; align-items: center; gap: 8px; }
.wp-input .input { text-align: right; font-weight: 700; color: var(--wp); }
.wp-input b { color: var(--wp); }
.rev-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .9fr) 44px; gap: 8px 10px; align-items: center; }
.rev-grid .lbl { font-size: 11.5px; font-weight: 700; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.rev-grid .lbl.r { text-align: right; padding-right: 30px; }
.rev-add { border: 1.5px dashed var(--wp-border); background: color-mix(in srgb, var(--wp-bg) 45%, var(--surface)); color: var(--wp); border-radius: 10px; min-height: 44px; font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rev-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--wp-bg); color: var(--wp); border-radius: 11px; padding: 10px 14px; font-weight: 600; }
.rev-total b { font-size: 20px; }
.wp-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.wp-tbl td { padding: 6px 4px; border-bottom: 1px solid var(--border); }
.wp-tbl .num { text-align: right; }
.wp-tbl tr.sum td { border-bottom: 0; font-weight: 600; }
.wcol-head .chip.wp, .wday .chip.wp { margin-top: 4px; align-self: flex-start; font-size: 11.5px; padding: 1px 7px; }
.wp-sparten { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--text-2); }
@media (max-width: 900px) {
  .hello { grid-template-columns: 1fr; }
  .wp-tile { min-width: 0; }
  .rev-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 96px 40px; }
}

.team-table tr.sum-row td { background: var(--surface-2); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--lime-700); flex: none; }
/* v1.8.1: KI ergänzt im Hintergrund */
.ai-live { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; }
.ai-live .spinner { width: 18px; height: 18px; flex: none; }
.ai-live.done { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.ai-live.fail { background: var(--surface-2); color: var(--text-2); }
.ai-tag { font-style: normal; font-size: 11px; font-weight: 700; color: var(--warn); margin-left: 6px; }

/* v1.9 Betreiber: Übersicht, Fernzugriff, Notfall-Funktionen */
.chip.warn { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.chip.dark { background: var(--graphite); color: #fff; }
.badge.warn { background: var(--p2); }
.op-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.op-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.op-tile b { font-size: 28px; color: var(--graphite); line-height: 1.1; }
[data-theme="dark"] .op-tile b { color: var(--text); }
.op-tile.warn { border: 2px solid var(--p2); } .op-tile.warn b { color: var(--p2); }
.op-tile.ok { border-color: var(--lime-600); }
.op-warn-panel { border: 2px solid var(--p2); }
.op-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.op-warn .grow { flex: 1 1 260px; min-width: 0; }
.op-tbl td { vertical-align: top; }
.op-tbl tr.own { background: var(--lime-50, rgba(162, 198, 23, .08)); }
.op-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.remote-nav { margin: 2px 0 6px 10px; padding-left: 8px; border-left: 3px solid var(--lime-600); display: flex; flex-direction: column; }
.remote-nav .nav-label { color: var(--lime-700, #5f7a0c); }
.remote-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--graphite); color: #fff; border-bottom: 4px solid var(--lime-600); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.remote-banner .chip { background: var(--lime-600); color: #1e2606; font-weight: 700; }
.remote-banner .grow { flex: 1 1 320px; }
.remote-banner .btn { background: #fff; color: var(--graphite); }
.remote-key { font: 700 22px ui-monospace, "DejaVu Sans Mono", monospace; letter-spacing: .12em; background: var(--surface-2); border: 2px dashed var(--lime-600); border-radius: 12px; padding: 12px 16px; color: var(--text); }
.msg-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; line-height: 1.5; }
.restore-drop { display: flex; align-items: center; gap: 12px; border: 2px dashed var(--lime-600); border-radius: 14px; padding: 14px 16px; cursor: pointer; background: var(--surface-2); }
.restore-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.restore-drop .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.step-h { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--graphite); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.lost-list { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.settings > .settings-body { min-width: 0; } .settings-body .tbl-wrap { overflow-x: auto; }
.op-actions .btn { white-space: nowrap; }
.op-orgs { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.op-org { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.op-org.own { background: var(--lime-50); border-color: transparent; }
.op-org-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-start; }
.op-org-head .grow { flex: 1 1 240px; min-width: 0; }
.op-org-name { font-size: 16px; }
.op-chips { gap: 6px; flex-wrap: wrap; }
.op-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; }
.op-facts > div { display: flex; flex-direction: column; gap: 2px; }
.op-facts b { font-size: 14px; font-weight: 600; }
.op-org .op-actions { justify-content: flex-start; }

/* ---------------------------------------------------------------- v1.10: Kontrolle, Bereiche, Erfassen-Reihenfolge */
:root { --st-ctl: #3f6fb5; --st-ctl-bg: #eaf0fa; }
:root[data-theme="dark"] { --st-ctl: #8fb0e6; --st-ctl-bg: #1c2a40; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-ctl: #8fb0e6; --st-ctl-bg: #1c2a40; } }
.chip.st-ctl { background: var(--st-ctl-bg); color: var(--st-ctl); font-weight: 700; }
.chip.st-ctl.due { background: var(--st-ctl); color: #fff; }
.chip.warn { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.task.st-kontrolle .check span { border-color: var(--st-ctl); background: var(--st-ctl-bg); color: var(--st-ctl); }
.task.st-kontrolle::before { background: var(--st-ctl); }
.status-seg .s-kontrolle { color: var(--st-ctl); }
.status-seg .s-kontrolle.on { border-color: var(--st-ctl); background: var(--st-ctl-bg); box-shadow: inset 0 0 0 1px var(--st-ctl); }
.status-seg .s-warten.on { border-color: var(--info); background: var(--info-bg); color: var(--info); box-shadow: inset 0 0 0 1px var(--info); }
.nav a .count.due { background: var(--st-ctl); color: #fff; padding: 1px 7px; border-radius: 9px; }
.section-title.due { color: var(--st-ctl); }
.card-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip.area-chip { background: transparent; border: 1px solid var(--border-2); color: var(--text-3); }
.chip.area-chip .ico { width: 13px; height: 13px; }

/* Bereich-Reiter über den Listen */
.area-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 4px 0 14px; }
.area-tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 9px 12px 10px; font-weight: 600; font-size: 14px; font-family: inherit; color: var(--text-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 8px 8px 0 0; }
.area-tabs button:hover { background: var(--surface-2); }
.area-tabs button span { background: var(--surface-3); color: var(--text-2); border-radius: 8px; padding: 0 7px; font-size: 12px; }
.area-tabs button.on { color: var(--text); border-bottom-color: var(--lime-600); }
.area-tabs button.on span { background: var(--lime); color: var(--on-lime); }
.area-seg button.on { box-shadow: inset 0 0 0 1px var(--lime-600), var(--shadow-1); }

/* Erfassen: Reiter auch oben im Formular „Manuell“ */
.capture-tabs { grid-template-columns: repeat(3, 1fr); }
.form-tabs { margin-bottom: 4px; }
.form-tabs button { flex-direction: row; justify-content: center; padding: 10px 6px; }
.form-tabs button .ico { width: 19px; height: 19px; }

/* Von dir zurückgegeben (Historie) */
.returned-list { display: flex; flex-direction: column; gap: 8px; }
.returned-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.returned-item > .ico { width: 18px; height: 18px; color: var(--st-returned); margin-top: 2px; flex: none; }
@media (max-width: 900px) {
  .capture-tabs { grid-template-columns: repeat(3, 1fr); }
  .area-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .area-tabs button { white-space: nowrap; padding: 8px 10px; font-size: 13px; }
}
.section-title .sec-extra { margin-left: auto; font-weight: 600; text-transform: none; letter-spacing: 0; }
@media (max-width: 600px) { .section-title .sec-extra { display: none; } }

/* ---------------------------------------------------------------- v1.11: Bereiche im Punktesystem, Rangfolge, Zuständig direkt */
.area-block { padding: 0; overflow: hidden; margin-bottom: 12px; }
.area-block > summary { list-style: none; cursor: pointer; padding: 12px 14px; background: var(--surface-2); }
.area-block > summary::-webkit-details-marker { display: none; }
.area-block > .inner { padding: 12px 14px; }
.area-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.area-head .area-name { flex: 1 1 220px; font-weight: 700; font-size: 16px; max-width: 360px; }
.area-head .input.num { width: 76px; }
.sp-block { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.chip .chip-x { border: 0; background: transparent; padding: 0; margin-left: 4px; cursor: pointer; color: var(--danger); display: inline-flex; }
.chip .chip-x .ico { width: 13px; height: 13px; }
.rank-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px 8px 12px; background: var(--surface); }
.rank-row + .rank-row { margin-top: 6px; }
.rank-row .grow { flex: 1; font-weight: 600; }
.rank-n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--lime); color: var(--on-lime); font-size: 14px; flex: none; }
.assign-btn { border: 1px dashed transparent; background: transparent; border-radius: 20px; padding: 2px 6px 2px 2px; cursor: pointer; gap: 2px; }
.assign-btn:hover { border-color: var(--lime-600); background: var(--lime-50); }
.assign-btn .assign-plus { display: inline-flex; color: var(--lime-700); opacity: .55; margin-left: 4px; }
.assign-btn:hover .assign-plus { opacity: 1; }
.assign-btn .assign-plus .ico { width: 14px; height: 14px; }
.asg-list { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }

/* v1.12 – Lokale KI: Modellvergleich & Messwerte */
.bad-txt { color: #c0392b; font-weight: 600; }
:root[data-theme="dark"] .bad-txt { color: #ff8a7a; }
.model-opt .chip { font-size: 11px; padding: 1px 8px; vertical-align: 1px; margin-left: 4px; }
.model-opt input[disabled] { opacity: .35; }
.cmp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.cmp-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.cmp-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cmp-table tr:last-child td { border-bottom: 0; }
.cmp-table tr.bad td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
@media (max-width: 600px) {
  .model-opt { flex-wrap: wrap; align-items: flex-start; }
  .model-opt .grow { flex: 1 1 0; min-width: 55%; }
  .model-opt > .btn:not(.btn-ghost) { flex: 1 1 100%; justify-content: center; margin-left: 28px; }
}
