/* vibeboard – Stylesheet */
:root {
  --accent: #4262ff;
  --accent-soft: rgba(66, 98, 255, 0.12);
  --danger: #e03131;
  --canvas: #f5f6f8;
  --grid: #c9ccd3;
  --panel: #ffffff;
  --panel-2: #f3f4f6;
  --border: #e3e5e8;
  --text: #1f2328;
  --muted: #6b7280;
  --shadow: 0 2px 6px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color-scheme: light;
}

body.dark {
  --canvas: #1e1f24;
  --grid: #3b3d45;
  --panel: #2a2b31;
  --panel-2: #33353c;
  --border: #3d3f47;
  --text: #ececf1;
  --muted: #9ca3af;
  --accent-soft: rgba(110, 135, 255, 0.2);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--canvas);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }
.pad { padding: 0 16px; }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
kbd {
  display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border);
  border-bottom-width: 2px; background: var(--panel-2); font-size: 12px; font-family: inherit; white-space: nowrap;
}

/* ---------------- Grundbausteine ---------------- */

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); flex-shrink: 0; position: relative;
  text-decoration: none;
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.small svg { width: 16px; height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger.primary, .btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn span[html], .btn > span { display: inline-flex; }

.row { display: flex; gap: 6px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--panel);
  color: #fff; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
.avatar.xs { width: 22px; height: 22px; font-size: 9px; border-width: 1px; }
.avatar.more { background: var(--panel-2); color: var(--text); }
.avatar.following { box-shadow: 0 0 0 2px var(--accent); }

.badge { background: var(--panel-2); color: var(--muted); border-radius: 20px; padding: 3px 10px; font-size: 12px; white-space: nowrap; }

/* ---------------- Toast ---------------- */

#toast {
  position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px);
  background: #1f2328; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 1000; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- Modal ---------------- */

