/* ==========================================================================
   Kontakte (js/views/kontakte.js): Liste, Detail, Formular und der Bereich
   „Kontakte“ auf Projekt und Immobilie. Farben nur über die Tokens aus css/app.css.
   ========================================================================== */
.kt-liste { padding: 0; overflow: hidden; }
.kt-liste .tx-filter { display: flex; gap: 8px; padding: 10px 16px 4px; flex-wrap: wrap; }
.kt-inhalt { padding: 6px 8px 8px; }

/* Zeile: Avatar, Name und Kategorie, Erreichbarkeit, Zugriff */
.kt-zeile { display: grid; grid-template-columns: 40px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .9fr) 16px; align-items: center; gap: 12px;
  width: 100%; padding: 10px; border: 0; border-radius: var(--r-mittel); background: none; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.kt-zeile:hover { background: var(--hover); }
.kt-zeile:focus-visible { outline: none; box-shadow: var(--ring); }
.kt-zeile > svg { color: var(--ink-3); }
.kt-karte .kt-zeile { grid-template-columns: 40px minmax(0, 1.6fr) minmax(0, 1fr) 16px; }
/* Beispiel in der Tour: schmale Karte, nur Name und Kategorie */
.tb-karte .kt-zeile { grid-template-columns: 40px minmax(0, 1fr) 16px; }
.tb-karte .kt-zeile .kt-kontakt, .tb-karte .kt-zeile .kt-zugriff { display: none; }
.kt-avatar { width: 40px; height: 40px; border-radius: var(--r-rund); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text);
  font-size: 14px; font-weight: 650; letter-spacing: .02em; }
.kt-avatar.firma { border-radius: var(--r-mittel); background: var(--inset); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.kt-avatar.gross { width: 52px; height: 52px; font-size: 17px; }
.kt-haupt, .kt-kontakt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kt-haupt b { font-weight: 600; font-size: 14px; }
.kt-unter, .kt-kontakt { font-size: 12.5px; color: var(--ink-3); }
.kt-kontakt { font-variant-numeric: tabular-nums; }
.kt-zugriff { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--ink-3); }
.kt-zugriff span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kt-zugriff svg { flex: none; }
.kt-zugriff.geteilt { color: var(--accent-text); }

/* Bereich auf Projekt und Immobilie */
.kt-karte .card-head { margin-bottom: 4px; }
.kt-abschnitt { margin: 12px 10px 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.kt-karte > .kt-abschnitt:first-of-type { margin-top: 2px; }

/* Detail */
.kt-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.kt-detail-kopf { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
.kt-art { font-weight: 600; }
.kt-gruppe .h3 { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.kt-feld { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kt-feld > span { color: var(--ink-3); flex: none; }
.kt-feld > b { font-weight: 550; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.kt-feld a { color: var(--accent-text); text-decoration: none; }
.kt-feld a:hover { text-decoration: underline; }
.kt-recht { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kt-recht > span:last-child { color: var(--ink-3); flex: none; }
.kt-recht-wer { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.kt-recht-wer svg { flex: none; color: var(--ink-3); }
.kt-hinweis { margin: 8px 0 0; }

/* Formular */
.kt-form { display: flex; flex-direction: column; gap: 18px; }
.kt-form-gruppe { display: flex; flex-direction: column; gap: 10px; }
.kt-form-gruppe > .h3 { margin: 0; font-size: 13px; color: var(--ink-2); }
.kt-zuordnungen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kt-chip { gap: 6px; padding-right: 4px; }
.kt-chip-x { width: 22px; height: 22px; border: 0; border-radius: var(--r-rund); background: none; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.kt-chip-x:hover { background: var(--hover); color: var(--ink); }
.kt-chip-x:focus-visible { outline: none; box-shadow: var(--ring); }

@media (max-width: 760px) {
  .kt-zeile, .kt-karte .kt-zeile, .tb-karte .kt-zeile { grid-template-columns: 40px minmax(0, 1fr) 16px; }
  .kt-zeile .kt-kontakt, .kt-zeile .kt-zugriff { display: none; }
  .kt-detail { grid-template-columns: minmax(0, 1fr); }
  .kt-liste .tx-filter { padding: 10px 12px 4px; }
}

/* Zuordnen: Auswahl mit Kästchen (mehrere Projekte, Immobilien, Einheiten) */
.kt-zu-chips { display: contents; }
.kt-zu-pop { display: flex; flex-direction: column; gap: 2px; padding: 6px; width: min(360px, calc(100vw - 40px)); max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.kt-zu-pop .check { padding: 7px 8px; border-radius: var(--r-mittel); }
.kt-zu-pop .check:hover { background: var(--hover, var(--inset)); }

/* ---------- Seite Kontakte (#/kontakte, Bereich Mieter): Gruppen je Kategorie, Schnellaktionen rechts ---------- */
.kt-seite { display: flex; flex-direction: column; gap: var(--abstand-karten); }
.kt-kopfzeile { padding: 0 4px; }
.kt-gruppe-karte { padding: 8px; }
.kt-gruppe-titel { margin: 0; padding: 10px 10px 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: baseline; gap: 8px; }
.kt-reihe { display: flex; align-items: center; gap: 4px; border-radius: var(--r-mittel); }
.kt-reihe + .kt-reihe { box-shadow: inset 0 1px 0 var(--line); }
.kt-reihe > .kt-zeile { flex: 1; min-width: 0; }
.kt-reihe .kt-zeile { grid-template-columns: 40px minmax(0, 1.6fr) minmax(0, 1fr) 20px 16px; }
.kt-aktionen { display: inline-flex; gap: 2px; flex: none; min-width: 72px; justify-content: flex-end; padding-right: 4px; }
.kt-reihe.aw-modus .kt-aktionen { visibility: hidden; }
.kt-reihe .aw-kasten { margin-left: 8px; }
@media (max-width: 760px) {
  .kt-reihe .kt-zeile { grid-template-columns: 40px minmax(0, 1fr) 16px; padding: 10px 6px; }
  .kt-reihe .kt-zeile .kt-kontakt, .kt-reihe .kt-zeile .kt-zugriff { display: none; }
  .kt-aktionen { min-width: 0; }
}
@media (pointer: coarse) { .kt-aktionen .btn.sm { min-width: 44px; min-height: 44px; } }
