/* Impact-Matrix — UNEQ Brand (design.uneq.de) */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;800;900&family=Mulish:wght@400;600;700;800&display=swap');

:root {
  color-scheme: dark;
  /* UNEQ tokens */
  --page: #2B2931;            /* UNEQ Ground */
  --surface-1: #353340;       /* ground-soft: cards */
  --surface-2: #1F1D24;       /* ground-deep: inputs / layering */
  --text-primary: #FFFFFF;
  --text-secondary: #C9C5CF;
  --text-muted: #8A8693;
  --grid: rgba(255,255,255,0.08);
  --baseline: #58595B;        /* UNEQ Gray — lines only */
  --border: rgba(255,255,255,0.08);
  --peach: #FAB784;           /* thin lines / outlines ONLY */
  --peach-700: #E89456;
  --accent: #FBB040;          /* UNEQ Orange — fills, focus, highlights */
  --accent-strong: #E89A28;
  --green: #00A79D;
  --font-display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Mulish', 'Helvetica Neue', Arial, sans-serif;
  /* Kategorische Punkt-Farben (validierte Datenviz-Palette) */
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #009500; --series-7: #9085e9; --series-8: #e66767;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: 13px; }
.sub { color: var(--text-secondary); margin: 4px 0 16px; }
.error { color: #e66767; min-height: 1.2em; font-size: 13px; }

h1, h2 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: -0.01em; }

.view { min-height: 100vh; }
.center-view { display: flex; align-items: center; justify-content: center; padding: 24px; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
}
.auth-card { width: 400px; text-align: center; }
.lobby-card { width: 540px; }

.logo {
  font-size: 24px; margin: 0; font-weight: 900;
}
.logo span { color: var(--accent); }
/* Signatur: dünne Peach-Linie unter der Marke */
.auth-card .logo::after, .lobby-head .logo::after {
  content: ""; display: block; width: 56px; height: 2px;
  background: var(--peach); margin: 12px auto 0;
}
.lobby-head .logo::after { margin-left: 0; }

/* Buttons — Markenregeln: Peach nur als Linie, Orange als einzige Füllung */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border); border-left: 5px solid var(--peach);
  border-radius: 2px;
  padding: 10px 16px; cursor: pointer;
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: border-color 220ms cubic-bezier(0.22,1,0.36,1);
}
.btn:hover { border-left-color: var(--peach-700); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); color: var(--page);
  border: 1px solid var(--accent); font-weight: 800;
}
.btn-primary:hover { background: #FFC15C; border-color: #FFC15C; }
.btn-ghost {
  border: 1px solid transparent; color: var(--text-secondary);
  letter-spacing: 0.06em;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-google {
  width: 100%; background: #ffffff; color: #1f1f1f;
  border: 1px solid #ffffff; font-weight: 800; text-decoration: none;
}
.btn-google:hover { background: #f1f1f1; }

input, textarea {
  width: 100%; background: var(--surface-2); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 2px;
  padding: 10px 12px; font-size: 14px; font-family: var(--font-body);
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Rich-Text-Eingabe (Beschreibung) */
.rich-input {
  min-height: 68px; max-height: 220px; overflow-y: auto;
  background: var(--surface-2); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 2px;
  padding: 10px 12px; font-size: 14px; font-family: var(--font-body);
  line-height: 1.45; text-align: left; cursor: text;
}
.rich-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.rich-input:empty::before {
  content: attr(data-placeholder); color: var(--text-muted); pointer-events: none;
}
.rich-input ul, .rich-input ol { margin: 2px 0; padding-left: 20px; }
.rich-input li > ul, .rich-input li > ol { margin: 0; }
.rich-input b, .rich-input strong { font-weight: 800; }
label { display: block; text-align: left; font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
label input { margin-top: 4px; }
label.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
label.inline input { width: 80px; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.row input { flex: 1; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; font-family: var(--font-display); font-weight: 700; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--grid); }

/* Lobby */
.lobby-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; }
.me-row { display: flex; align-items: center; gap: 8px; }
h2 { font-size: 14px; margin: 20px 0 8px; letter-spacing: 0.08em; }
.ws-list { list-style: none; padding: 0; margin: 0 0 16px; }
.ws-list li { margin-bottom: 6px; }
.ws-list button.ws-item {
  width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--peach);
  border-radius: 2px;
  color: var(--text-primary); padding: 13px 14px; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
}
.ws-list button.ws-item:hover { border-color: var(--peach-700); border-left-color: var(--peach-700); }
/* Persönliche Einträge (Meine Matrix / Mein Kanban): auffällig in Orange */
.ws-list button.ws-item-primary {
  background: var(--accent); border-color: var(--accent); border-left-color: var(--accent);
  color: var(--page); font-weight: 800;
}
.ws-list button.ws-item-primary .muted { color: rgba(43, 41, 49, 0.72); }
.ws-list button.ws-item-primary:hover {
  background: #FFC15C; border-color: #FFC15C; border-left-color: #FFC15C;
}
.lobby-forms { display: grid; gap: 8px; }

/* Workshop-Layout */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; border-bottom: 1px solid var(--grid); background: var(--surface-1);
}
.topbar h1 { font-size: 15px; margin: 0; font-weight: 800; }
.code-chip {
  background: transparent; border: 1px dashed var(--baseline); border-radius: 2px;
  color: var(--text-secondary); font-family: ui-monospace, monospace; font-size: 13px;
  padding: 4px 10px; cursor: pointer;
}
.code-chip:hover { border-color: var(--peach); }
.members { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.member-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border-radius: 999px; padding: 3px 10px 3px 6px;
  font-size: 12px; color: var(--text-secondary);
}
.member-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.member-chip.online .member-dot { background: var(--green); }
.member-chip.master { border: 1px solid var(--border); }

#view-workshop { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.layout { display: grid; grid-template-columns: 340px 1fr; gap: 0; flex: 1; min-height: 0; }
.sidebar { overflow-y: auto; min-height: 0; padding: 14px; border-right: 1px solid var(--grid); }
.chart-area { padding: 10px; display: flex; min-height: 0; min-width: 0; }
#chart { flex: 1; min-width: 0; }
#chart svg { width: 100%; height: 100%; display: block; }

/* Notiz-Formular */
.add-note { margin-bottom: 14px; padding: 14px 16px; }
.add-note summary {
  cursor: pointer; font-family: var(--font-display); font-weight: 700;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
}
.add-note form { margin-top: 12px; display: grid; gap: 8px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 24px; height: 24px; border-radius: 4px; cursor: pointer;
  border: 2px solid transparent; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.swatch[aria-checked="true"] { border-color: var(--text-primary); outline: 2px solid var(--accent); outline-offset: 1px; }

.form-hint { margin: 0; font-size: 12px; }

/* Notiz-Liste */
.note-group-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 16px 4px 8px;
}
.note-group-row .note-group-label { margin: 0; }
.sort-select {
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 2px;
  font-family: var(--font-body); font-size: 12px; padding: 3px 6px;
}
.sort-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.note-group-label {
  font-family: var(--font-display); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.18em; font-weight: 700;
  color: var(--text-muted); margin: 16px 4px 8px;
}
/* Post-it-Optik: die Karte trägt die Notiz-Farbe als Fläche */
.note-card {
  border-radius: 2px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 3px 10px rgba(31, 29, 36, 0.35);
}
.note-card.ink-dark { color: #1F1D24; }
.note-card.ink-light { color: #FFFFFF; }
.note-card.dark-fill { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 3px 10px rgba(31, 29, 36, 0.35); }
.note-card.voting { outline: 3px solid var(--text-primary); outline-offset: 1px; }
.note-head { display: flex; align-items: baseline; gap: 8px; }
.note-title { font-weight: 800; font-size: 14px; flex: 1; color: inherit; }
.note-values { font-size: 12px; color: inherit; opacity: 0.8; white-space: nowrap; font-variant-numeric: tabular-nums; }
.note-desc { font-size: 13px; color: inherit; opacity: 0.85; margin: 4px 0 0; }
.note-desc ul, .note-desc ol { margin: 2px 0; padding-left: 18px; }
.note-desc li > ul, .note-desc li > ol { margin: 0; }
/* Lange Kartenbeschreibung: gekürzt, unten ausgeblendet (Maske, damit es auf jeder Kartenfarbe passt) */
.note-desc.clampable { overflow: hidden; transition: max-height 220ms cubic-bezier(0.23, 1, 0.32, 1); }
.note-desc.clamped {
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.desc-toggle {
  display: block; margin-top: 4px; padding: 6px 0; background: none; border: 0;
  color: inherit; font: inherit; font-size: 12px; font-weight: 700; opacity: 0.8; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; transition: transform 160ms ease-out;
}
.desc-toggle:hover { opacity: 1; }
.desc-toggle:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) { .note-desc.clampable { transition: none; } }
.rich-gap { height: 8px; }
.note-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.note-meta .author {
  font-size: 12px; color: inherit; opacity: 0.65; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note-actions { display: flex; gap: 2px; flex: none; }
.note-card.flash { animation: card-flash 1.4s ease; }
@keyframes card-flash {
  0%, 100% { outline: 0 solid transparent; transform: none; }
  15% { outline: 3px solid var(--accent); outline-offset: 2px; transform: scale(1.03); }
  60% { outline: 3px solid var(--accent); outline-offset: 2px; }
}
.icon-btn {
  background: none; border: none; color: inherit; opacity: 0.7; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 700; padding: 3px 6px; border-radius: 2px;
  display: inline-flex; align-items: center;
}
.icon-btn svg { width: 15px; height: 15px; display: block; }
.icon-btn:hover { opacity: 1; background: rgba(0, 0, 0, 0.18); color: inherit; }
.icon-btn.danger:hover { background: rgba(0, 0, 0, 0.3); }

/* Modals */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(31, 29, 36, 0.75);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal { width: 480px; max-width: calc(100vw - 32px); max-height: 90vh; overflow-y: auto; }
.modal-kicker {
  font-family: var(--font-display); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--text-muted); margin: 0 0 6px; font-weight: 700;
  padding-left: 14px; position: relative;
}
.modal-kicker::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--peach);
}
.modal h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: 0; }
.modal form { display: grid; gap: 8px; }

.slider-block { margin: 18px 0; }
.slider-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px;
}
.slider-head output { font-family: var(--font-body); font-variant-numeric: tabular-nums; color: var(--accent); font-size: 20px; font-weight: 800; }
.slider-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
input[type="range"] { padding: 0; accent-color: var(--accent); height: 28px; }