.modal-back {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade 0.15s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); width: 440px; max-width: 100%;
  max-height: calc(100vh - 32px); display: flex; flex-direction: column;
}
.modal.wide { width: 1100px; height: min(780px, calc(100vh - 32px)); }
.modal-head { display: flex; align-items: center; padding: 14px 16px 6px 22px; }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1; }
.modal-body { padding: 8px 22px 22px; overflow: auto; flex: 1; min-height: 0; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form p { margin: 0; line-height: 1.5; }
.form label, .label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.form input[type=text], .form input[type=number], .form input[type=date], .form textarea, .form select {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; background: var(--panel); font-weight: 400;
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }
.hint { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.form label.check { flex-direction: row; font-weight: 400; gap: 8px; }
.form label.check input { margin: 0; }

/* ---------------- Popover & Menü ---------------- */

.popover { position: fixed; z-index: 400; padding: 10px; animation: fade 0.1s; max-width: 340px; }
.pop-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.menu { display: flex; flex-direction: column; min-width: 220px; margin: -4px; max-height: calc(100vh - 120px); overflow-y: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left;
  padding: 7px 10px; border-radius: 6px; font-size: 14px; white-space: nowrap;
}
.menu-item:hover:not(:disabled) { background: var(--panel-2); }
.menu-item:disabled { opacity: 0.4; cursor: default; }
.menu-item.danger { color: var(--danger); }
.mi-icon { width: 18px; height: 18px; display: inline-flex; color: var(--muted); }
.mi-icon svg { width: 18px; height: 18px; }
.menu-item.checked .mi-icon { color: var(--accent); }
.mi-label { flex: 1; }
.mi-hint { color: var(--muted); font-size: 12px; margin-left: 16px; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.menu-header { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 8px 10px 4px; font-weight: 700; }
.context-menu { padding: 6px; }

.swatches { display: grid; grid-template-columns: repeat(6, 28px); gap: 6px; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.12); padding: 0;
  box-shadow: inset 0 0 0 2px var(--panel);
}
.swatch.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.swatch.transparent, .color-dot.transparent {
  background: linear-gradient(135deg, transparent 45%, #e03131 45%, #e03131 55%, transparent 55%), var(--panel) !important;
}
.custom-color { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.custom-color input { width: 36px; height: 24px; padding: 0; border: 0; background: none; }

.shape-grid { display: grid; grid-template-columns: repeat(4, 48px); gap: 4px; }
.shape-pop { max-height: min(70vh, 560px); overflow-y: auto; }
.shape-pop .shape-grid { grid-template-columns: repeat(6, 44px); margin-bottom: 8px; }
.shape-pop .shape-btn { width: 44px; }
.lang-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 320px; }
.shape-btn { width: 48px; height: 40px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center; }
.shape-btn:hover { background: var(--panel-2); }
.shape-btn .pv-fill { fill: var(--panel); }
.shape-btn:hover .pv-fill { fill: var(--panel-2); }
.shape-btn.active .pv-fill { fill: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.shape-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; }
.emoji-btn { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 6px; font-size: 20px; padding: 0; }
.emoji-btn:hover, .emoji-btn.active { background: var(--panel-2); }
.react-row { display: flex; gap: 2px; }
.width-btn { width: 34px; height: 34px; border-radius: 6px; border: 1px solid transparent; background: transparent; display: flex; align-items: center; justify-content: center; }
.width-btn span { background: var(--text); border-radius: 50%; display: block; }
.width-btn.active { border-color: var(--accent); }

/* ================================================================== */
/* Board                                                               */
/* ================================================================== */

body.board-page { overflow: hidden; position: fixed; inset: 0; overscroll-behavior: none; }

#stage {
  position: fixed; inset: 0; overflow: hidden; touch-action: none;
  background-color: var(--canvas);
  background-image: radial-gradient(circle, var(--grid) 1.1px, transparent 1.3px);
  user-select: none; -webkit-user-select: none;
}
#stage.nogrid { background-image: none; }
#stage.dropping { outline: 4px dashed var(--accent); outline-offset: -8px; }
#svg { width: 100%; height: 100%; display: block; }
#laser { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

#layer-overlay *, #layer-votes, #layer-draft, #layer-draft * { pointer-events: none; }
#layer-overlay [data-handle], #layer-overlay [data-handle] *, #layer-overlay [data-qc], #layer-overlay [data-qc] * { pointer-events: all; }
#layer-overlay .wp-add, #layer-overlay .wp { cursor: move; }
#layer-overlay [data-qc] { cursor: crosshair; }
#layer-overlay .qc:hover circle:first-child { fill-opacity: 0.3; }
[data-handle=nw], [data-handle=se] { cursor: nwse-resize; }
[data-handle=ne], [data-handle=sw] { cursor: nesw-resize; }
[data-handle=n], [data-handle=s] { cursor: ns-resize; }
[data-handle=e], [data-handle=w] { cursor: ew-resize; }
[data-handle=from], [data-handle=to] { cursor: move; }

#world .el { cursor: default; }
#world .el-frame .frame-title, #world .el-frame .frame-title-text { cursor: move; }
#world .el-frame .frame-title-text { pointer-events: none; }
#world .el-comment { cursor: pointer; }
#world .link-badge { cursor: pointer !important; }
#world .link-badge:hover circle { fill: #2f4bdb; }
#world g.editing text.t, #world g.editing text.code-text { opacity: 0; }
#world text { white-space: pre; }

#stage[data-tool=hand], #stage.space, #stage.space #world .el { cursor: grab; }
#stage.panning, #stage.panning #world .el { cursor: grabbing !important; }
#stage[data-tool=sticky], #stage[data-tool=shape], #stage[data-tool=frame], #stage[data-tool=card], #stage[data-tool=table],
#stage[data-tool=connector], #stage[data-tool=pen], #stage[data-tool=highlighter], #stage[data-tool=mindmap], #stage[data-tool=emoji],
#stage[data-tool=sticky] #world .el, #stage[data-tool=shape] #world .el, #stage[data-tool=pen] #world .el, #stage[data-tool=highlighter] #world .el,
#stage[data-tool=frame] #world .el { cursor: crosshair; }
#stage[data-tool=text], #stage[data-tool=text] #world .el { cursor: text; }
#stage[data-tool=comment], #stage[data-tool=comment] #world .el { cursor: copy; }
#stage[data-tool=eraser], #stage[data-tool=eraser] #world .el { cursor: cell; }
#stage[data-tool=laser], #stage[data-tool=laser] #world .el { cursor: none; }
#stage.voting #world .el-sticky, #stage.voting #world .el-shape, #stage.voting #world .el-card,
#stage.voting #world .el-image, #stage.voting #world .el-text, #stage.voting #world .el-emoji { cursor: pointer; }
#stage.voting #world .el-sticky:hover, #stage.voting #world .el-shape:hover, #stage.voting #world .el-card:hover { filter: brightness(0.95); }

#editor {
  position: absolute; display: none; border: 0; outline: none; resize: none; overflow: hidden; margin: 0;
  padding: 0; background: transparent; font-family: var(--font); white-space: pre-wrap; overflow-wrap: break-word;
  caret-color: var(--accent); z-index: 5; user-select: text; -webkit-user-select: text;
}

/* Cursor anderer Teilnehmender */
#cursors { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.peer-cursor { position: absolute; left: 0; top: 0; transition: transform 0.08s linear, opacity 0.5s; will-change: transform; }
.peer-cursor.idle { opacity: 0.35; }
.peer-cursor.away, #cursors.off .peer-cursor { display: none; }
.peer-arrow { display: inline-block; transition: transform 0.2s; }
.peer-cursor.offscreen { pointer-events: auto; cursor: pointer; transition: none; }
.peer-cursor.offscreen .peer-name { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.peer-chat {
  position: absolute; left: 14px; top: 38px; color: #fff; font-size: 13px; line-height: 1.35; padding: 6px 11px;
  border-radius: 4px 14px 14px 14px; max-width: 260px; width: max-content; white-space: normal; overflow-wrap: anywhere;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.cursor-chat-input { position: fixed; z-index: 90; padding: 4px; border-radius: 4px 16px 16px 16px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
.cursor-chat-input input { border: 0; border-radius: 3px 12px 12px 12px; padding: 7px 11px; width: 230px; font: inherit; font-size: 14px; outline: none; }
.avatar.away { opacity: 0.45; filter: grayscale(0.6); }
.peer-name {
  position: absolute; left: 14px; top: 16px; color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px;
  border-radius: 10px; white-space: nowrap;
}

/* Kopfzeile */
#topbar {
  position: fixed; top: 12px; left: 12px; height: 48px; display: flex; align-items: center; gap: 4px;
  padding: 0 6px; z-index: 50; max-width: calc(100vw - 24px);
}
#topbar .brand { width: 40px; }
#board-name {
  border: 1px solid transparent; background: transparent; font-weight: 600; font-size: 15px; padding: 6px 8px;
  border-radius: 6px; width: 220px; min-width: 80px; text-overflow: ellipsis;
}
#board-name:hover:not([readonly]) { border-color: var(--border); }
#board-name:focus { outline: 2px solid var(--accent); }
#conn-status { width: 8px; height: 8px; border-radius: 50%; background: #f59f00; flex-shrink: 0; margin: 0 6px 0 2px; }
#conn-status.ok { background: #2f9e44; }
.top-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

#topright {
  position: fixed; top: 12px; right: 12px; height: 48px; display: flex; align-items: center; gap: 6px;
  padding: 0 8px; z-index: 50;
}
#avatars { display: flex; align-items: center; }
#avatars .avatar { margin-left: -6px; }
#avatars .avatar:first-child { margin-left: 0; }
#avatars .icon-btn { margin-left: 4px; }
.collab-tools { display: flex; align-items: center; gap: 2px; padding-right: 6px; border-right: 1px solid var(--border); }
.share-btn { margin-left: 6px; }

/* Werkzeugleiste */
#tools {
  position: fixed; left: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;
  gap: 2px; padding: 6px; z-index: 50; max-height: calc(100vh - 150px); overflow-y: auto; scrollbar-width: none;
}
#tools .icon-btn { width: 40px; height: 40px; }
#tools .icon-btn::after {
  content: ''; position: absolute; right: 5px; bottom: 5px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--tool-accent, transparent); border: 1px solid rgba(0, 0, 0, 0.15);
}
#tools .icon-btn:not([style*='--tool-accent'])::after { display: none; }
.tool-sep { height: 1px; background: var(--border); margin: 4px 6px; }

