/* Telefon (seit 0.9, Paket T): Live-Hinweis (.tl-live, .tl-karte), Anrufliste, Anruf, Einrichtung. Nur Variablen (Dunkelmodus). */

/* ---------- Live-Hinweis: PC oben rechts unter dem Fensterkopf (unten rechts stehen die Rückmeldungen), Handy als Banner
   unter dem Fensterkopf. Ebene: über Fenster (20) und Statusleiste (30), unter dem Kontomenü (60) und den Rückmeldungen. ---------- */
.tl-live { position: fixed; z-index: 55; right: 20px; top: calc(var(--sb-h) + env(safe-area-inset-top) + 70px); width: min(380px, calc(100vw - 40px)); display: grid; gap: 10px; pointer-events: none; }
/* Ältere Karten kompakt, damit die neueste lesbar bleibt */
.tl-karte:not(:first-child) :is(.tl-details, .tl-mehrere) { display: none; }
.tl-live:empty { display: none; }
.tl-karte { pointer-events: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--copper); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 12px 14px 14px; display: grid; gap: 8px; animation: tl-rein .22s ease-out; }
.tl-karte.tl-verpasst { border-left-color: var(--bad); }
.tl-karte.tl-gespraech { border-left-color: var(--ok); }
.tl-karte.tl-notiz, .tl-karte.tl-vorbei, .tl-karte.tl-andere { border-left-color: var(--line-2); }
.tl-karte.tl-test { border-style: dashed; border-left-style: solid; }
.tl-kopf { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.tl-ring { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--copper-tint); color: var(--copper-dark); flex: none; }
:root[data-theme="dark"] :is(.tl-ring, .tl-art-ico) { color: var(--copper-light); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.tl-ring, .tl-art-ico) { color: var(--copper-light); } }
.tl-ring .ico { width: 17px; height: 17px; }
.tl-klingelt .tl-ring { animation: tl-puls 1.2s ease-in-out infinite; }
.tl-verpasst .tl-ring { background: var(--bad-tint); color: var(--bad); }
.tl-gespraech .tl-ring { background: var(--ok-tint); color: var(--ok); }
.tl-art { font: 600 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); flex: 1; min-width: 0; }
.tl-testmarke { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 1px dashed var(--line-2); border-radius: 4px; font-size: 11px; letter-spacing: .06em; color: var(--ink-3); vertical-align: 1px; white-space: nowrap; }
/* Eingeklappt (eigener verpasster Anruf nach 90 s): nur Kopf und Name, Tippen klappt auf */
.tl-karte.tl-klein { cursor: pointer; gap: 2px; padding-top: 8px; padding-bottom: 8px; }
.tl-karte.tl-klein :is(.tl-details, .tl-wer small, .tl-nummer, .tl-knoepfe) { display: none; }
.tl-karte.tl-klein .tl-wer strong { font-size: 17px; }
.tl-weitere { display: none; pointer-events: auto; justify-self: center; min-height: 44px; padding: 8px 18px; border-radius: 22px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); font: 500 14px/1.2 var(--sans); cursor: pointer; }
.tl-zeile { font-size: 13px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-wer { display: grid; gap: 1px; min-width: 0; }
.tl-wer strong { font: 600 22px/1.15 var(--display); overflow-wrap: anywhere; }
.tl-wer small { color: var(--ink-2); font-size: 13px; }
.tl-wer .tl-nummer { color: var(--ink-3); font-size: 13px; }
.tl-wer .tl-mehrere { color: var(--warn); }
.tl-details { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.tl-details li { display: flex; gap: 8px; align-items: flex-start; }
.tl-details .ico { width: 15px; height: 15px; margin-top: 2px; color: var(--ink-3); }
.tl-details .tl-warn { color: var(--bad); }
.tl-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-knoepfe .btn { min-height: 38px; }
@keyframes tl-rein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tl-puls { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--copper) 45%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--copper) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .tl-karte, .tl-klingelt .tl-ring { animation: none; } }
@media (max-width: 640px) {
  .tl-live { top: calc(var(--sb-h) + env(safe-area-inset-top) + 62px); left: 8px; right: 8px; width: auto; gap: 6px; }
  /* nur die neueste Karte, darunter „+N weitere“ */
  .tl-live:not(.tl-aufgeklappt) .tl-karte:not(:first-child) { display: none; }
  .tl-weitere { display: block; }
  .tl-karte { padding: 10px 12px 12px; gap: 6px; border-radius: 10px; }
  .tl-wer strong { font-size: 20px; }
  .tl-knoepfe { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .tl-knoepfe .btn { min-height: 44px; padding: 6px 8px; white-space: normal; text-align: center; line-height: 1.2; }
  .tl-karte:not(:first-child) :is(.tl-nummer, .tl-wer small) { display: none; }
  .tl-karte:not(:first-child) .tl-wer strong { font-size: 17px; }
  .tl-karte:not(:first-child) .tl-knoepfe .btn { min-height: 40px; }
}

/* ---------- Anrufliste ---------- */
.tl .card + .card { margin-top: 18px; }
.tl-start { margin-bottom: 18px; }
.tl-ohne-neben { margin: 0 0 14px; }
.tl-filter { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 16px; }
.tl-filter .seg { margin-bottom: 0; }
.tl-filter .chip { min-height: 40px; padding: 6px 14px; }
.tl-filter .tl-suche { max-width: 340px; min-width: 220px; }
.tl-start p { color: var(--ink-2); }
.tl-kunde-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.tl-richtung { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--surface-2); color: var(--ink-3); }
.tl-richtung.ein .ico { transform: rotate(135deg); }
.tl-richtung.aus .ico { transform: rotate(-45deg); }
.tl-richtung.verpasst { background: var(--bad-tint); color: var(--bad); }
.tl-richtung.aus { background: var(--info-tint); color: var(--info); }
.tl-uhr { display: grid; min-width: 46px; font-variant-numeric: tabular-nums; }
.tl-uhr b { font-weight: 600; }
.tl-uhr small { color: var(--ink-3); font-size: 12px; }
.tl-zeile-anruf.tl-offen .t { color: var(--bad); }
.tl-notiz-kurz { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-notiz-kurz .ico { display: inline-block; vertical-align: -2px; width: 13px; height: 13px; color: var(--ink-3); }
.tl-notiz-kurz small { color: var(--ink-3); }
.tl-hinweis-text { color: var(--warn); }
.tl-offene { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.tl-offene .tl-rueckruf { min-height: 40px; }
.tl-mehr { display: flex; justify-content: center; margin-top: 18px; }
.tl-ich .check-field { flex: 1; min-width: 240px; }

/* ---------- Anruf ---------- */
.tl-anruf-kopf { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.tl-anruf-kopf .tl-richtung { width: 44px; height: 44px; }
.tl-anruf-kopf h2 { margin: 0; font: 600 34px/1.05 var(--display); overflow-wrap: anywhere; }
.tl-anruf-kopf .sub { margin: 4px 0 0; color: var(--ink-3); }
.tl-anruf-kopf .grow { flex: 1; min-width: 0; }
.tl-anruf-status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tl-kv { margin: 0 0 14px; }
.tl-offen-text { color: var(--bad); font-weight: 500; }
.tl-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-nur-handy { display: none !important; }
@media (max-width: 640px) { .tl-nur-handy { display: inline-flex !important; } .tl-aktionen .btn { flex: 1 1 auto; } }
.tl-zugeordnet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-vermutlich > span { flex: 1; min-width: 200px; }
.tl-treffer-titel { margin: 14px 0 6px; font-size: 13px; color: var(--ink-2); }
.tl-treffer { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.tl-treffer li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tl-treffer li:last-child { border-bottom: 0; }
.tl-treffer .grow { flex: 1; min-width: 0; display: grid; }
.tl-treffer small { color: var(--ink-3); font-size: 12.5px; }
.tl-zuordnen { margin-top: 14px; }
.tl-zuordnen .search { max-width: none; }
.tl-notiz-wer small { font-size: 12.5px; }

/* ---------- Kundenakte: Karte „Anrufe“ ---------- */
.tl-nummern { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 0; }
.tl-nummern .chip { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.tl-kundenkarte .list li { padding-top: 11px; padding-bottom: 11px; }
/* Zeilen umbrechen statt abschneiden (die Karte steht in der schmalen Spalte der Kundenakte) */
.tl-kundenkarte .list .t { white-space: normal; overflow: visible; text-overflow: clip; }
.tl-kundenkarte .tl-notiz-kurz { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-kundenkarte .tl-richtung { width: 28px; height: 28px; }
.tl-alle { padding-top: 10px; padding-bottom: 12px; font-size: 14px; }

/* ---------- Einrichtung ---------- */
.tl-art-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--copper-tint); color: var(--copper-dark); flex: none; }
.tl-art-ico.gross { width: 52px; height: 52px; border-radius: 14px; }
.tl-art-ico.gross .ico { width: 26px; height: 26px; }
.tl-arten { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl-art-wahl { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; min-height: 56px; }
.tl-art-wahl input { width: 18px; height: 18px; accent-color: var(--copper); flex: none; }
.tl-art-wahl span:last-child { display: grid; gap: 2px; }
.tl-art-wahl small { color: var(--ink-3); font-size: 12.5px; }
.tl-art-wahl:has(input:checked) { border-color: var(--copper); background: var(--copper-tint); }
.tl-adresse { display: grid; gap: 14px; }
.tl-secret { font-size: 13px; align-items: flex-start; }
.tl-umbruch { overflow-wrap: anywhere; word-break: break-all; min-width: 0; }
.tl-downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-h3 { margin: 4px 0 0; font: 600 18px/1.2 var(--display); letter-spacing: .04em; }
.tl-schritte li { line-height: 1.55; }
.tl-befehl { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.tl-befehl code { font: 12.5px/1.45 var(--mono); overflow-wrap: anywhere; word-break: break-all; flex: 1; min-width: 0; color: var(--ink); }
.tl-personen li { flex-wrap: wrap; }
.tl-person-form { display: flex; gap: 8px; align-items: center; flex: 1 1 280px; max-width: 420px; }
.tl-person-form input { flex: 1; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); }
.list.tl-neben li select, .tl-neben select { min-height: 40px; max-width: 240px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); }
.tl-gesehen { display: grid; gap: 8px; border-top: 1px solid var(--line); }
.tl-gesehen .chip { min-height: 40px; }
.tl-aktiv { align-self: center; }
@media (max-width: 640px) {
  .tl-filter .tl-suche { max-width: none; flex-basis: 100%; }
  .tl-filter .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
  .tl-filter .chips::-webkit-scrollbar { display: none; }
  .tl-filter .chip { flex: none; }
  .tl-offene .list .end { flex-wrap: nowrap; }
  .tl-anruf-kopf h2 { font-size: 28px; }
  .tl-anruf-kopf { flex-wrap: wrap; }
  .tl-anruf-status { width: 100%; justify-content: flex-start; }
  .list.tl-neben li select, .tl-neben select { max-width: none; flex: 1; min-width: 0; }
  .tl-nummern .chip { min-height: 44px; }
  .tl-vermutlich .btn { min-height: 44px; }
  .tl-neben .end { width: 100%; }
  .tl-person-form { max-width: none; }
  .tl-treffer li { flex-wrap: wrap; }
}