.master-panel { margin-top: 10px; }

.limit-img {
  display: block;
  width: calc(100% + 48px);
  margin: -24px -24px 18px;
  max-height: 220px;
  object-fit: cover;
  border-radius: 4px 4px 0 0;
}
.limit-caption {
  font-size: 11px; color: var(--text-muted); font-style: italic;
  margin: -10px 0 14px; text-align: center;
}
.limit-message {
  background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: 2px; padding: 10px 14px; margin: 12px 0 14px;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.modal-closable { position: relative; }
.modal-x {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(31, 29, 36, 0.72); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: rgba(31, 29, 36, 0.92); }
.limit-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.limit-settings-btn {
  background: transparent; cursor: pointer;
  border: 1px dashed var(--baseline); border-radius: 2px;
  font-family: var(--font-body); font-size: 12px; font-weight: 400;
  letter-spacing: 0; text-transform: none;
  color: var(--text-muted); padding: 7px 12px;
}
.limit-settings-btn:hover { color: var(--text-secondary); border-color: var(--text-muted); }

.result-values { display: flex; gap: 32px; margin: 14px 0; }
.stat-label {
  display: block; font-family: var(--font-display); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; color: var(--text-muted);
}
.stat-value { font-size: 32px; font-weight: 800; }
.vote-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.vote-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--grid); }
.vote-table td { padding: 4px 8px; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }

/* Kanban */
.kanban-wrap {
  padding: 14px 18px 18px;
  display: flex; flex-direction: column;
  min-height: calc(100vh - 53px);
}
body.embed .kanban-wrap { min-height: 100vh; }
.kanban-board {
  display: flex; gap: 0; align-items: stretch;
  overflow-x: auto; padding-bottom: 8px; flex: 1;
}
.kanban-col { min-height: 340px; flex: 1 0 280px; max-width: 420px; }
.board-select {
  background: var(--surface-2); color: var(--text-primary);
  border: 1px solid var(--border); border-left: 3px solid var(--peach);
  border-radius: 2px; font-family: var(--font-display); font-weight: 700;
  font-size: 12px; letter-spacing: 0.06em; padding: 6px 10px; max-width: 260px;
}
.board-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* Phasen direkt am Board: Plus in der Lücke, Grip zum Verschieben */
.phase-gap {
  flex: 0 0 18px; align-self: stretch; position: relative;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: flex-basis 150ms ease;
}
.phase-add-btn {
  opacity: 0; width: 26px; height: 26px; border-radius: 50%;
  border: 1px dashed var(--baseline); background: var(--surface-2);
  color: var(--text-secondary); cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 150ms ease;
}
.phase-gap:hover .phase-add-btn { opacity: 1; border-color: var(--peach); color: var(--text-primary); }
.phase-gap.editing { flex-basis: 200px; }
.phase-gap.editing input { width: 100%; }
.kanban-board.phase-dragging .phase-gap {
  background: repeating-linear-gradient(135deg, rgba(250,183,132,0.25) 0, rgba(250,183,132,0.25) 1px, transparent 1px, transparent 8px);
}
.kanban-board.phase-dragging .phase-add-btn { opacity: 0; }
.phase-gap.drop-target { background: var(--peach); opacity: 0.6; }
.phase-grip {
  cursor: grab; color: var(--text-muted); font-size: 13px; line-height: 1;
  user-select: none; flex: none; letter-spacing: -1px;
  width: 20px; height: 20px; margin-right: 12px; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
}
.phase-grip:hover { background: var(--surface-2); }
.kanban-col-head { align-items: flex-start; }
.kanban-col-label { line-height: 1.35; }
.add-card-btn {
  margin-top: 10px; padding: 9px 12px; width: 100%;
  background: transparent; border: 1px solid var(--border);
  border-left: 4px solid var(--peach); border-radius: 2px;
  color: var(--text-secondary); cursor: pointer; text-align: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: color 220ms cubic-bezier(0.22,1,0.36,1), border-color 220ms cubic-bezier(0.22,1,0.36,1);
}
.add-card-btn:hover { color: var(--text-primary); border-left-color: var(--peach-700); }
.phase-grip:hover { color: var(--text-primary); }
.phase-grip:active { cursor: grabbing; }
.kanban-col-label { flex: 1; min-width: 0; }
.phase-del { font-size: 15px; padding: 0 4px; line-height: 1; }