/* Kontextleiste */
#ctxbar {
  position: fixed; z-index: 60; display: flex; align-items: center; gap: 2px; padding: 4px; height: 44px;
  white-space: nowrap;
}
.ctx-btn {
  height: 34px; min-width: 34px; border: 0; background: transparent; border-radius: 6px; display: inline-flex;
  align-items: center; justify-content: center; gap: 2px; padding: 0 6px; color: var(--text); font-size: 13px;
}
.ctx-btn:hover { background: var(--panel-2); }
.ctx-btn.active { background: var(--accent-soft); color: var(--accent); }
.ctx-btn svg { width: 18px; height: 18px; }
.ctx-btn .caret svg { width: 12px; height: 12px; opacity: 0.6; }
.ctx-sep { width: 1px; height: 22px; background: var(--border); margin: 0 3px; }
.color-dot { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.18); display: block; }
.color-dot.ring { background: transparent !important; border-width: 4px; }

/* Unten */
#bottom-left { position: fixed; left: 12px; bottom: 12px; display: flex; align-items: center; padding: 4px; z-index: 50; }
#bottom-right { position: fixed; right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 50; }
#minimap { width: 220px; height: 140px; overflow: hidden; padding: 0; }
#minimap canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
#zoomctl { display: flex; align-items: center; padding: 4px; }
.zoom-pct { border: 0; background: transparent; width: 64px; height: 36px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.zoom-pct:hover { background: var(--panel-2); }

/* Seitenpanel */
#sidepanel {
  position: fixed; right: 12px; top: 72px; bottom: 210px; width: 320px; z-index: 55; overflow-y: auto;
  padding-bottom: 12px;
}
.side-head { display: flex; align-items: center; padding: 10px 8px 6px 16px; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.side-head h3 { margin: 0; font-size: 15px; }
.side-actions { display: flex; gap: 8px; padding: 6px 16px 10px; flex-wrap: wrap; }
#sidepanel .seg { flex-wrap: wrap; max-width: 100%; }
#sidepanel .seg .btn { padding: 0 8px; }
.frame-list { display: flex; flex-direction: column; gap: 4px; padding: 0 8px; }
.frame-item { display: grid; grid-template-columns: 22px 72px 1fr auto; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; }
.frame-item:hover { background: var(--panel-2); }
.frame-item.active { background: var(--accent-soft); }
.frame-no { color: var(--muted); font-size: 12px; text-align: center; }
.frame-thumb { width: 72px; height: 44px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }
.frame-thumb svg { width: 100%; height: 100%; display: block; }
.frame-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.frame-ord { display: flex; flex-direction: column; }
.frame-ord .icon-btn { width: 22px; height: 18px; }
.frame-ord svg { width: 14px; height: 14px; }

.comment-card { margin: 6px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.comment-card:hover { border-color: var(--accent); }
.comment-card.resolved { opacity: 0.6; }

.vote-row { display: grid; grid-template-columns: 20px 14px 1fr 70px 26px; gap: 8px; align-items: center; padding: 8px 16px; cursor: pointer; }
.vote-row:hover { background: var(--panel-2); }
.vote-rank { color: var(--muted); font-size: 12px; }
.vote-swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.1); }
.vote-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-bar { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.vote-bar span { display: block; height: 100%; background: #e8590c; border-radius: 4px; }
.vote-n { text-align: right; }

/* Kommentar-Popover */
.comment-pop { position: fixed; z-index: 120; width: 320px; display: flex; flex-direction: column; max-height: 420px; }
.comment-head { display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--border); }
.comment-list { overflow-y: auto; padding: 4px 14px; display: flex; flex-direction: column; gap: 12px; }
.comment-list:empty { display: none; }
.comment-msg { padding: 8px 0; }
.comment-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.comment-meta .muted { font-size: 12px; }
.comment-text { margin-top: 4px; white-space: pre-wrap; line-height: 1.45; overflow-wrap: anywhere; }
.mention { color: var(--accent); font-weight: 600; }
.comment-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.comment-input textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--panel); min-height: 38px; }

