/* 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; }
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); }
.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); }

.layout { display: grid; grid-template-columns: 340px 1fr; gap: 0; height: calc(100vh - 53px); }
.sidebar { overflow-y: auto; padding: 14px; border-right: 1px solid var(--grid); }
.chart-area { padding: 10px; display: flex; }
#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;
}
.swatch[aria-checked="true"] { border-color: #fff; }

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

/* Notiz-Liste */
.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;
}
.note-card {
  background: var(--surface-1); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 2px; padding: 10px 12px; margin-bottom: 8px;
}
.note-card.voting { outline: 2px solid var(--accent); }
.note-head { display: flex; align-items: baseline; gap: 8px; }
.note-title { font-weight: 700; font-size: 14px; flex: 1; }
.note-values { font-size: 12px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.note-desc { font-size: 13px; color: var(--text-secondary); margin: 4px 0 0; white-space: pre-wrap; }
.note-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.note-meta .author { font-size: 12px; color: var(--text-muted); flex: 1; }
.icon-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-family: var(--font-body); font-size: 13px; padding: 2px 6px; border-radius: 2px;
}
.icon-btn:hover { color: var(--text-primary); background: var(--surface-2); }
.icon-btn.danger:hover { color: #e66767; }

/* 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; }

.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; }

/* 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: 11.5px; }
.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) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--grid); max-height: 45vh; }
  .chart-area { height: 60vh; }
}