.btn-danger { border: 1px solid #d03b3b; border-left-width: 1px; color: #e66767; background: transparent; }
.btn-danger:hover { border-color: #e66767; }
.btn-danger.armed { background: #d03b3b; border-color: #d03b3b; color: #fff; }

.role-select { flex: none !important; font-size: 11px; padding: 4px 8px; }
.member-controls { display: inline-flex; align-items: center; gap: 4px; }
.member-row { margin-bottom: 14px; }
.member-row select { flex: 1; }
.modal .row select { flex: 1; min-width: 0; }
.manage-list { list-style: none; padding: 0; margin: 0 0 10px; }
.manage-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 4px; border-bottom: 1px solid var(--grid); font-size: 14px;
}
.modal-section {
  font-size: 12px; letter-spacing: 0.14em; margin: 26px 0 10px;
  padding-top: 18px; border-top: 1px solid var(--grid);
}
#ws-rename-form p { margin: 6px 0 0; }
#card-edit-form p { margin: 8px 0 0; }
.kanban-col {
  background: rgba(31, 29, 36, 0.45); border: 1px solid var(--border);
  border-radius: 4px; padding: 12px; display: flex; flex-direction: column;
  min-height: 300px;
}
.kanban-col-head {
  font-family: var(--font-display); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 800; margin: 0 2px 10px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.kanban-count { color: var(--text-muted); font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.kanban-count.over { color: var(--accent); }
.kanban-sub-head {
  font-family: var(--font-display); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700; color: var(--text-muted);
  margin: 14px 2px 8px; padding-top: 10px; border-top: 1px dashed var(--baseline);
}
.btn-icon { width: 14px; height: 14px; flex: none; }

/* Anlege-Maske unter den Spalten: farblich abgesetzt, immer offen */
.kanban-new {
  width: 100%; max-width: 680px; margin: 16px auto 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--peach);
  border-radius: 4px;
  padding: 14px 16px 16px;
  margin-top: 8px;
}
.kanban-new-grid { display: grid; gap: 10px; }
.kanban-new-fields { display: grid; gap: 8px; }
.kanban-new-side {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
}

/* Prominenter Kanban-Button in der Lobby */
.nav-kanban-btn { flex: 1; padding: 12px 16px; font-size: 13px; }
.kanban-zone { min-height: 70px; border-radius: 4px; flex: 0 0 auto; }
.kanban-zone-main { flex: 1; }
.kanban-hold { min-height: 60px; flex: 0 0 auto; }
.kanban-col.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.kanban-zone.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.kanban-card { cursor: grab; }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card .note-title { font-size: 13px; }
.kanban-source {
  margin-top: 8px; font-size: 11px; opacity: 0.65; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.kanban-source:hover { opacity: 1; }

.nav-row { margin: 4px 0 8px; }
.visible-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-size: 12px; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
/* iOS-artiger Schalter: Zustand ist auf einen Blick erkennbar */
.visible-toggle input {
  appearance: none; -webkit-appearance: none;
  width: 42px; height: 24px; margin: 0; flex: none;
  border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--baseline); position: relative; cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.visible-toggle input::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-muted);
  transition: transform 160ms ease, background 160ms ease;
}
.visible-toggle input:checked { background: var(--accent); border-color: var(--accent); }
.visible-toggle input:checked::after { transform: translateX(18px); background: #FFFFFF; }

/* Seitennavigation */
.nav-burger {
  position: fixed; top: 10px; left: 12px; z-index: 210;
  width: 34px; height: 34px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.nav-burger:hover { color: var(--text-primary); border-color: var(--peach); }
.sidenav {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  width: 240px; background: var(--surface-1);
  border-right: 1px solid var(--grid);
  padding: 14px 12px 12px; display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform 200ms cubic-bezier(0.22,1,0.36,1);
  overflow-y: auto;
}
body.nav-open .sidenav { transform: none; }
body.authed.nav-open .view { margin-left: 240px; transition: margin-left 200ms cubic-bezier(0.22,1,0.36,1); }
body.authed .view { transition: margin-left 200ms cubic-bezier(0.22,1,0.36,1); }
body.authed:not(.nav-open) .topbar { padding-left: 58px; }
body.authed .center-view { padding-top: 60px; }
.sidenav-head { margin: 2px 0 14px 42px; }
.sidenav-head .logo { font-size: 17px; }
.sidenav-link {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; color: var(--text-secondary);
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 10px; border-radius: 4px; cursor: pointer; text-align: left;
}
.sidenav-link:hover { color: var(--text-primary); background: var(--surface-2); }
.sidenav-home { color: var(--text-primary); }
.sidenav-section {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted);
  margin: 16px 10px 6px;
}
.sn-plus {
  width: 20px; height: 20px; border-radius: 4px; border: 1px dashed var(--baseline);
  background: none; color: var(--text-muted); cursor: pointer; font-size: 13px; line-height: 1;
}
.sn-plus:hover { color: var(--text-primary); border-color: var(--peach); }
.sidenav-list { list-style: none; padding: 0; margin: 0; }
.sidenav-subhead {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 5px;
  font-family: var(--font-display); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted);
  padding: 6px 10px 3px;
}
.sidenav-subhead::before { content: '▾'; font-size: 8px; transition: transform 140ms ease; }
details:not([open]) > .sidenav-subhead::before { transform: rotate(-90deg); }
.sidenav-subhead::-webkit-details-marker { display: none; }
.sidenav details .sidenav-list { padding-left: 8px; }
.sidenav-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-left: 3px solid transparent;
  color: var(--text-secondary); font-family: var(--font-body); font-size: 13px;
  padding: 7px 10px; border-radius: 0 4px 4px 0; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidenav-item:hover { color: var(--text-primary); background: var(--surface-2); }
.sidenav-item.primary { color: var(--accent); font-weight: 700; }
.sidenav-item.active { border-left-color: var(--peach); background: var(--surface-2); color: var(--text-primary); }
.sidenav-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--grid); }

