/* ==========================================================================
   AppDesigns · Mindmap – ergänzt app.css
   ========================================================================== */

.mm-abstand { margin-top: 16px; }
.mm-spalte { display: grid; gap: 24px; }
.mm-spalte .card + .card { margin-top: 0; }

/* Zurück-Link über der Überschrift */
.mm-zurueck { margin: 0 0 12px; font-size: 15px; }
.mm-zurueck a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.mm-zurueck .i { width: 18px; height: 18px; vertical-align: 0; }

/* Übersicht: neue Mindmap */
.mm-neu { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.mm-neu-feld { position: relative; flex: 1; min-width: 0; }
.mm-neu-feld small { position: absolute; top: 100%; left: 0; }
.mm-neu .btn { min-height: 52px; }
.mm-aktion-zelle { width: 60px; text-align: right; }
.mm-aktion-zelle form { margin: 0; }

/* ---------- Arbeitsbereich ---------- */
.mm-bereich { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }

.mm-flaeche {
  position: relative;
  overflow: hidden;
  height: clamp(460px, calc(100vh - 330px), 1100px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--soft);
  background-image: radial-gradient(#cfd6e1 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mm-flaeche.mm-schiebt { cursor: grabbing; }
.mm-welt { position: absolute; left: 0; top: 0; }
.mm-linien { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.mm-linien path { fill: none; stroke: #b8c0cc; stroke-width: 2; }

/* ---------- Kästen ---------- */
.mm-knoten {
  position: absolute;
  width: max-content;
  min-width: 170px;
  max-width: 260px;
  display: grid;
  gap: 4px;
  padding: 14px 18px 16px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px rgba(12, 17, 30, 0.06);
  color: var(--ink);
  line-height: 1.35;
  cursor: pointer;
  touch-action: none;
}
.mm-darf .mm-knoten { cursor: grab; }
.mm-knoten:focus { outline: none; }
.mm-knoten:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.mm-knoten.mm-aktiv { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(65, 113, 179, 0.22), 0 6px 18px rgba(12, 17, 30, 0.08); }
.mm-knoten.mm-zieht { cursor: grabbing; z-index: 2; box-shadow: 0 18px 40px rgba(12, 17, 30, 0.18); }
.mm-knoten [hidden] { display: none; }

/* Bezeichnung mit Ebenen-Farbe aus dem Logo-Spektrum */
.mm-bez { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.mm-bez::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--dot, var(--s2)); }
.mm-bez[hidden] { display: none; }
.mm-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.mm-beschr {
  font-size: 14px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.mm-link {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start;
  max-width: 100%; margin-top: 4px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mm-link:hover { text-decoration: underline; }
.mm-link .i { width: 15px; height: 15px; vertical-align: 0; }

/* Hauptkasten: schwarz mit Spektrum-Leiste wie die Kopfleiste */
.mm-knoten.mm-wurzel {
  min-width: 200px;
  padding: 16px 22px 24px;
  background: var(--black);
  border-color: var(--black);
  border-radius: 20px;
  color: var(--white);
}
.mm-wurzel::after {
  content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 5px; border-radius: 5px 5px 0 0;
  background: linear-gradient(90deg,
    var(--s1) 0 14.285%, var(--s2) 0 28.57%, var(--s3) 0 42.855%, var(--s4) 0 57.14%,
    var(--s5) 0 71.425%, var(--s6) 0 85.71%, var(--s7) 0 100%);
}
.mm-wurzel .mm-bez { color: #9aa3b5; }
.mm-wurzel .mm-bez::before { display: none; }
.mm-wurzel .mm-name { font-size: 19px; }
.mm-wurzel .mm-beschr { color: #c4cbd8; }
.mm-wurzel .mm-link { color: #8fb4e8; }
.mm-knoten.mm-wurzel.mm-aktiv { border-color: var(--brand); }

/* ---------- Seitenbereich ---------- */
.mm-panel { position: sticky; top: 130px; padding: 24px; }
.mm-panel h2 { margin-bottom: 10px; }
.mm-panel textarea { min-height: 96px; }
.mm-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.mm-knoepfe .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
.mm-knoepfe .btn[hidden] { display: none; }
.mm-status { margin: 12px 0 0; min-height: 1.5em; color: var(--muted); }
.mm-tipp { margin: 4px 0 0; }
.mm-details .mm-bez { margin-bottom: 8px; }
.mm-details p { white-space: pre-line; overflow-wrap: anywhere; }
.mm-details .btn { margin-top: 8px; }
.mm-details .btn[hidden] { display: none; }

/* ---------- Responsiv ---------- */
@media (max-width: 960px) {
  .mm-bereich { grid-template-columns: 1fr; }
  .mm-panel { position: static; }
  .mm-flaeche { height: 62vh; min-height: 380px; }
}
@media (max-width: 720px) {
  .mm-neu { flex-direction: column; align-items: stretch; }
  .mm-neu-feld small { position: static; }
  .mm-aktion-zelle { width: auto; text-align: left; }
  .mm-aktion-zelle::before { display: none; }
  .kopf-knoepfe, .kopf-knoepfe .btn { width: 100%; }
}
