:root {
  --brand: #1f5f4a; --brand-2: #2e7d63; --bg: #f5f6f4; --card: #fff;
  --text: #1d2321; --muted: #6b7470; --line: #e3e6e3;
  --yellow: #e8b100; --yellow-bg: #fff8dc; --red: #c8352b; --red-bg: #fdecea;
  --school: #2f9e57; --vacation: #2f6fd1; --off: #e07b1a; --other: #d24f9c;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 860px; margin: 0 auto; padding: 16px; }

.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 16px; background: var(--brand); color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; }
.userbox { justify-self: end; display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.userbox .who { opacity: .85; }
button.link { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; }

.mainnav { display: flex; gap: 4px; overflow-x: auto; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); }
.mainnav a, .mainnav .soon { padding: 12px 12px; white-space: nowrap; text-decoration: none; color: var(--text); border-bottom: 3px solid transparent; }
.mainnav a.active { border-color: var(--brand); font-weight: 600; }
.mainnav .soon { color: #b5bbb8; cursor: default; }

h1 { margin: 0; font-size: 1.5rem; }
.pagehead { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 12px; flex-wrap: wrap; gap: 6px; }
.date { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.flash { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); padding: 10px 12px; border-radius: var(--radius); margin-bottom: 12px; }
.muted, .empty { color: var(--muted); }
.empty { text-align: center; padding: 32px 0; }

label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .9rem; }
input, select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: 4px; }
.login { max-width: 380px; margin: 40px auto; }
.login h1 { margin-bottom: 16px; }

.btn { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 14px; cursor: pointer; min-height: 42px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; width: auto; }
.btn.ghost { color: var(--muted); }
.btn.done { background: var(--brand-2); border-color: var(--brand-2); color: #fff; font-weight: 700; min-width: 48px; }
.btn:hover { filter: brightness(.95); }

.presence { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.presence .label { display: inline-block; min-width: 80px; color: var(--muted); font-size: .85rem; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; margin: 2px 4px 2px 0; font-size: .85rem; background: #fff; border: 1px solid var(--line); }
.chip.school { background: var(--school); color: #fff; border: 0; }
.chip.vacation { background: var(--vacation); color: #fff; border: 0; }
.chip.off { background: var(--off); color: #fff; border: 0; }
.chip.sick, .chip.other { background: var(--other); color: #fff; border: 0; }

.add summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.add form { margin-top: 10px; }
.add .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.add .row select { flex: 1 1 140px; margin-top: 0; }

.summary { margin: 4px 0 10px; color: var(--muted); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .8rem; font-weight: 600; margin-left: 6px; }
.pill.red { background: var(--red); color: #fff; }
.pill.yellow { background: var(--yellow); color: #3a2c00; }

.task { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.task.yellow { border-left-color: var(--yellow); background: var(--yellow-bg); }
.task.red { border-left-color: var(--red); background: var(--red-bg); }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 600; }
.task .meta { color: var(--muted); font-size: .85rem; }
.task .actions { display: flex; gap: 6px; }
.prio { color: var(--red); font-weight: 800; margin-right: 6px; }

.htmx-request.task, .htmx-request .task { opacity: .6; }

@media (min-width: 1200px) {           /* Morgengespräch auf grossem Bildschirm */
  main { max-width: 1100px; }
  body { font-size: 18px; }
}