/* Mein Bereich: Matrix links (Ansicht), Kanban rechts */
.home-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding: 12px 18px 18px; height: calc(100vh - 53px);
}
.home-panel { display: flex; flex-direction: column; min-height: 0; }
.home-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary);
  padding: 0 0 8px;
}
.home-panel iframe {
  width: 100%; flex: 1; border: 1px solid var(--border);
  border-radius: 4px; background: var(--page);
}
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 1fr; height: auto; }
  .home-panel iframe { height: 74vh; }
  .home-panel-kanban { order: -1; }
  /* Sidebar liegt auf Mobile über dem Inhalt statt ihn zu verschieben */
  body.authed.nav-open .view { margin-left: 0; }
}
body.embed .topbar { display: none; }
body.embed #view-workshop { height: 100vh; }
/* Reine Matrix-Ansicht im Mein-Bereich: ohne Seitenleiste/Formular, volle Höhe */
body.embed-view .sidebar { display: none; }
body.embed-view .layout { grid-template-columns: 1fr; height: 100vh; }
body.embed-view .chart-area { height: auto; padding: 6px; }

/* Abhaken & Konfetti */
.check-btn {
  flex: none; width: 21px; height: 21px; border-radius: 50%;
  border: 1.5px solid currentColor; background: transparent;
  color: inherit; opacity: 0.55; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 140ms ease, background 140ms ease, transform 140ms ease;
}
.check-btn svg { width: 12px; height: 12px; opacity: 0; transition: opacity 140ms ease; }
.check-btn:hover { opacity: 1; transform: scale(1.08); }
.check-btn:hover svg { opacity: 1; }
.check-btn.is-done {
  background: currentColor; opacity: 0.9; cursor: default;
}
.check-btn.is-done svg { opacity: 1; }
.kanban-card.card-done .note-title { text-decoration: line-through; opacity: 0.75; }
.confetti-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 400;
}

