:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #2357d9; --danger: #c0352b; --ok: #1f8a4c; --warn: #b7791f;
  --chat: #7c3aed; --code: #0f766e; --webhook: #92400e;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { background: #1d2330; color: #fff; padding: 0 16px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
header.top a { color: #d6dbe6; padding: 12px 0; display: inline-block; }
header.top a.active, header.top a:hover { color: #fff; text-decoration: none; }
header.top .brand { font-weight: 600; color: #fff; margin-right: 8px; }
header.top .spacer { flex: 1; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
.sub { color: var(--muted); margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; min-width: 0; }
.panel > h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .85rem; }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.overdue { color: var(--danger); font-weight: 600; }
.today { color: var(--warn); font-weight: 600; }
.done { color: var(--muted); text-decoration: line-through; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 6px; border-radius: 9px; color: #fff; vertical-align: 1px; margin-left: 4px; }
.badge-chat { background: var(--chat); }
.badge-code { background: var(--code); }
.badge-webhook { background: var(--webhook); }
.badge-web { background: #64748b; }
.status { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 9px; background: #e8edf7; }
.status-aktiv { background: #dcf3e5; }
.status-beendet { background: #eee; color: var(--muted); }
.status-pausiert { background: #fdf0d5; }
.highlights { margin-bottom: 16px; }
.highlight { background: #fff7e0; border: 1px solid #f1d58a; border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; display: flex; gap: 10px; align-items: flex-start; }
.highlight.seen { background: #f4f4f4; border-color: var(--line); color: var(--muted); }
.highlight .text { flex: 1; white-space: pre-line; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash-error { background: #fdecea; border: 1px solid #f3b8b2; }
.flash-success { background: #e6f6ec; border: 1px solid #a8dcbc; }
#messages:not(:empty) { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: #fdecea; border: 1px solid #f3b8b2; }
form.inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
form.inline input[type=text], form.inline input:not([type]), form.inline select { flex: 1 1 140px; min-width: 0; }
form.stack label { display: block; margin-bottom: 8px; }
form.stack label span { display: block; font-size: .85rem; color: var(--muted); }
input, select, textarea, button { font: inherit; }
input, select, textarea { padding: 5px 8px; border: 1px solid #cdd2da; border-radius: 6px; background: #fff; width: 100%; }
input[type=checkbox] { width: auto; }
form.inline input, form.inline select { width: auto; }
textarea { min-height: 70px; }
button, .button { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }
button.danger { background: #fff; color: var(--danger); border-color: #e7b1ab; }
button.quiet { background: #fff; color: var(--text); border-color: #cdd2da; }
button.x { background: none; border: 0; color: var(--muted); padding: 0 4px; font-size: 1rem; line-height: 1; }
button.x:hover { color: var(--danger); }
.check { cursor: pointer; background: none; border: 1.5px solid #9aa3b2; width: 18px; height: 18px; border-radius: 4px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--ok); font-size: 13px; }
.dropzone { border: 2px dashed #b9c1ce; border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); margin-top: 10px; }
.dropzone.over { border-color: var(--accent); background: #eef3ff; }
.note { border-bottom: 1px solid var(--line); padding: 8px 0; }
.note:last-child { border-bottom: 0; }
.note .body { white-space: pre-line; }
.note.zusammenfassung { border-left: 3px solid var(--code); padding-left: 10px; }
details summary { cursor: pointer; color: var(--accent); margin-top: 8px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
pre { background: #f1f3f6; padding: 10px; border-radius: 6px; white-space: pre-wrap; word-break: break-all; }
.token { background: #e6f6ec; border: 1px solid #a8dcbc; padding: 12px; border-radius: 8px; margin-bottom: 16px; }
.login { max-width: 360px; margin: 10vh auto; }
.diff { font-size: .8rem; color: var(--muted); }
.diff del { color: var(--danger); }
.diff ins { color: var(--ok); text-decoration: none; }
.undone { opacity: .5; }
.pager { display: flex; gap: 12px; margin-top: 10px; }
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
}
