:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6ea;
  --accent: #1f4e79; --accent-soft: #e8f0f8;
  --g: #2e9e5b; --y: #e3a008; --r: #d1453b; --none: #cfd4da;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .error { color: var(--r); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.link { background: none; border: 0; color: var(--accent); padding: 0 4px; }
.link.danger { color: var(--r); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 340px; display: grid; gap: 12px; }
.login-card label { display: grid; gap: 4px; font-size: .9rem; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--accent); color: #fff; }
.topbar .muted { color: #c9d6e3; }
.brand { font-weight: 600; }
.tabs { display: flex; gap: 4px; }
.tab { background: transparent; color: #dce6f0; border: 0; padding: 6px 12px; border-radius: 6px; }
.tab.active { background: rgba(255,255,255,.16); color: #fff; }
.who { margin-left: auto; font-size: .9rem; } .who .link { color: #fff; text-decoration: underline; }

main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.card.empty { text-align: center; padding: 40px; }
.card.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar .spacer { flex: 1; }
.check { display: flex; align-items: center; gap: 6px; font-size: .9rem; }

.meeting-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.meeting-head h1 input { font-size: 1.1rem; font-weight: 600; }
.legend { display: grid; gap: 2px; font-size: .8rem; color: var(--muted); }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; margin-right: 6px; }
.count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; text-align: center; }

.dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; background: var(--none); }
.dot.sm { width: 12px; height: 12px; }
.dot.G { background: var(--g); } .dot.Y { background: var(--y); } .dot.R { background: var(--r); }
.dot.none { background: transparent; border: 1.5px dashed var(--none); }

.areas { display: grid; gap: 10px; margin-top: 8px; }
.area { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.area.focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.area.diff { border-left: 4px solid var(--y); }
.area-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; }
.area-head h3 { margin: 0; }
.num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: #eef0f3; font-size: .75rem; margin-right: 4px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 10px; background: var(--accent); color: #fff; }
.badge.warn { background: #fff4d6; color: #8a5a00; } .badge.quiet { background: #eef0f3; color: var(--muted); }
.questions { margin: 4px 0 8px; font-size: .85rem; color: var(--muted); }
.questions summary { cursor: pointer; }
.questions ul { margin: 4px 0 0; padding-left: 18px; }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.col-label { font-size: .8rem; font-weight: 600; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.prev { font-weight: 400; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.ampel-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.amp { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; opacity: .25; }
.amp.G { background: var(--g); } .amp.Y { background: var(--y); } .amp.R { background: var(--r); }
.amp.on { opacity: 1; border-color: var(--text); }
.amp:hover:not(:disabled) { opacity: .7; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.trend { width: 30px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.trend.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.need { font-size: .85rem; padding: 4px 6px; }
.theirs { background: #fafbfc; border-radius: 6px; padding: 6px 10px; }
.readonly { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.need-ro { font-size: .8rem; background: #fff4d6; color: #8a5a00; padding: 1px 8px; border-radius: 10px; }
.note-ro { margin: 0; font-size: .9rem; white-space: normal; }
.note-ro.box { border: 1px solid var(--line); border-radius: 6px; padding: 8px; min-height: 90px; background: #fafbfc; }

.tasks, .decisions { list-style: none; margin: 0 0 8px; padding: 0; }
.task, .decisions li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.task-text { flex: 1; min-width: 200px; }
.task-meta { font-size: .8rem; color: var(--muted); }
.task.done .task-text { text-decoration: line-through; color: var(--muted); }
.task.overdue .task-meta { color: var(--r); font-weight: 600; }
.owner { font-weight: 600; }
.tag { display: inline-block; font-size: .72rem; padding: 0 6px; margin-right: 4px; border-radius: 4px; background: #eef0f3; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-form input[name=text] { flex: 1; min-width: 220px; }

.actions { display: flex; justify-content: space-between; align-items: center; }

.hist-wrap { overflow-x: auto; }
.hist { border-collapse: collapse; font-size: .82rem; }
.hist th, .hist td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.hist .rowh { text-align: left; white-space: nowrap; font-weight: 500; }
.hist .pair { display: grid; gap: 2px; justify-items: center; }
.hist .fcell { background: var(--accent-soft); }
.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
.list th, .list td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }

.toast { position: fixed; bottom: 16px; right: 16px; background: var(--text); color: #fff; padding: 8px 14px; border-radius: 6px; font-size: .9rem; }
.toast.err { background: var(--r); }

/* Formatierter Text */
.md ul, .md ol { margin: 2px 0; padding-left: 20px; }
.md .gap { height: .5em; }
.dec-text { flex: 1; }
.fmt-view { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-height: 2.4em; cursor: text; background: #fff; }
.fmt-view:hover { border-color: var(--accent); }
.fmt-view:focus { outline: 2px solid var(--accent-soft); }
textarea.fmt { overflow: hidden; }
.fmt-hint { margin: 2px 0 0; font-size: .72rem; color: var(--muted); }

@media (max-width: 760px) {
  .cols, .card.two { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  main { padding: 12px; }
}
@media print {
  .topbar, .toolbar, .inline-form, .actions, .link, .toast { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .card { border: 0; padding: 6px 0; break-inside: avoid; }
  .area { break-inside: avoid; }
  .amp:not(.on), .trend:not(.on) { display: none; }
  .amp.on { opacity: 1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  textarea { border: 0; resize: none; }
  .fmt-hint { display: none; }
}