/* Timer, Abstimmung, Folgen, Suche, Präsentation */
#timer-widget {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center;
  gap: 4px; padding: 4px 6px 4px 12px; height: 44px;
}
.timer-icon { display: inline-flex; color: var(--accent); }
.timer-time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 72px; text-align: center; }
#timer-widget.warn .timer-time { color: #f08c00; }
#timer-widget.done { animation: pulse 0.8s infinite alternate; }
#timer-widget.done .timer-time { color: var(--danger); }
@keyframes pulse { to { box-shadow: 0 0 0 6px rgba(224, 49, 49, 0.35); } }

#voting-banner {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center;
  gap: 10px; padding: 8px 10px 8px 14px; border: 2px solid var(--accent); max-width: calc(100vw - 24px);
}
#voting-banner svg { color: var(--accent); }

#follow-banner {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--c); color: #fff;
  padding: 4px 6px 4px 14px; border-radius: 0 0 10px 10px; display: flex; align-items: center; gap: 10px; font-weight: 600;
}
#follow-banner .btn { height: 26px; }

#search-box {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 75; display: flex; align-items: center;
  gap: 6px; padding: 4px 6px 4px 12px; width: min(520px, calc(100vw - 24px));
}
#search-box input { flex: 1; border: 0; background: transparent; outline: none; height: 36px; font-size: 15px; min-width: 0; }

#present-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center;
  gap: 8px; padding: 4px 8px; opacity: 0.25; transition: opacity 0.2s;
}
#present-bar:hover { opacity: 1; }
#present-mask { position: absolute; pointer-events: none; box-shadow: 0 0 0 100000px var(--canvas); }
body.presenting .chrome, body.presenting #ctxbar, body.presenting #timer-widget { display: none !important; }
body.presenting #stage { background-image: none; }

/* Reaktionen */
.reaction {
  position: fixed; bottom: 60px; z-index: 300; pointer-events: none; display: flex; flex-direction: column; align-items: center;
  animation: floatUp 3s ease-out forwards;
}
.r-emoji { font-size: 44px; }
.r-name { background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  10% { transform: translateY(-20px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-60vh) scale(1); opacity: 0; }
}

/* Tastenkürzel */
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px 32px; }
.shortcuts h4 { margin: 12px 0 6px; }
.shortcuts table { border-collapse: collapse; width: 100%; }
.shortcuts td { padding: 4px 0; vertical-align: top; }
.shortcuts td:first-child { width: 48%; padding-right: 12px; }

/* ---------------- Vorlagen-Galerie ---------------- */

