@font-face { font-family: "Inter"; src: url("/static/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F4F4F1; --panel: #FFFFFF; --panel-2: #FAFAF8; --line: #E6E5E0; --line-2: #EFEEEA;
  --text: #17171A; --text-2: #45454D; --muted: #7A7A83;
  --accent: #4353D6; --accent-2: #3644B8; --accent-soft: #ECEEFC; --accent-ink: #2B37A0;
  --ai: #7647D6; --ai-soft: #F3EEFD; --ai-line: #E2D7FA;
  --ok: #13795B; --ok-soft: #E4F3ED; --warn: #9A5600; --warn-soft: #FCF0DF; --danger: #BF3A29; --danger-soft: #FBEAE7;
  --todo: #2564CF; --apple: #DD7E05;
  --shadow: 0 1px 2px rgba(20, 20, 35, .04), 0 4px 14px rgba(20, 20, 35, .04);
  --shadow-lg: 0 12px 40px rgba(20, 20, 35, .18);
  --r: 16px; --r-sm: 10px;
  --side: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1013; --panel: #17181C; --panel-2: #1B1C21; --line: #2A2B31; --line-2: #222328;
    --text: #ECECEF; --text-2: #C4C4CB; --muted: #8D8D97;
    --accent: #7E8CF6; --accent-2: #95A1F8; --accent-soft: #22264A; --accent-ink: #BCC4FB;
    --ai: #B596F7; --ai-soft: #251E3B; --ai-line: #3A2F5C;
    --ok: #4CC497; --ok-soft: #142D25; --warn: #F0A54A; --warn-soft: #33260F; --danger: #F27D6C; --danger-soft: #3A1D19;
    --todo: #77A4F2; --apple: #F4A944;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 450 14.5px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ---------- Gerüst ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--panel-2) calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px), var(--line) var(--side), transparent var(--side)); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px;
  border-right: 1px solid var(--line); background: var(--panel-2); }
.sug-more { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 2px; text-align: left; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--ai)); color: #fff; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 520; }
.nav a:hover { background: var(--line-2); color: var(--text); }
.nav a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 9px 11px; }
.nav a.on svg { color: var(--accent); }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.conn { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel); font-size: 12.5px; }
.conn h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.conn-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: var(--text-2); }
.conn-row .when { margin-left: auto; color: var(--muted); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.off { background: var(--muted); } .dot.err { background: var(--danger); }
.dot.busy { background: var(--ai); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: 9px 12px 9px 38px; outline: none; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 11px/1 "Inter"; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--panel-2); }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 60vh; overflow: auto; }
.results h5 { margin: 8px 10px 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.results button { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.results button:hover { background: var(--line-2); }
.results small { color: var(--muted); margin-left: auto; white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.clock { text-align: right; line-height: 1.2; }
.clock b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.clock span { font-size: 12px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 13px;
  background: var(--accent-soft); color: var(--accent-ink); border: 0; cursor: pointer; }
.view { padding: 8px 32px 48px; max-width: 1480px; width: 100%; }
.tabbar { display: none; }

/* ---------- Bausteine ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin: -2px 0 14px; }
.card-h h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.card-h .link { margin-left: auto; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.card-h .muted { margin-left: auto; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--panel-2); border-color: color-mix(in srgb, var(--line) 50%, var(--muted)); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ai { background: var(--ai-soft); border-color: var(--ai-line); color: var(--ai); }
.btn.ai:hover { background: color-mix(in srgb, var(--ai-soft) 70%, var(--ai-line)); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.icon { padding: 8px; }
.btn.busy { pointer-events: none; }
.btn.busy svg { animation: pulse 1.4s infinite; }
.btn:disabled { opacity: .5; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--line-2); color: var(--text-2); white-space: nowrap; line-height: 1.6; }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.ai { background: var(--ai-soft); color: var(--ai); }
.chip.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.overline { font-size: 11.5px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.src.todo svg { color: var(--todo); } .src.apple svg { color: var(--apple); } .src.tagwerk svg { color: var(--accent); }

/* ---------- Dashboard ---------- */
.hero { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding: 18px 0 26px; }
.hero h1 { margin: 6px 0 6px; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; letter-spacing: -.035em; font-weight: 750; }
.hero p { margin: 0; color: var(--text-2); font-size: 16px; }
.hero .chip { margin-left: auto; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 20px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.allday { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.tl { position: relative; }
.tl::before { content: ""; position: absolute; left: 77px; top: 10px; bottom: 10px; width: 2px; background: var(--line-2); border-radius: 2px; }
.tl-item { position: relative; display: grid; grid-template-columns: 62px 30px minmax(0, 1fr) auto; align-items: start; gap: 0 0; padding: 12px 0; }
.tl-item + .tl-item { border-top: 1px solid var(--line-2); }
.tl-time { text-align: right; padding-right: 2px; line-height: 1.25; }
.tl-time b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.tl-time span { font-size: 12px; color: var(--muted); }
.tl-dot { justify-self: center; margin-top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2.5px solid var(--accent); z-index: 1; }
.tl-item.past { opacity: .5; }
.tl-item.now .tl-dot { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-item.focus .tl-dot { border-color: var(--ai); }
.tl-item.focus.now .tl-dot { background: var(--ai); box-shadow: 0 0 0 5px var(--ai-soft); }
.tl-body { min-width: 0; padding: 0 12px 0 6px; }
.tl-title { font-weight: 620; font-size: 15px; letter-spacing: -.005em; cursor: pointer; }
.tl-title:hover { color: var(--accent); }
.tl-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.tl-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tl-act { display: flex; gap: 8px; align-items: center; padding-top: 1px; }
.focus-box { margin-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px;
  padding: 10px 12px; border-radius: 12px; background: var(--ai-soft); border: 1px solid var(--ai-line); max-width: 560px; }
.focus-box .lbl { font-size: 11.5px; color: var(--ai); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.focus-box .t { font-weight: 600; min-width: 0; grid-column: 1; }
.focus-box .btn { grid-column: 2; grid-row: 1 / 3; }
.tl-item.gap { padding: 8px 0; }
.tl-item.gap .tl-dot { width: 8px; height: 8px; border: 0; background: var(--line); margin-top: 14px; }
.gap-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1.5px dashed var(--line);
  border-radius: 12px; margin-right: 0; grid-column: 3 / 5; }
.gap-box .free { font-size: 12.5px; font-weight: 650; color: var(--ok); white-space: nowrap; }
.gap-box .gap-sug { min-width: 0; flex: 1; font-size: 13.5px; color: var(--text-2); }
.gap-box .gap-sug b { color: var(--text); font-weight: 600; }

.sug-list { display: flex; flex-direction: column; gap: 10px; }
.sug { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 13px;
  background: var(--panel-2); border: 1px solid var(--line-2); }
.sug-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.sug-ic.prep, .sug-ic.focus { background: var(--ai-soft); color: var(--ai); }
.sug-ic.away { background: var(--warn-soft); color: var(--warn); }
.sug-ic.overdue, .sug-ic.full { background: var(--danger-soft); color: var(--danger); }
.sug-ic.slot { background: var(--ok-soft); color: var(--ok); }
.sug h3 { margin: 0 24px 3px 0; font-size: 14px; font-weight: 640; line-height: 1.35; }
.sug p { margin: 0; color: var(--text-2); font-size: 13px; }
.sug-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sug .x { position: absolute; right: 8px; top: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.sug .x:hover { background: var(--line-2); color: var(--text); }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line-2); min-width: 0; }
.row:first-child { border-top: 0; }
.row.click { cursor: pointer; border-radius: 10px; }
.row.click:hover { background: var(--panel-2); }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--line) 40%, var(--muted)); background: none;
  flex: none; cursor: pointer; display: grid; place-items: center; color: transparent; padding: 0; transition: all .15s; }
.check:hover { border-color: var(--ok); color: var(--ok); }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.row .main-t { min-width: 0; flex: 1; }
.row .t { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.done .t { text-decoration: line-through; color: var(--muted); }
.row .sub { display: flex; gap: 10px; align-items: center; margin-top: 1px; }
.due { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; min-width: 60px; text-align: right; }
.due.overdue { color: var(--danger); } .due.today { color: var(--accent); }
.prio { width: 58px; display: flex; justify-content: flex-end; }
.ai-mini { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 5px; border-radius: 8px; display: grid; place-items: center; }
.ai-mini:hover, .ai-mini.ready { color: var(--ai); }
.ai-mini.ready { background: var(--ai-soft); }
.ai-mini.busy svg { animation: pulse 1.4s infinite; color: var(--ai); }

.next-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 4px;
  border-top: 1px solid var(--line-2); cursor: pointer; border-radius: 10px; }
.next-row:first-child { border-top: 0; }
.next-row:hover { background: var(--panel-2); }
.next-row .d { font-size: 12.5px; font-weight: 650; color: var(--text-2); line-height: 1.3; }
.next-row .d span { display: block; color: var(--muted); font-weight: 500; }
.next-row .t { font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-row .l { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.seg { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; margin-left: auto; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: end; height: 150px; padding: 4px 4px 0; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar .v { font-size: 12.5px; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar .b { width: 100%; max-width: 44px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--accent) 22%, var(--panel)); min-height: 4px; transition: height .3s; }
.bar.today .b { background: var(--accent); }
.bar .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.bar.today .lbl { color: var(--accent); }
.legend { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- Seiten ---------- */
.page-h { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 0 22px; }
.page-h h1 { margin: 0; font-size: 30px; letter-spacing: -.03em; font-weight: 740; }
.page-h .r { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.cal { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.cal-head { display: contents; }
.cal-head > div { padding: 12px 8px 10px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 13px; text-align: center; background: var(--panel-2); }
.cal-head > div.today { color: var(--accent); }
.cal-head > div.today span { background: var(--accent); color: #fff; border-radius: 7px; padding: 1px 7px; }
.cal-ad { display: contents; }
.cal-ad > div { border-bottom: 1px solid var(--line); padding: 4px; min-height: 30px; border-left: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; }
.cal-ad .ad { font-size: 11.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ad .ad.holiday { background: var(--line-2); color: var(--muted); }
.cal-hours { position: relative; }
.cal-hours div { height: var(--hh); font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.cal-col { position: relative; border-left: 1px solid var(--line-2);
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px); background-size: 100% var(--hh); }
.cal-col.weekend { background-color: var(--panel-2); }
.cal-ev { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 4px 7px; font-size: 12px; line-height: 1.3; overflow: hidden;
  background: var(--accent-soft); border-left: 3px solid var(--accent); color: var(--accent-ink); cursor: pointer; }
.cal-ev b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.focus { background: var(--ai-soft); border-color: var(--ai); color: var(--ai); }
.cal-ev.ext { background: color-mix(in srgb, var(--warn-soft) 80%, var(--panel)); border-color: var(--warn); color: var(--warn); }
.cal-ev.block { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.cal-ev .p { position: absolute; top: 4px; right: 5px; color: var(--ai); }
.cal-gap { position: absolute; left: 6px; right: 6px; border: 1.5px dashed color-mix(in srgb, var(--ok) 45%, transparent); border-radius: 8px;
  font-size: 11px; color: var(--ok); font-weight: 600; padding: 3px 6px; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.agenda { display: none; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--panel); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.filters button.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.filters button b { font-weight: 650; opacity: .6; }
.quick { display: flex; gap: 8px; align-items: center; padding: 10px; flex-wrap: wrap; }
.quick input[type=text] { flex: 1; min-width: 200px; border: 0; outline: none; background: none; font-size: 15px; padding: 6px 4px; }
.quick input[type=date], .quick select, .field input, .field select, .field textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 7px 10px; outline: none; }
.quick input:focus-visible, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.group h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 24px 4px 8px; font-weight: 650; }
.group h3 .n { background: var(--line-2); border-radius: 999px; padding: 0 8px; letter-spacing: 0; }
.group.hl .card { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.group .card { padding: 6px 14px; }

.ws { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; min-height: calc(100vh - 200px); }
.ws-list { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.ws-item { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; display: block; width: 100%; }
.ws-item:hover { background: var(--panel-2); }
.ws-item.on { background: var(--accent-soft); }
.ws-item b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-item small { color: var(--muted); }
.chat { display: flex; flex-direction: column; min-height: 560px; padding: 0; overflow: hidden; }
.chat-h { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.chat-h h2 { margin: 0; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow: auto; max-height: calc(100vh - 290px); }
.msg { max-width: 760px; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; }
.msg.assistant { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.msg.assistant .av { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--ai-soft); color: var(--ai); }
.md p { margin: 0 0 8px; } .md ul, .md ol { margin: 4px 0 10px; padding-left: 22px; } .md li { margin: 4px 0; }
.md li.todo { list-style: none; margin-left: -20px; display: flex; gap: 8px; }
.md li.todo::before { content: ""; width: 14px; height: 14px; border: 1.75px solid var(--muted); border-radius: 4px; flex: none; margin-top: 4px; }
.md strong { font-weight: 650; }
.take { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 13px; }
.typing { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ai); display: inline-block; animation: pulse 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
.composer { border-top: 1px solid var(--line-2); padding: 12px; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 46px; max-height: 200px; outline: none; background: var(--panel); }
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 16px; }
.starters button { text-align: left; border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.starters button:hover { border-color: var(--ai-line); background: var(--ai-soft); color: var(--text); }
.ws-intro { padding: 36px 32px; }
.ws-intro h2 { margin: 12px 0 6px; font-size: 22px; letter-spacing: -.02em; }

.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.settings .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.sec .hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.field textarea { min-height: 120px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.where { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.where > div { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 13px; padding: 14px; }
.where h4 { margin: 8px 0 4px; font-size: 14px; }
.where p { margin: 0; font-size: 13px; color: var(--text-2); }
.where .flag { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 650; color: var(--ok); }
.opt { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; cursor: pointer; }
.opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.opt.disabled { opacity: .55; cursor: default; }
.opt input { margin-top: 3px; accent-color: var(--accent); }
.opt b { display: block; }
.opt span { font-size: 13px; color: var(--text-2); }
.steps-ol { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--text-2); }
.steps-ol li { margin: 4px 0; }
.code { font: 600 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel-2); border: 1px dashed var(--line); padding: 10px 12px; border-radius: 10px; word-break: break-all; }
.status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13.5px; }

/* ---------- Vorbereitung (Seitenblatt) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(15, 15, 25, .32); display: flex; justify-content: flex-end; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(620px, 100%); height: 100%; background: var(--panel); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .5; } }
.sheet-h { padding: 22px 26px 16px; border-bottom: 1px solid var(--line-2); position: relative; }
.sheet-h h2 { margin: 6px 40px 8px 0; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; }
.sheet-h .close { position: absolute; right: 16px; top: 16px; }
.sheet-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.sheet-meta span { display: inline-flex; gap: 5px; align-items: center; }
.sheet-b { flex: 1; overflow: auto; padding: 18px 26px 26px; }
.sheet-f { padding: 14px 26px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sheet-f .sp { flex: 1; }
.ai-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--ai-soft); color: var(--ai);
  font-size: 12.5px; font-weight: 600; margin-bottom: 18px; border: 1px solid var(--ai-line); }
.ai-bar .sp { flex: 1; }
.ai-bar .btn { font-size: 12px; padding: 4px 10px; }
.sec { margin: 0 0 20px; }
.sec h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 650;
  display: flex; align-items: center; gap: 6px; }
.kurz { font-size: 15.5px; line-height: 1.55; padding: 14px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); }
.first { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--ok-soft); color: var(--text); }
.first svg { color: var(--ok); margin-top: 2px; }
.bul { margin: 0; padding-left: 18px; } .bul li { margin: 5px 0; }
.num { margin: 0; padding: 0; list-style: none; counter-reset: n; }
.num li { counter-increment: n; display: flex; gap: 10px; margin: 8px 0; }
.num li::before { content: counter(n); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.cl label { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.cl input { width: 18px; height: 18px; accent-color: var(--ok); margin-top: 2px; flex: none; }
.cl input:checked + span { text-decoration: line-through; color: var(--muted); }
.warnbox { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; }
.warnbox li { margin: 3px 0; }
.people { display: flex; flex-direction: column; gap: 6px; }
.person { display: flex; gap: 10px; align-items: center; }
.person .pa { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--line-2); color: var(--text-2); flex: none; }
.person small { color: var(--muted); display: block; font-size: 12px; }
.slotbox { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; border: 1.5px dashed var(--line); }
.slotbox div { flex: 1; min-width: 180px; font-size: 13.5px; }
.draft { white-space: pre-wrap; padding: 14px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 14px; }
details.orig summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
details.orig p { white-space: pre-wrap; font-size: 13px; color: var(--text-2); background: var(--panel-2); padding: 10px 12px; border-radius: 10px; }
.notes { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; outline: none; background: var(--panel); }
.notes:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wait { text-align: center; padding: 34px 20px; border: 1.5px dashed var(--ai-line); border-radius: 14px; color: var(--text-2); }
.wait .big { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--ai-soft); color: var(--ai); }
.wait.run .big svg { animation: pulse 1.2s infinite; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--panel); padding: 10px 16px; border-radius: 12px;
  font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-lg); z-index: 80; display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: var(--accent-2); font-weight: 700; cursor: pointer; padding: 0; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; }
.menu button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--line-2); }

/* ---------- Anmeldung ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(380px, 100%); padding: 32px; }
.login h1 { margin: 18px 0 4px; font-size: 24px; letter-spacing: -.02em; }
.login p { margin: 0 0 20px; color: var(--muted); }
.login input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 12px; background: var(--panel); outline: none; }
.login input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login .btn { width: 100%; padding: 11px; white-space: normal; text-align: center; }
.login .err { color: var(--danger); font-size: 13px; margin: -4px 0 10px; }
.login .warnbox { margin: 0 0 14px; }
.setup-steps { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 12px; color: var(--text-2); font-size: 14px; }
.setup-steps li::marker { color: var(--accent); font-weight: 700; }
.setup-code { margin: 8px 0; font-size: 22px; letter-spacing: .16em; text-align: center; word-break: normal; }
.login .setup-steps .btn { width: auto; padding: 7px 12px; font-size: 13px; }
.setup-wait { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.setup-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13px; padding: 0; cursor: pointer; }
.setup-hint { font-size: 12.5px; color: var(--muted); margin: -4px 0 14px; }

/* ---------- Breiten ---------- */
@media (max-width: 1240px) { .dash { grid-template-columns: minmax(0, 1fr) 330px; } }
@media (max-width: 1080px) {
  :root { --side: 76px; }
  .brand span, .nav a span, .nav a .count, .conn { display: none; }
  .brand { justify-content: center; padding-inline: 0; }
  .nav a { justify-content: center; }
  .dash { display: flex; flex-direction: column; align-items: stretch; }
  .dash > .col { display: contents; }
  .c-today { order: 1; } .c-sug { order: 2; } .c-tasks { order: 3; } .c-next { order: 4; } .c-week { order: 5; }
  .settings { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { display: none; }
  .top { padding: 10px 16px; gap: 10px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .clock { display: none; }
  .search kbd { display: none; }
  .view { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  .hero { padding: 10px 0 18px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .hero .chip { margin-left: 0; }
  .card { padding: 16px; border-radius: 14px; }
  .tl::before { left: 58px; }
  .tl-item { grid-template-columns: 46px 24px minmax(0, 1fr); }
  .tl-time b { font-size: 14px; }
  .tl-act { grid-column: 3; padding: 8px 0 0 6px; }
  .focus-box { grid-template-columns: minmax(0, 1fr); }
  .focus-box .btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; }
  .gap-box { grid-column: 3; flex-direction: column; align-items: flex-start; gap: 6px; }
  .gap-box .gap-sug { flex: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 4px 0; }
  .tabbar a.on { color: var(--accent); }
  .cal, .cal-legend { display: none; }
  .agenda { display: flex; flex-direction: column; gap: 14px; }
  .ws { grid-template-columns: 1fr; }
  .ws-list-card.has-open { display: none; }
  .msgs { max-height: none; }
  .settings { grid-template-columns: 1fr; }
  .where { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .sheet { width: 100%; }
  .sheet-wrap { align-items: flex-end; }
  .sheet { height: 94%; border-radius: 18px 18px 0 0; }
  .sheet-h, .sheet-b, .sheet-f { padding-left: 18px; padding-right: 18px; }
  .sheet-f { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .prio { display: none; }
  .page-h h1 { font-size: 26px; }
}

/* ---------- Weitere Microsoft-Konten ---------- */
.acct { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }
.sub-h { margin: 22px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.acc-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.acc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.acc-t small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.acc-t .err-t { color: var(--danger); }
.acc-add { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.acc-add > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.acc-add > summary::-webkit-details-marker { display: none; }
.acc-add form { margin-top: 12px; }
.acc-add .adv { margin: -4px 0 12px; font-size: 13px; }
.acc-add .adv > summary { cursor: pointer; color: var(--text-2); }
.acc-add .adv .field { margin-top: 10px; }
.acc-add .hint { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }

/* ---------- Aufgabe bearbeiten ---------- */
.edit-form .grid2 { gap: 0 16px; }
.edit-form textarea { min-height: 140px; }
.sync-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: var(--accent-soft); color: var(--accent-ink); }
.sync-note svg { flex: none; margin-top: 2px; }

/* ---------- Hinweis nach einem Update ---------- */
.update-bar { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 85;
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; border-radius: 12px; background: var(--text); color: var(--panel);
  font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
.update-bar span { display: inline-flex; align-items: center; gap: 8px; }
.update-bar button { border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 700; border-radius: 8px; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
@media (max-width: 760px) { .update-bar { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px;
  transform: none; max-width: none; justify-content: space-between; } }

/* Dateien zu Aufgaben */
.files-n { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.files-sec h4 { display: flex; align-items: center; gap: 8px; }
.files-sec h4 .btn { text-transform: none; letter-spacing: 0; cursor: pointer; }
.files { display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); }
.file-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.file-open:hover b { text-decoration: underline; }
.file .thumb, .file .ft { width: 40px; height: 40px; border-radius: 8px; flex: none; }
.file .thumb { object-fit: cover; background: var(--panel-2); }
.file .ft { display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.file .ft.pdf { background: var(--danger-soft); color: var(--danger); }
.file .ft.excel { background: var(--ok-soft); color: var(--ok); }
.file .ft.word { background: var(--accent-soft); color: var(--accent-ink); }
.file .ft.folie, .file .ft.mail { background: var(--warn-soft); color: var(--warn); }
.file .fn { display: flex; flex-direction: column; min-width: 0; }
.file .fn b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fn small { color: var(--muted); font-size: 12.5px; }
.file.busy { opacity: .75; }
.file.busy .ft svg { animation: spin 1.2s linear infinite; }
.drop { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1.5px dashed var(--line-2); border-radius: 12px; color: var(--muted); font-size: 13.5px; }
.sheet.dragging { outline: 2px dashed var(--accent); outline-offset: -8px; }
.sheet.dragging .drop { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.file .fmarks { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ki-tog, .todo-ok, .todo-err { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line-2); background: transparent; color: var(--muted); }
.ki-tog { cursor: pointer; }
.ki-tog:hover { border-color: var(--ai); color: var(--ai); }
.ki-tog.on { background: var(--ai-soft); color: var(--ai); border-color: transparent; }
.todo-ok { border-color: transparent; color: var(--accent-ink); background: var(--accent-soft); }
.todo-err { cursor: pointer; border-color: transparent; color: var(--warn); background: var(--warn-soft); }
@media (max-width: 760px) {
  .file { flex-wrap: wrap; }
  .file .fmarks { order: 3; width: 100%; justify-content: flex-start; padding-left: 50px; }
}
