:root {
  --blue: #1d5fd6;
  --blue-dark: #123c8c;
  --red: #c0392b;
  --red-dark: #7c241a;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --border: #dfe3ea;
  --text: #222;
  --muted: #6b7280;
  --accent: var(--blue);
  --accent-dark: var(--blue-dark);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.team-red { --accent: var(--red); --accent-dark: var(--red-dark); }

a { color: var(--accent); }

.topbar {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* Kopfzeile: links Name, Mitte Uebung + Telefon, rechts Uhr + Abmelden */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.topbar-left { justify-self: start; }
.topbar-center { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.topbar-right { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.topbar-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.start-fullscreen { position: fixed; top: 16px; right: 16px; z-index: 5; }
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr; }
  .topbar-left, .topbar-center, .topbar-right { justify-self: stretch; align-items: center; text-align: center; }
}
.topbar .who { font-weight: 600; font-size: 16px; }
.topbar .exercise-name { font-weight: 600; opacity: .95; text-align: center; }
.topbar .clock {
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.nav-buttons {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  flex-wrap: wrap;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.nav-buttons button {
  position: relative;
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.nav-buttons button.active, .nav-buttons button:hover {
  background: var(--accent);
  color: #fff;
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e11d48;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

.container { padding: 16px 20px; max-width: 1200px; margin: 0 auto; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.channel-col h3 { margin-top: 0; }

.post {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  background: #fafbfc;
}

.post .author {
  font-weight: 600;
  cursor: pointer;
  color: var(--accent);
}

.post .time { color: var(--muted); font-size: 12px; margin-left: 6px; }
.post .text { margin: 6px 0; white-space: pre-wrap; }
.post .actions button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  margin-right: 6px;
  cursor: pointer;
  font-size: 12px;
}
.post .actions button.liked { background: var(--accent); color: #fff; border-color: var(--accent); }

.comment { font-size: 13px; padding: 4px 0 4px 10px; border-left: 2px solid var(--border); margin-top: 4px; }

textarea, input, select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 8px;
}

label { font-size: 13px; color: var(--muted); display: block; margin-top: 6px; }

button.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
button.primary:hover { background: var(--accent-dark); }

button.small {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}
/* .primary.small kombiniert beide Klassen -- ohne diese Regel gewinnt je nach
   Reihenfolge im Stylesheet .small's weisser Hintergrund gegen .primary's
   weisse Schrift und der Button wird unsichtbar (weiss auf weiss). */
button.primary.small {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
button.primary.small:hover { background: var(--accent-dark); }

button.success {
  background: #1a8a4a;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
button.success:hover { background: #136b39; }

button.real-run {
  background: #a600ff;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
button.real-run:hover { background: #8a00d4; }

button.content-import {
  background: #f5c518;
  color: #222;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
button.content-import:hover { background: #d9ac0a; }

.test-run-badge {
  background: #1a8a4a;
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

.lib-folder {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  padding: 4px 8px;
}
.lib-folder > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.lib-folder[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 4px; }

.paused-badge {
  background: #d98c0a;
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

/* Dashboard waehrend einer Pause: Inhalte bleiben sichtbar, sind aber nicht bedienbar */
#pauseOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
#pauseOverlay > div {
  background: #fff;
  border-radius: 10px;
  padding: 24px 32px;
  text-align: center;
  font-size: 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}

.role-list { display: flex; flex-wrap: wrap; gap: 10px; }
.role-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
  background: #fff;
  min-width: 160px;
  text-align: center;
}
.role-card:hover { border-color: var(--accent); }
.role-card .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px; font-weight: 700;
}

.start-page { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 24px; }
.start-page h1 { margin-bottom: 0; }
.start-options { display: flex; gap: 20px; }
.start-options .role-card { min-width: 180px; padding: 30px 20px; font-size: 18px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

/* Website, IntKom, What's_up: Formular links, veroeffentlichte Beitraege rechts */
.compose-layout { display: grid; grid-template-columns: minmax(300px, 2fr) 3fr; gap: 14px; align-items: start; }
.compose-layout > .panel { margin-bottom: 0; }
.compose-layout:has(> .panel.hidden) { grid-template-columns: 1fr; }
@media (max-width: 800px) { .compose-layout { grid-template-columns: 1fr; } }

/* What's_up */
.whatsup-icon { display: inline-block; vertical-align: middle; }
.nav-buttons button.whatsup-nav { display: inline-flex; align-items: center; gap: 6px; }
.whatsup-logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: #15803d; margin-bottom: 6px; }
.whatsup-channel { display: inline-block; background: #dcfce7; color: #166534; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; margin-bottom: 4px; }

/* Liste "Eingegriffen" und "Telefonie" in EC */
.log-row { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.log-row:hover { border-color: var(--accent); }
.log-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.log-table th, .log-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }

.email-row, .chat-row, .page-row, .persona-row, .account-row, .inject-row {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  background: #fafbfc;
}
.email-row.unread { border-left: 4px solid var(--accent); font-weight: 600; }

.ec-layout {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 14px;
}
@media (max-width: 1100px) { .ec-layout { grid-template-columns: 1fr; } }

.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
.checkbox-row { display: flex; gap: 14px; margin-bottom: 8px; }
.checkbox-row label { display: flex; align-items: center; gap: 4px; color: var(--text); }
.checkbox-row input { width: auto; margin: 0; }

.exercise-item, .run-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
}

/* ---------- Modale Dialoge (gemeinsam fuer Dashboard und EC) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-panel {
  max-width: 560px;
  width: 92%;
  max-height: 82vh;
  overflow: auto;
  background: #fff;
}

.feed-search { max-width: 420px; margin-bottom: 12px; }

.inject-row.fired { border-left: 4px solid #1a8a4a; }
.inject-row .fired-note { color: #1a8a4a; font-size: 12px; font-weight: 600; }

/* ---------- Auswertung ---------- */
button.violet, .violet {
  background: #7c3aed;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
button.violet:hover { background: #5b21b6; }

.eval-section h3 { margin-top: 0; }
.eval-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.eval-kpi { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fafbfc; }
.eval-kpi .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.eval-kpi .label { font-size: 12px; color: var(--muted); }

.eval-table-wrap { overflow-x: auto; }
table.eval-table { border-collapse: collapse; width: 100%; font-size: 13px; }
table.eval-table th, table.eval-table td { border-bottom: 1px solid var(--border); padding: 5px 8px; text-align: right; white-space: nowrap; }
table.eval-table th:first-child, table.eval-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
table.eval-table thead th { background: #f4f6f9; font-weight: 600; }
table.eval-table tr.sub td { color: var(--muted); }
table.eval-table tr.total td { font-weight: 700; }
table.eval-table tr td.zero { color: #c3c8d1; }
.team-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.team-dot.blue { background: var(--blue); }
.team-dot.red { background: var(--red); }

.bar-row { display: grid; grid-template-columns: 180px 1fr 60px; gap: 8px; align-items: center; margin-bottom: 4px; font-size: 13px; }
.bar-track { background: #eef1f5; border-radius: 4px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }
.bar-fill.blue { background: var(--blue); }
.bar-fill.red { background: var(--red); }
.bar-fill.violet { background: #7c3aed; }
.bar-pair .bar-track { height: 9px; margin: 1px 0; }
.bar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); column-gap: 24px; }
.bar-pair .bar-row { grid-template-columns: 70px 1fr 50px; }
@media (max-width: 600px) { .bar-row { grid-template-columns: 110px 1fr 50px; } }

.eval-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.eval-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.eval-card h4 { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: center; }
.score-pill { font-size: 13px; padding: 2px 10px; border-radius: 999px; color: #fff; font-weight: 700; }
.score-pill.s1 { background: #1a8a4a; }
.score-pill.s2 { background: #3b82f6; }
.score-pill.s3 { background: #d98c0a; }
.score-pill.s4 { background: #c0392b; }
ul.eval-bullets { margin: 6px 0 0; padding-left: 0; list-style: none; font-size: 13px; }
ul.eval-bullets li { padding: 2px 0 2px 20px; position: relative; }
ul.eval-bullets li::before { position: absolute; left: 0; }
ul.eval-bullets li.pos::before { content: '✔'; color: #1a8a4a; }
ul.eval-bullets li.neutral::before { content: '●'; color: #d98c0a; }
ul.eval-bullets li.neg::before { content: '✖'; color: #c0392b; }
.eval-note { background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 6px; padding: 8px 10px; font-size: 13px; color: #4c1d95; }
.component-grid { display: grid; grid-template-columns: 1fr 40px; gap: 2px 8px; font-size: 12px; margin-top: 6px; }

/* Druck / PDF: nur die Auswertung */
@media print {
  body.print-evaluation .topbar,
  body.print-evaluation .nav-buttons,
  body.print-evaluation .container > .view:not(#view-history),
  body.print-evaluation #view-history > .panel:first-child,
  body.print-evaluation #historyRunViewer,
  body.print-evaluation .no-print { display: none !important; }
  body.print-evaluation { background: #fff; }
  body.print-evaluation .panel { break-inside: avoid; border-color: #bbb; }
  body.print-evaluation .eval-table-wrap { overflow: visible; }
}

/* ---------- EC-Anmeldung ---------- */
#ecLoginOverlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
#ecLoginOverlay .panel { width: 340px; }
.inject-row.editing { outline: 2px solid var(--accent); }

/* Feld "Bild, Video oder Audio" (Bibliothek oder vom Computer) */
.media-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.media-picker input[type="file"] { width: auto; margin: 0; }
video { max-height: 70vh; } /* Hochkant-Handyvideos nicht hoeher als den Bildschirm */
.chat-pick, #chatSelectAll { width: auto; margin: 0 8px 0 0; vertical-align: middle; }

/* Startseite: "Passwort vergessen" (gelb) und Team-Anmeldung */
.role-card.forgot .avatar { background: #f5c518; color: #222; }
.role-card.forgot { background: #fff8d6; border-color: #f5c518; }
.role-card.forgot:hover { border-color: #d9ac0a; }
.team-login { max-width: 360px; }

/* Einstellungen: Zugangsschutz (aktuelles Passwort mit Augensymbol) */
.pw-panel { max-width: 520px; }
.pw-current { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.pw-value { font-family: monospace; font-size: 15px; background: #f3f4f6; padding: 2px 8px; border-radius: 4px; }

/* ---------- Logos der Social-Media-Kanaele ---------- */
.channel-logo { width: 114px; height: 76px; margin: 0 0 10px; }
.channel-logo svg { display: block; box-shadow: 0 1px 4px rgba(0,0,0,.25); border-radius: 12px; }

/* ---------- Uhr oben rechts: Datum, Uhrzeit mit Sekunden, Countdown ---------- */
.topbar .clock { display: flex; align-items: center; gap: 10px; padding: 6px 14px; flex-wrap: wrap; }
.topbar .clock .clock-date { font-size: 14px; opacity: .85; }
.topbar .clock .clock-time { font-size: 30px; font-weight: 700; line-height: 1.1; }
.topbar .clock .clock-elapsed { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.topbar .clock .clock-elapsed-label { font-size: 13px; font-weight: 400; opacity: .85; }
.topbar .clock .clock-countdown { font-size: 26px; font-weight: 700; line-height: 1.1; color: #fde68a; }
.topbar .clock .clock-countdown.over { color: #fecaca; }

/* ---------- Telefon ---------- */
.phone-bar { display: flex; align-items: center; gap: 6px; }
.phone-bar .phone-select { width: auto; max-width: 240px; margin: 0; padding: 5px 6px; }
.phone-bar .phone-status { font-size: 13px; font-weight: 600; max-width: 320px; }
.phone-bar .phone-audio { display: none; }
.phone-bar { flex-wrap: wrap; justify-content: center; }
.phone-missed {
  position: relative; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 3px 8px; font-size: 13px; font-weight: 600;
}
.phone-missed button.small { margin: 0; padding: 2px 8px; font-size: 12px; }
.phone-missed-toggle { background: transparent; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; margin: 0; }
.phone-missed-time { font-weight: 400; }
.phone-missed-list {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 2000; min-width: 320px; max-height: 320px; overflow: auto;
  background: #fff; color: #222; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 4px 0; text-align: left;
}
.phone-missed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; }
.phone-missed-row + .phone-missed-row { border-top: 1px solid #eee; }
.phone-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid #fff;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; padding: 0; margin: 0;
}
.phone-btn.phone-call { background: #16a34a; }
.phone-btn.phone-call:hover { background: #15803d; }
.phone-btn.phone-hangup { background: #dc2626; }
.phone-btn.phone-hangup:hover { background: #b91c1c; }
.phone-btn.phone-hangup svg { transform: rotate(135deg); }
.phone-bar.in-call .phone-hangup { animation: phone-pulse 1.2s infinite; }
.phone-btn.big { width: 72px; height: 72px; }
.phone-btn.big svg { width: 36px; height: 36px; }

.incoming-call {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
}
.incoming-call-box {
  background: #fff; border-radius: 16px; padding: 28px 40px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.4); min-width: 300px;
}
.incoming-call-icon { color: #16a34a; animation: phone-shake .5s infinite; display: inline-block; }
.incoming-call-icon svg { width: 48px; height: 48px; }
.incoming-call-title { font-size: 16px; color: #555; margin-top: 6px; }
.incoming-call-name { font-size: 26px; font-weight: 700; margin: 4px 0 18px; }
.incoming-call-buttons { display: flex; gap: 48px; justify-content: center; margin-bottom: 12px; }
.incoming-call-buttons .phone-call { animation: phone-pulse 1s infinite; }

@keyframes phone-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } }
@keyframes phone-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-15deg); } 75% { transform: rotate(15deg); } }

@media print {
  .phone-bar, .incoming-call { display: none !important; }
}

/* ---------- Texte fuer die KI (Gruppe anlegen, BotSchwarm) ---------- */
.ai-prompt-text { font-family: Consolas, "Courier New", monospace; font-size: 12px; background: #f8fafc; }
details.ai-prompt { margin: 6px 0 10px; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
details.ai-prompt > summary { cursor: pointer; font-weight: 600; }

/* ---------- Profilbild gross anzeigen (Kanal-Profil im Dashboard) ---------- */
.avatar-zoomable { cursor: zoom-in; display: inline-block; }
.avatar-zoomable img { transition: transform .15s; }
.avatar-zoomable:hover img { transform: scale(1.08); }
.avatar-zoom-backdrop {
  position: fixed; inset: 0; z-index: 2500; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.avatar-zoom-backdrop img {
  /* feste Groesse: auch kleine Profilbilder erscheinen gross */
  width: min(80vw, 80vh, 560px); height: min(80vw, 80vh, 560px); object-fit: contain; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #fff;
}

/* Timeline: Vorgeschichte je Gruppe aufklappbar */
details.history-group { margin: 0 0 8px; border: 1px solid var(--border); border-radius: 6px; background: #f8fafc; }
details.history-group > summary { cursor: pointer; padding: 8px 10px; list-style-position: inside; }
details.history-group[open] > summary { border-bottom: 1px solid var(--border); }
details.history-group .inject-row { margin: 6px 8px; }
.timeline-current-label { margin: 10px 0 6px; font-weight: 600; }

/* ---------- Tag/Nacht-Schalter der Dashboards (Nacht: weisse Schrift auf Schwarz) ---------- */
.daynight { display: inline-flex; margin-top: 6px; border: 1px solid rgba(255,255,255,0.6); border-radius: 999px; overflow: hidden; }
.daynight button { background: transparent; color: #fff; border: 0; padding: 3px 10px; cursor: pointer; font-size: 12px; }
.daynight button.on { background: #fff; color: var(--accent-dark); font-weight: 700; }

html.night body { --bg: #000; --panel: #111; --border: #333; --text: #fff; --muted: #a8a8a8; --accent-text: #8fb4ff; background: #000; color: #fff; }
html.night body.team-red { --accent-text: #ff9b8f; }
html.night .topbar { background: var(--accent-dark); }
html.night .panel { background: #111; border-color: #333; color: #fff; }
html.night .post, html.night .email-row, html.night .chat-row, html.night .page-row, html.night .persona-row,
html.night .account-row, html.night .log-row, html.night .modal-panel, html.night .phone-missed-list,
html.night .incoming-call-box, html.night .role-card, html.night #pauseOverlay > div { background: #161616; color: #fff; border-color: #333; }
html.night textarea, html.night input, html.night select { background: #1b1b1b; color: #fff; border-color: #3a3a3a; }
html.night textarea::placeholder, html.night input::placeholder { color: #8a8a8a; }
html.night input::file-selector-button { background: #2a2a2a; color: #fff; border: 1px solid #444; border-radius: 4px; }
html.night button.small:not(.primary), html.night .post .actions button { background: #1e1e1e; color: #fff; border-color: #3a3a3a; }
html.night .nav-buttons button { background: #1e1e1e; color: var(--accent-text); }
html.night .nav-buttons button.active, html.night .nav-buttons button:hover { background: var(--accent); color: #fff; }
html.night .post .actions button.liked { background: var(--accent); border-color: var(--accent); }
html.night .muted, html.night .post .time, html.night label { color: #a8a8a8; }
/* Namen und Links nachts in helleren Teamfarben, damit sie auf Schwarz gut lesbar sind */
html.night a, html.night .post .author { color: var(--accent-text); }
html.night .whatsup-channel { background: #14532d; color: #bbf7d0; }

/* ---------- Startseite „Nachtlage“: Netz des Informationsraums, Radar, Hotspots ---------- */
body.start-body {
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 35%, rgba(0,0,0,0.75) 100%),
    radial-gradient(circle at 8% 100%, rgba(29,95,214,0.35), transparent 40%),
    radial-gradient(circle at 92% 100%, rgba(220,38,38,0.32), transparent 40%),
    url("../img/start-netz.svg") center/cover no-repeat,
    radial-gradient(ellipse at 50% 35%, #14305e, #070f22 55%, #02050d);
}
body.start-body .bg-rings { position: fixed; left: 50%; top: 42%; pointer-events: none; }
body.start-body .bg-rings i { position: absolute; width: var(--s); height: var(--s); border: 1px solid rgba(140,180,255,0.16); border-radius: 50%; transform: translate(-50%,-50%); }
body.start-body .bg-sweep { position: fixed; left: 50%; top: 42%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(120,170,255,0.20), rgba(120,170,255,0) 12%, transparent 100%); mix-blend-mode: screen; animation: start-sweep 9s linear infinite; }
body.start-body .bg-hot { position: fixed; width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 14px 4px rgba(255,60,60,0.8); pointer-events: none; }
body.start-body .bg-hot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(255,77,77,0.8); animation: start-pulse 2.4s ease-out infinite; animation-delay: inherit; }
@keyframes start-sweep { to { transform: rotate(360deg); } }
@keyframes start-pulse { from { transform: scale(1); opacity: 1; } to { transform: scale(7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body.start-body .bg-sweep, body.start-body .bg-hot::after { animation: none; } }
body.start-body .start-page { position: relative; z-index: 1; overflow-y: auto; }
body.start-body .start-page h1 { color: #fff; font-size: 56px; letter-spacing: 3px; text-shadow: 0 0 18px rgba(110,160,255,0.85), 0 0 42px rgba(60,110,255,0.55); }
body.start-body .start-page h2, body.start-body .start-page > div > p { color: #fff; }
body.start-body .start-page .muted { color: #c9d8f5; }
body.start-body .start-sub { letter-spacing: 3px; text-transform: uppercase; font-size: 13px; }
body.start-body .start-sub b { color: #ff5a5a; font-weight: 400; }
body.start-body .role-card { background: rgba(255,255,255,0.96); box-shadow: 0 0 0 1px rgba(140,180,255,0.35), 0 12px 40px rgba(0,0,0,0.6); transition: transform .15s, box-shadow .15s; }
body.start-body .role-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px rgba(140,180,255,0.8), 0 16px 48px rgba(0,0,0,0.7); }
body.start-body .role-card.forgot { background: rgba(255,248,214,0.96); }
body.start-body .team-login, body.start-body .team-login h3 { color: #222; }
body.start-body .team-login .muted { color: var(--muted); }

/* ---------- Lagekarte ---------- */
.lk-layout { display: grid; grid-template-columns: 1fr 340px; gap: 12px; align-items: start; }
@media (max-width: 900px) { .lk-layout { grid-template-columns: 1fr; } }
.lk-map-panel { position: relative; padding: 0; overflow: hidden; }
.lk-map { height: calc(100vh - 230px); min-height: 420px; width: 100%; }
.lk-fit-btn { position: absolute; top: 10px; right: 10px; z-index: 500; }
.lk-list-panel { max-height: calc(100vh - 230px); overflow: auto; }
.lk-item { border-left: 4px solid #c62828; padding: 6px 8px; margin-bottom: 8px; cursor: pointer; border-radius: 4px; }
.lk-item:hover { background: rgba(198, 40, 40, .08); }
.lk-item-new { background: rgba(198, 40, 40, .12); }
.lk-item-time, .lk-popup-time { font-size: 12px; color: var(--muted); }
.lk-item-text, .lk-popup-text { font-size: 13px; white-space: pre-wrap; margin-top: 2px; }
.lk-marker { background: #d32f2f; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(211, 47, 47, .5), 0 1px 4px rgba(0, 0, 0, .5);
  color: #fff; font: bold 11px/18px sans-serif; text-align: center; }
.lk-marker-new { animation: lk-pulse 1.6s ease-out infinite; }
@keyframes lk-pulse { 0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, .8), 0 1px 4px rgba(0, 0, 0, .5); }
  100% { box-shadow: 0 0 0 16px rgba(211, 47, 47, 0), 0 1px 4px rgba(0, 0, 0, .5); } }
.leaflet-tooltip.lk-label { background: #fff; color: #111; border: 1px solid #d32f2f; border-radius: 4px; padding: 3px 6px;
  font-size: 12px; line-height: 1.3; max-width: 220px; white-space: normal; width: max-content; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); cursor: pointer; }
.leaflet-tooltip.lk-label::before { border-top-color: #d32f2f; }
.lk-label-row b { color: #b71c1c; }
.lk-label-row.lk-new { font-weight: 600; }
.lk-popup-item + .lk-popup-item { border-top: 1px solid #ddd; margin-top: 6px; padding-top: 6px; }
html.night .lk-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
html.night .lk-map { background: #111; }
html.night .lk-item:hover, html.night .lk-item-new { background: rgba(239, 83, 80, .18); }
.lk-popup .leaflet-popup-content-wrapper, .lk-popup .lk-popup-time { color: #111; }
.lk-popup .lk-popup-time { color: #666; }
.lk-label-more { font-size: 11px; color: #666; }
.lk-warning { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 7px 12px; font-size: 13px;
  background: #fff8e1; color: #5d4300; border: 1px solid #f0c040; border-left: 5px solid #f9a825; border-radius: 4px; }
.lk-warning b { color: #8a5a00; }
.lk-warning-icon { font-size: 17px; line-height: 1; color: #e69500; }
html.night .lk-warning { background: #2a2100; color: #ffe08a; border-color: #6b5200; border-left-color: #f9a825; }
html.night .lk-warning b { color: #ffc947; }
#injMapFields.map-entry-box:not(.hidden) { border-left: 4px solid #d32f2f; padding: 4px 0 4px 10px; margin: 6px 0 10px; }

/* Loeschen-Knopf direkt in Account-/Persona-Zeilen (EC-Setup) */
.account-row, .persona-row { position: relative; padding-right: 96px; }
.row-delete-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin: 0; color: #b71c1c; border-color: #e0a0a0; }
.row-delete-btn:hover { background: #fdecea; border-color: #b71c1c; }
html.night .row-delete-btn { color: #ff8a80; border-color: #6b2b2b; }