.tpl-wrap { display: grid; grid-template-columns: 200px 1fr; grid-template-rows: minmax(0, 1fr); gap: 20px; height: 100%; min-height: 0; }
.tpl-side { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; }
.tpl-search { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel); }
.tpl-cats { display: flex; flex-direction: column; gap: 2px; }
.tpl-cat { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; }
.tpl-cat:hover { background: var(--panel-2); }
.tpl-cat.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tpl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 2px 6px 12px 2px;
  /* Zeilen behalten ihre volle Höhe, der Bereich scrollt (sonst werden die Karten in die Modalhöhe gestaucht) */
  grid-auto-rows: max-content; align-content: start; overflow-y: auto; min-height: 0; overscroll-behavior: contain;
}
.tpl-card {
  display: flex; flex-direction: column; text-align: left; border: 1px solid var(--border); background: var(--panel);
  border-radius: 10px; padding: 0; overflow: hidden; transition: box-shadow 0.15s, border-color 0.15s;
}
.tpl-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tpl-prev { aspect-ratio: 16 / 10; background: #f1f3f5; display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--border); }
.tpl-prev svg { width: 100%; height: 100%; display: block; }
.tpl-blank { font-size: 48px; color: #adb5bd; font-weight: 300; }
.tpl-info { padding: 10px 12px; }
.tpl-name { font-weight: 600; }
.tpl-desc { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.4; }

/* ================================================================== */
/* Dashboard                                                           */
/* ================================================================== */

body.dash-page { min-height: 100vh; }
.dash-top {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.dash-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
#dash-search { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; width: min(320px, 40vw); background: var(--panel-2); }
.dash-main { max-width: 1280px; margin: 0 auto; padding: 24px; }
.dash-section-head { display: flex; align-items: center; gap: 12px; margin: 16px 0 14px; }
.dash-section-head h2 { margin: 0; font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.dash-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.dash-templates .tpl-info { padding: 8px 10px; font-size: 13px; }
.dash-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.board-card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: box-shadow 0.15s, border-color 0.15s;
}
.board-card:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.board-card > .icon-btn { position: absolute; right: 6px; bottom: 10px; }
.board-thumb { aspect-ratio: 16 / 10; background: #f1f3f5; display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--border); }
.board-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.board-thumb-empty { font-size: 40px; opacity: 0.5; }
.board-info { padding: 10px 40px 12px 14px; }
.board-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.online { color: #2f9e44; font-weight: 600; }
.dash-empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--muted); border: 2px dashed var(--border); border-radius: 12px; }

/* ================================================================== */
/* Kleine Bildschirme                                                  */
/* ================================================================== */

@media (max-width: 760px) {
  #topbar { right: 12px; overflow-x: auto; scrollbar-width: none; }
  #board-name { width: 120px; }
  #topright { top: 68px; right: 12px; height: 44px; }
  .collab-tools { display: none; }
  #tools {
    top: auto; bottom: 12px; left: 12px; right: 12px; transform: none; flex-direction: row; overflow-x: auto;
    max-height: none;
  }
  .tool-sep { width: 1px; height: auto; margin: 6px 4px; }
  #bottom-left { bottom: 74px; }
  #bottom-right { bottom: 74px; }
  #minimap { display: none; }
  #sidepanel { left: 12px; width: auto; top: 124px; bottom: 130px; }
  .tpl-wrap { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .tpl-cats { flex-direction: row; overflow-x: auto; }
  .tpl-cat { white-space: nowrap; }
  .dash-top { padding: 10px 12px; gap: 8px; }
  .dash-top .spacer { display: none; }
  .dash-brand span { display: none; }
  #dash-search { width: auto; flex: 1; min-width: 0; }
  .dash-section-head { flex-wrap: wrap; }
  .dash-main { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ================================================================== */
/* Konten, Anmeldung, Teilen                                           */
/* ================================================================== */

.btn.block { width: 100%; height: 42px; font-size: 15px; }
.form-error { background: #fff0f0; color: #c92a2a; border: 1px solid #ffc9c9; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
body.dark .form-error { background: #3b1f22; color: #ffa8a8; border-color: #5c2a2f; }
.field-hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.form input[type=email], .form input[type=password], .form input[type=url], .form input[type=search] {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; background: var(--panel); font-weight: 400;
}
.form select { appearance: auto; }
.form-actions .spacer { flex: 1; }
.form-actions.start { justify-content: flex-start; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.profile-head { display: flex; align-items: center; gap: 12px; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  width: 400px; max-width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 32px; display: flex; flex-direction: column; gap: 14px;
}
.auth-card h1 { margin: 6px 0 0; font-size: 22px; }
.auth-card > p { margin: 0; line-height: 1.5; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.auth-links { display: flex; flex-direction: column; gap: 8px; align-items: center; font-size: 13px; margin-top: 4px; }
.auth-card .hint { margin: 0; }

.share { gap: 16px; }
.share select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--panel); font-weight: 400; }
.invite { display: flex; flex-direction: column; gap: 8px; }
.invite-row { display: flex; gap: 8px; }
.invite-row select { flex-shrink: 0; }
.suggest-wrap { position: relative; flex: 1; min-width: 0; }
.suggest-wrap input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; background: var(--panel); }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow); z-index: 10; padding: 4px; display: flex; flex-direction: column;
}
.suggest-item { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; text-align: left; font-weight: 400; }
.suggest-item:hover { background: var(--panel-2); }
.members { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; max-height: 260px; overflow-y: auto; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-weight: 400; }
.member-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.member select { padding: 4px 6px; }
.hint code { display: block; margin-top: 2px; }

.board-tags { display: flex; gap: 6px; margin-top: 6px; }
.tag { font-size: 11px; background: var(--panel-2); border-radius: 10px; padding: 2px 8px; color: var(--muted); }

/* ================================================================== */
/* Administration                                                      */
/* ================================================================== */

.admin-layout { display: grid; grid-template-columns: 220px 1fr; max-width: 1280px; margin: 0 auto; gap: 24px; padding: 24px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 80px; align-self: start; }
.admin-nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.admin-nav-item svg { width: 18px; height: 18px; color: var(--muted); }
.admin-nav-item:hover { background: var(--panel-2); }
.admin-nav-item.active { background: var(--accent-soft); color: var(--accent); }
.admin-nav-item.active svg { color: var(--accent); }
.admin-main { min-width: 0; }
.admin-main h1 { margin: 4px 0 20px; font-size: 22px; }
.admin-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.admin-search { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; width: 280px; max-width: 100%; background: var(--panel); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.stat-tile { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.stat-tile.warn { border-color: #fa5252; box-shadow: inset 0 0 0 1px #fa5252; }
.stat-tile .spark { height: 36px; margin-top: 10px; }
.stat-tile .spark svg { width: 100%; height: 100%; display: block; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 12px; }
.notice { display: block; background: var(--accent-soft); color: var(--text); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; text-decoration: none; }
.notice.warn { background: #fff4e6; color: #a35200; }
body.dark .notice.warn { background: #3a2a14; color: #ffc078; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td.actions { width: 1%; text-align: right; }
.admin-table tr.row-warn td { background: rgba(255, 169, 77, 0.08); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 10px; background: var(--panel-2); white-space: nowrap; }
.pill.ok { background: #d3f9d8; color: #2b8a3e; }
.pill.warn { background: #fff4e6; color: #d9480f; }
.pill.off { background: #f1f3f5; color: #868e96; }
.pill.accent { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
body.dark .pill.ok { background: #1e3a24; color: #8ce99a; }
body.dark .pill.warn { background: #3a2a14; color: #ffc078; }
body.dark .pill.off { background: #33353c; }

.admin-form { max-width: 640px; }
.admin-form fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px 18px; margin: 0; display: flex; flex-direction: column; gap: 14px; background: var(--panel); }
.admin-form legend { font-weight: 700; padding: 0 6px; }
.form-row.wide-first { grid-template-columns: 1fr 120px; }
.radio-card { display: flex !important; flex-direction: row !important; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 400 !important; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 3px; }
.test-result { font-size: 13px; padding: 8px 12px; border-radius: 8px; background: var(--panel-2); }
.test-result.ok { background: #d3f9d8; color: #2b8a3e; }
.test-result.fail { background: #fff0f0; color: #c92a2a; }

@media (max-width: 760px) {
  .admin-layout { grid-template-columns: 1fr; padding: 16px; }
  .admin-nav { flex-direction: row; overflow-x: auto; position: static; }
  .admin-nav-item { white-space: nowrap; }
  .invite-row { flex-wrap: wrap; }
}

/* ================================================================== */
/* Sicherheit: Kennwortstärke, Zwei-Faktor, Geräte                     */
/* ================================================================== */

.pw-meter { display: flex; flex-direction: column; gap: 4px; margin-top: -6px; }
.pw-bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: 3px; transition: width 0.2s, background 0.2s; }
.pw-meter[data-score="1"] .pw-bar span { width: 25%; background: #e03131; }
.pw-meter[data-score="2"] .pw-bar span { width: 50%; background: #f08c00; }
.pw-meter[data-score="3"] .pw-bar span { width: 75%; background: #2f9e44; }
.pw-meter[data-score="4"] .pw-bar span { width: 100%; background: #2b8a3e; }
.pw-text { font-size: 12px; font-weight: 600; color: var(--muted); min-height: 15px; }
.field-hint.warn { color: #d9480f; }

.security { gap: 6px; }
.sec-block { border-top: 1px solid var(--border); padding: 14px 0 6px; display: flex; flex-direction: column; gap: 10px; }
.sec-block:first-child { border-top: 0; padding-top: 0; }
.sec-block h3 { margin: 0; font-size: 15px; }
.sec-block p { margin: 0; line-height: 1.5; }
.sessions { display: flex; flex-direction: column; gap: 6px; }
.session { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.session .pill { margin-left: 6px; }
.qr { width: 200px; height: 200px; align-self: center; background: #fff; border-radius: 8px; padding: 6px; border: 1px solid var(--border); }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { display: block; font-size: 15px; letter-spacing: 0.08em; padding: 8px 10px; margin: 6px 0; word-break: break-all; }
.codes { background: var(--panel-2); border-radius: 8px; padding: 12px 16px; font-size: 15px; line-height: 1.8; columns: 2; margin: 0; user-select: all; }
details summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.admin-filter { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--panel); }
.admin-form textarea { font-family: inherit; }
.notice .btn { margin-left: 8px; }

/* ================================================================== */
/* Rechtliches: Impressum & Datenschutz                                */
/* ================================================================== */

.legal-main { max-width: 820px; margin: 0 auto; padding: 32px 24px 16px; }
.legal-text { line-height: 1.65; font-size: 15px; overflow-wrap: anywhere; }
.legal-text h1 { font-size: 28px; margin: 0 0 20px; }
.legal-text h2 { font-size: 20px; margin: 28px 0 8px; }
.legal-text h3 { font-size: 17px; margin: 22px 0 6px; }
.legal-text h4 { font-size: 15px; margin: 18px 0 4px; }
.legal-text p { margin: 0 0 12px; }
.legal-text ul, .legal-text ol { margin: 0 0 12px; padding-left: 22px; }
.legal-text hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.legal-updated { margin-top: 28px !important; }
.legal-page .legal-main { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; margin-top: 24px; padding: 32px 40px; }

.site-footer { padding: 20px 24px 28px; }
.legal-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--accent); text-decoration: underline; }
.auth-wrap { flex-direction: column; gap: 16px; }
.admin-nav .legal-links { justify-content: flex-start; padding: 16px 12px 0; margin-top: 12px; border-top: 1px solid var(--border); }

.seg { display: inline-flex; gap: 4px; background: var(--panel-2); padding: 3px; border-radius: 9px; }
.seg .btn { border-color: transparent; background: transparent; }
.seg .btn.active { background: var(--panel); border-color: var(--border); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.legal-form { max-width: none; }
.legal-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.legal-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.legal-editor { width: 100%; min-height: 520px; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--panel); resize: vertical; }
.legal-preview { border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; background: var(--panel); max-height: 640px; overflow: auto; font-size: 14px; }
.legal-preview h1 { font-size: 22px; }
.md-help pre { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; font-size: 12px; margin: 6px 0 0; white-space: pre-wrap; }

@media (max-width: 900px) {
  .legal-split { grid-template-columns: 1fr; }
  .legal-page .legal-main { padding: 24px 18px; margin: 12px; }
}

#update-banner {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; align-items: center;
  gap: 12px; padding: 8px 8px 8px 16px; border: 2px solid var(--accent); font-weight: 500;
}
.version-history { margin-top: 24px; }
.version-history h3 { font-size: 15px; margin: 0 0 10px; }
.version-history .admin-table { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }

/* ================================================================== */
/* Privater Modus, Schätzrunde, Aufgaben, Versionen, Diagramm aus Text */
/* ================================================================== */

#private-banner {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 72; display: flex; align-items: center;
  gap: 10px; padding: 8px 10px 8px 14px; border: 2px solid #212529; max-width: min(760px, calc(100vw - 24px)); font-size: 14px;
}
.pm-icon { display: inline-flex; }
body:has(#timer-widget:not(.hidden)) #private-banner { top: 124px; }

#estimation {
  position: fixed; right: 12px; top: 72px; z-index: 74; width: min(380px, calc(100vw - 24px)); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--accent);
}
body:has(#sidepanel:not(.hidden)) #estimation { right: 344px; }
.est-head { display: flex; align-items: center; gap: 10px; }
.est-head > span:first-child { color: var(--accent); display: inline-flex; }
.est-title { flex: 1; min-width: 0; }
.linkish { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; text-align: left; }
.linkish:hover { color: var(--accent); text-decoration: underline; }
.est-deck { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.est-card {
  height: 54px; border: 2px solid var(--border); border-radius: 8px; background: var(--panel); font-size: 18px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.1s;
}
.est-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.est-card.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.est-card.small { height: 30px; min-width: 38px; font-size: 14px; padding: 0 6px; cursor: default; }
.est-people { display: flex; flex-wrap: wrap; gap: 6px; }
.est-person { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 3px 8px 3px 3px; border-radius: 14px; background: var(--panel-2); }
.est-person .avatar, .task-row .avatar { background: var(--accent); }
.est-person.done { background: #d3f9d8; color: #2b8a3e; }
body.dark .est-person.done { background: #1e3a24; color: #8ce99a; }
.est-state { font-weight: 700; }
.est-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.est-results { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.est-result { display: flex; align-items: center; gap: 10px; }
.est-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.ok-text { color: #2b8a3e; }

.task-group { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px 4px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.task-row { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); margin: 0 8px; padding: 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.task-row:hover { background: var(--panel-2); }
.task-color { width: 4px; align-self: stretch; border-radius: 2px; flex-shrink: 0; }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.task-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.task-meta .overdue { color: var(--danger); font-weight: 600; }
.task-tag { background: var(--panel-2); border-radius: 4px; padding: 0 5px; }

.version-list { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.version-row { padding: 10px 8px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.version-title { display: flex; align-items: center; gap: 8px; font-weight: 600; justify-content: space-between; }

.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; }
.diagram-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.diagram-split textarea { width: 100%; min-height: 360px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--panel); resize: vertical; }
.diagram-preview { border: 1px solid var(--border); border-radius: 8px; background: #fff; min-height: 360px; max-height: 480px; overflow: auto; display: flex; align-items: center; justify-content: center; }
.diagram-preview svg { max-width: 100%; height: auto; max-height: 460px; }
.form textarea.mono { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--panel); }

/* Meine Aufgaben (Übersicht) */
.my-tasks { margin: 0 0 28px; }
.my-tasks-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.my-tasks-head h2 { margin: 0; font-size: 18px; }
.my-task-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.my-task { display: flex; gap: 10px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.my-task:hover { border-color: var(--accent); }
.my-task .task-main { gap: 4px; }

@media (max-width: 760px) {
  .diagram-split { grid-template-columns: 1fr; }
  .diagram-split textarea, .diagram-preview { min-height: 220px; }
  .est-deck { grid-template-columns: repeat(4, 1fr); }
  body:has(#sidepanel:not(.hidden)) #estimation { right: 12px; }
}

/* Position & Größe */
.geo-form { display: flex; flex-direction: column; gap: 10px; width: 260px; }
.geo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.geo-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.geo-input { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 14px; background: var(--panel); color: var(--text); }
#layer-overlay .h-hit { fill: transparent; stroke: none; }

/* Tabellen */
.ctx-label { font-size: 12px; color: var(--muted); padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#layer-overlay .tab-col { cursor: col-resize; }
#layer-overlay .tab-row { cursor: row-resize; }

/* ================================================================== */
/* Zusammenarbeit im Team (3.7.0)                                      */
/* ================================================================== */

#toast.with-action.show { pointer-events: auto; display: flex; align-items: center; gap: 12px; text-align: left; }
#toast .btn { flex: none; }
.badge.guest { background: #fff3bf; color: #8a6d00; }
body.dark .badge.guest { background: #4a3d0a; color: #ffe066; }

/* Glocke */
.bell { position: relative; }
.bell-badge {
  position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; pointer-events: none;
}
.notif-pop { width: min(320px, calc(100vw - 44px)); display: flex; flex-direction: column; max-height: min(70vh, 560px); }
.notif-head .btn { white-space: nowrap; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; }
.notif-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 8px; color: var(--text); }
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item .avatar { background: var(--muted); flex: none; }
.notif-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.notif-excerpt { color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Kommentare: Erwähnungen, Aufgaben */
.mention.me { background: var(--accent-soft); border-radius: 4px; padding: 0 2px; }
.comment-msg.pending { opacity: 0.6; }
.mention-wrap { flex: 1; position: relative; display: flex; }
.mention-wrap textarea { flex: 1; }
.mention-list {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; z-index: 5;
}
.mention-item { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; text-align: left; color: var(--text); font-size: 13px; }
.mention-item.active, .mention-item:hover { background: var(--accent-soft); }
.comment-task, .comment-task-row { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.comment-task > span:first-child { color: #f08c00; display: inline-flex; }
.comment-task.done > span:first-child { color: var(--muted); }
.comment-task.small { border: 0; padding: 4px 0 0; font-size: 12px; }
.comment-task .overdue { color: var(--danger); font-weight: 600; }
.comment-task-form { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.comment-task-form select, .comment-task-form input { flex: 1; min-width: 0; }
.comment-task-row .btn span, .comment-task .btn span { display: inline-flex; }

/* Moderation */
#moderation-banner {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 71; display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border: 2px solid #7048e8; font-size: 13px; max-width: min(760px, calc(100vw - 24px));
}
#moderation-banner .pm-icon { color: #7048e8; }
.mod-chip { margin-left: 8px; background: #f3f0ff; color: #5f3dc4; border-radius: 12px; padding: 2px 8px; font-weight: 600; }
body.dark .mod-chip { background: #2b2350; color: #d0bfff; }
body:has(#moderation-banner:not(.hidden)) #private-banner { top: 116px; }
body:has(#timer-widget:not(.hidden)) #moderation-banner { top: 124px; }
#btn-moderation.active { color: #7048e8; }

/* Aktivität */
.activity-list { display: flex; flex-direction: column; padding: 0 8px 12px; overflow-y: auto; }
.activity-row { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 0; background: transparent; padding: 8px; border-radius: 8px; color: var(--text); font-size: 13px; }
.activity-row:hover { background: var(--panel-2); }
.activity-row.new { box-shadow: inset 3px 0 0 #f08c00; }
.activity-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.activity-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-marker { margin: 8px 0; padding: 4px 8px; font-size: 12px; color: #d9480f; border-top: 1px dashed #f08c00; }
.changed-mark { pointer-events: none; }
.since-banner {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 14px; font-size: 14px; border: 2px solid #f08c00; max-width: calc(100vw - 24px);
}
.since-banner > span:first-child { color: #f08c00; display: inline-flex; }

/* Aufzeichnungen */
#rec-bar, #play-bar {
  position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 95; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; font-size: 14px; max-width: calc(100vw - 24px);
}
#rec-bar { border: 2px solid #e03131; }
#play-bar { top: auto; bottom: 84px; border: 2px solid #e8590c; }
#play-bar input[type=range] { width: min(320px, 40vw); }
.play-title { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #e03131; animation: rec-pulse 1.2s infinite; }
@keyframes rec-pulse { 50% { opacity: 0.3; } }
.rec-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-mic { display: inline-flex; color: #e03131; }
.rec-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.rec-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rec-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-cursor { z-index: 3; }
/* Während einer Bearbeitungssperre der Moderation */
body.edit-locked #btn-timer, body.edit-locked #btn-vote, body.edit-locked #btn-private { display: none; }
#play-bar { flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px); }
#toast { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  #play-bar input[type=range] { width: 100%; order: 5; }
  .play-title { display: none; }
  #moderation-banner { top: 116px; font-size: 12px; }
  body:has(#moderation-banner:not(.hidden)) #private-banner { top: 168px; }
}
#btn-recordings { color: #e03131; }

/* Teilen: Team und Gastlinks */
.share-block { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.share-block .row { flex-wrap: wrap; }
.share-block input[type=text] { flex: 1; min-width: 160px; }
.avatar.guest { background: #f59f00; display: inline-flex; align-items: center; justify-content: center; }
.avatar.guest svg { width: 16px; height: 16px; }

/* Startseite: Ordner und Teams */
/* Navigation als eigene Spalte links, von oben an; bleibt beim Scrollen stehen */
.dash-main.dash-layout { max-width: 1480px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.dash-page-content { min-width: 0; }
.dash-area { margin-top: 8px; }
#dash-title { scroll-margin-top: 84px; }
.dash-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; padding-top: 16px; max-height: calc(100vh - 92px); overflow-y: auto; }
.dash-nav-item {
  display: flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 8px; padding: 7px 10px;
  color: var(--text); text-align: left; font-size: 14px;
}
.dash-nav-item:hover { background: var(--panel-2); }
.dash-nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-icon { display: inline-flex; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { color: var(--muted); font-size: 12px; }
.dash-nav-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 2px; padding: 0 4px 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dash-nav-hint { font-size: 12px; color: var(--muted); padding: 2px 10px 4px; }
.dash-folderbar { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.chip { border: 1px solid var(--border); background: var(--panel); border-radius: 16px; padding: 4px 12px; font-size: 13px; color: var(--text); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.folder-pick { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--panel); border-radius: 8px; padding: 8px 10px; text-align: left; color: var(--text); }
.folder-pick:hover { background: var(--panel-2); }
.folder-pick.active { border-color: var(--accent); }
.folder-pick span:first-child { display: inline-flex; }
#dash-bell { display: inline-flex; }
.dash-new { justify-content: center; margin-bottom: 10px; }
.dash-new span { display: inline-flex; }
.nav-count.alert { background: var(--danger); color: #fff; border-radius: 9px; padding: 0 6px; font-weight: 700; }
.dash-view > .dash-section-head:first-child { margin-top: 0; }
/* Vorlagen als einzeilige, waagerecht scrollbare Leiste */
.dash-templates.strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 160px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.due-hint {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 18px 0 0; padding: 10px 14px; border-radius: 10px; text-align: left;
  border: 1px solid #ffd8a8; background: #fff4e6; color: #a6510a; font-size: 14px;
}
.due-hint.overdue { border-color: #ffc9c9; background: #fff5f5; color: #c92a2a; }
.due-hint .muted { margin-left: auto; }
body.dark .due-hint { background: #3a2a14; border-color: #5c4321; color: #ffc078; }
body.dark .due-hint.overdue { background: #3b1f22; border-color: #5c2a2f; color: #ffa8a8; }
@media (max-width: 760px) {
  .dash-main.dash-layout { grid-template-columns: 1fr; gap: 8px; }
  .dash-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding: 0 0 4px; max-height: none; scrollbar-width: none; }
  .dash-nav::-webkit-scrollbar { display: none; }
  .dash-nav-item { flex: none; }
  .dash-nav-head { margin: 0 4px; flex: none; }
  .dash-nav-hint { display: none; }
  #moderation-banner, #private-banner { top: 64px; }
}