/* Tooltip */
.tooltip {
  position: fixed; z-index: 100; pointer-events: none;
  background: var(--surface-2); border: 1px solid var(--border); border-left: 2px solid var(--peach);
  border-radius: 2px;
  padding: 10px 12px; max-width: 300px; box-shadow: 0 20px 40px rgba(31,29,36,0.5);
}
.tooltip .tt-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.tooltip .tt-key { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tooltip .tt-desc { font-size: 12px; color: var(--text-secondary); margin: 6px 0; white-space: pre-wrap; }
.tooltip .tt-values { font-size: 12px; color: var(--text-secondary); }
.tooltip .tt-values strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* Chart-Text */
.axis-label {
  fill: var(--text-muted); font-family: var(--font-display);
  font-size: 12px; letter-spacing: 0.18em; font-weight: 700;
}
.dot-label { fill: var(--text-secondary); font-family: var(--font-body); font-size: 9px; }
.tick-label { fill: var(--text-muted); font-family: var(--font-body); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.dot-hit { touch-action: none; }
.tooltip .tt-desc ul, .tooltip .tt-desc ol { margin: 2px 0; padding-left: 16px; }
.cluster-count {
  fill: var(--text-muted); font-family: var(--font-body);
  font-size: 10px; font-weight: 800; text-anchor: middle;
}
.dot-hit { cursor: pointer; }
.dot-hit:focus { outline: none; }
.dot-hit:focus + circle, .dot-hit:hover + circle { stroke: var(--text-primary); }

@media (max-width: 900px) {
  body { overflow-x: hidden; }
  #view-workshop { height: auto; overflow: visible; }

  /* Topbar: umbrechen statt quetschen, Titel einzeilig gekürzt */
  .topbar { flex-wrap: wrap; row-gap: 10px; padding: 10px 12px; }
  .topbar h1 {
    flex: 1 1 auto; min-width: 0; font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #ws-me, #kanban-me { display: none; }
  .members { margin-left: 0; width: 100%; order: 9; }
  .board-select { max-width: 46vw; }

  /* Kanban: Spalten untereinander, Lücken immer sichtbar (kein Hover auf Touch) */
  .kanban-board { flex-direction: column; overflow-x: visible; }
  .kanban-col { flex: none; max-width: none; min-height: 0; }
  .phase-gap { flex-basis: 26px; }
  .phase-add-btn { opacity: 1; }
  .kanban-wrap { padding: 12px; }

  /* Workshop: Luft zwischen Formular und Matrix */
  .layout { grid-template-columns: 1fr; height: auto; }
  .sidebar {
    border-right: none; border-bottom: 1px solid var(--grid);
    max-height: 45vh; padding-bottom: 22px;
  }
  .chart-area { height: 60vh; padding-top: 18px; }
}

/* Dezente Handlungsanweisungen in den Matrix-Quadranten */
.quad-label {
  fill: var(--text-secondary); opacity: 0.07;
  font-family: var(--font-display); font-weight: 800;
  font-size: 30px; letter-spacing: 0.22em;
  pointer-events: none; dominant-baseline: middle;
}

/* Idee wird gerade auf die Matrix gezogen */
.note-card.dragging { opacity: 0.45; }

/* Overlay-Auswahl in der Matrix-Kopfzeile */
.overlay-select { max-width: 240px; font-weight: 600; letter-spacing: 0.03em; }

/* Overlay-Icon in der Sidebar */
.sidenav-row { display: flex; align-items: center; gap: 2px; }
.sidenav-row .sidenav-item { flex: 1; min-width: 0; }
.sn-overlay {
  flex: none; width: 22px; height: 22px; border-radius: 3px;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  opacity: 0.6;
}
.sn-overlay svg { width: 13px; height: 13px; }
.sn-overlay:hover { opacity: 1; color: var(--text-primary); background: var(--surface-2); }
.sn-overlay.active { opacity: 1; color: var(--accent); }

/* Overlay-Ideen in der Liste: nur zur Ansicht */
.note-card.overlay-note { background: transparent; box-shadow: none; }
.note-card.overlay-note .note-title { font-weight: 700; }

/* Abstimmung: Enthaltung & Teilnehmer-Status */
.head-right { display: inline-flex; align-items: center; gap: 10px; }
.abstain-btn {
  background: transparent; border: 1px dashed var(--baseline); border-radius: 2px;
  color: var(--text-muted); cursor: pointer; font-family: var(--font-body);
  font-size: 11px; padding: 3px 8px;
}
.abstain-btn:hover { color: var(--text-secondary); border-color: var(--text-muted); }
.slider-block.unset input[type="range"] { accent-color: var(--baseline); opacity: 0.65; }
.slider-block.unset .slider-head output { color: var(--text-muted); }
.vote-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.vote-person {
  font-size: 12px; color: var(--text-muted); background: var(--surface-2);
  border-radius: 999px; padding: 3px 10px;
}
.vote-person.voted { color: var(--page); background: var(--accent); font-weight: 700; }

/* Glocke & Benachrichtigungen */
.bell {
  position: fixed; top: 10px; right: 14px; z-index: 210;
  width: 34px; height: 34px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bell:hover { color: var(--text-primary); border-color: var(--peach); }
.bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px;
  border-radius: 999px; background: var(--accent); color: var(--page);
  font-size: 10px; font-weight: 800; line-height: 16px; padding: 0 4px;
}
.topbar { padding-right: 58px; }
.notif-list { max-height: 50vh; overflow-y: auto; display: grid; gap: 7px; margin-bottom: 10px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  text-align: left; background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid transparent; border-radius: 4px; padding: 10px 12px;
  color: var(--text-secondary); cursor: pointer; font-family: var(--font-body);
}
.notif-item.unread {
  border-left-color: var(--nf-color, var(--accent));
  color: var(--text-primary);
  background: color-mix(in srgb, var(--nf-color, var(--accent)) 7%, var(--surface-2));
}
.notif-item:hover { border-color: var(--peach-700); border-left-color: var(--nf-color, var(--peach-700)); }
.notif-ico {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--nf-color, var(--accent)) 18%, transparent);
  color: var(--nf-color, var(--accent));
}
.notif-ico svg { width: 15px; height: 15px; }
.notif-body { min-width: 0; }
.notif-head { font-weight: 700; font-size: 13px; }
.notif-snippet { font-size: 12px; opacity: 0.85; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* Kommentare */
.comments-modal { width: 560px; }
.comments-list { max-height: 42vh; overflow-y: auto; display: grid; gap: 10px; margin: 6px 0 12px; }
.comment { background: var(--surface-2); border-radius: 4px; padding: 9px 12px; }
.comment-head { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-bottom: 4px; }
.comment-author { font-weight: 800; }
.comment-tools { margin-left: auto; display: inline-flex; }
.comment-text { font-size: 14px; white-space: pre-wrap; }
.mention { color: var(--accent); font-weight: 700; }
.mention-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mention-chip {
  background: none; border: 1px dashed var(--baseline); border-radius: 999px;
  color: var(--text-muted); font-size: 12px; padding: 3px 10px; cursor: pointer;
}
.mention-chip:hover { color: var(--accent); border-color: var(--accent); }
.cmt-count { font-size: 10px; font-weight: 800; margin-left: 2px; }

/* @-Autovervollständigung (Slack-Stil) */
.comment-input-wrap { position: relative; }
.mention-dd {
  position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; box-shadow: 0 12px 28px rgba(31,29,36,0.55);
  max-height: 200px; overflow-y: auto; z-index: 60;
}
.mention-dd-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; color: var(--text-secondary);
  font-family: var(--font-body); font-size: 14px; padding: 8px 12px; cursor: pointer;
}
.mention-dd-item.sel, .mention-dd-item:hover { background: var(--surface-1); color: var(--text-primary); }

/* Einfüge-Indikator beim Karten-Sortieren */
.drop-indicator {
  height: 3px; border-radius: 2px; background: var(--accent);
  margin: 3px 0; pointer-events: none;
  box-shadow: 0 0 6px rgba(251, 176, 64, 0.6);
}

/* Link-Badges (Slack-Stil) + Überlauf-Schutz */
.link-badge {
  display: inline-block; max-width: 100%; vertical-align: bottom;
  background: rgba(0, 0, 0, 0.16); border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 4px; padding: 0 6px;
  color: inherit; text-decoration: none; font-size: 0.92em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-badge:hover { text-decoration: underline; border-color: currentColor; }
.note-desc, .tt-desc, .comment-text, .note-title { overflow-wrap: anywhere; }
.note-desc div, .tt-desc div { overflow-wrap: anywhere; }

/* App-Dialog */
.dialog-modal { width: 420px; }
.dialog-actions { justify-content: flex-end; }
