/* ══════════════════════════════════════════════════════════════════════════
   platform/admin/assets/tickets.css — Konsole „Tickets“
   Ergänzt konsole.css (Tokens aus shell.css). Aufbau:
     Desktop ≥ 1024  drei Spalten wie im Ticket-Modul der App: Ansichten/
                     Ordner | Liste | Ticket; jede Spalte scrollt für sich,
                     die Seite selbst nicht. Ordnerleiste mit Anker (gelöst =
                     Symbolleiste, klappt beim Darüberfahren auf).
     ≤ 1023          Liste und Ticket als getrennte Ansichten („← Tickets“),
                     Ansichten/Ordner als Klappmenü über der Liste.
     ≤ 767           Sammelaktionen erst bei Auswahl (gelbe Leiste).
   Breakpoints nur 479 / 767 / 1023, Touch-Ziele ≥ 44px ab ≤ 767.
   ══════════════════════════════════════════════════════════════════════════ */

/* Badge im Menü */
.k-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: #d64545; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.k-badge[hidden] { display: none; }

/* Zusätzliche Chip-Farben (Status wie im Ticket-Modul der App) */
.status-chip.is-pink, .tk-badge.is-pink { background: #fce7f3; color: #9d174d; }
.status-chip.is-lila, .tk-badge.is-lila { background: #ede9fe; color: #5b21b6; }

/* ── Rahmen ───────────────────────────────────────────────────────────── */
.k-main > .tk-app { max-width: 1600px; width: 100%; }
/* Desktop: Seite füllt die Höhe, Liste und Detail scrollen getrennt */
.k-main:has(> .tk-app) { display: flex; flex-direction: column; overflow: hidden; padding-bottom: calc(var(--panel-pad) + var(--safe-b)); }
.tk-app { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.tk-kopf { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tk-kopf-titel { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tk-kopf-zahl { color: var(--text-muted); font-size: 13px; }
.tk-kopfknoepfe { display: flex; gap: 8px; }
.tk-kopfknoepfe .btn { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; }


/* ── Werkzeugleiste: Filter links, Sammelaktionen rechts (wie bisher) ── */
.tk-werkzeug { flex: none; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; min-width: 0; }
.tk-wz-links, .tk-wz-rechts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; min-width: 0; }
.tk-wz-feld { display: flex; flex-direction: column; min-width: 0; }
.tk-wz-feld label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); margin-bottom: 3px; white-space: nowrap; }
.tk-wz-feld select, .tk-f select {
  height: 36px; padding: 0 8px; max-width: 220px;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface);
  font: inherit; font-size: 13px; color: var(--text);
}
.tk-wz-feld select:focus, .tk-f select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft, #fdf3e3); }
.tk-wz-feld select[disabled], .tk-f select[disabled] { opacity: 0.55; cursor: not-allowed; }
.tk-wz-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; flex: none;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tk-wz-knopf:hover:not([disabled]) { border-color: var(--accent); }
.tk-wz-knopf[disabled] { opacity: 0.5; cursor: default; }
.tk-wz-knopf[hidden] { display: none; }
.tk-wz-knopf:focus-visible, .tk-textknopf:focus-visible, .tk-ordnerzeile:focus-visible, .tk-stk:focus-visible, .tk-anker:focus-visible,
.tk-ordner-neu:focus-visible, .tk-oz-mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-reload { width: 36px; padding: 0; font-size: 17px; }
.tk-reload.dreht { animation: tk-dreh 0.6s ease; }
@keyframes tk-dreh { to { transform: rotate(360deg); } }
.tk-filterknopf[aria-expanded="true"] { border-color: var(--brand); }
.tk-filterknopf.hat-filter { background: var(--accent-soft, #fdf3e3); border-color: var(--accent); }
.tk-filterknopf .tk-zahl { background: var(--brand); color: #fff; }
.tk-leiste-schalter { display: none; max-width: 100%; }
.tk-leiste-schalter-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tk-pfeil { font-size: 11px; color: var(--text-muted); transition: transform 0.15s; }
.tk-leiste-offen .tk-pfeil { transform: rotate(180deg); }
#tk-m-mig { color: var(--warning-ink, #8f5510); }
.tk-zahl { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--neutral-soft, #eef1f5); color: var(--neutral-ink, #4b5563); font-size: 11px; font-weight: 700; text-align: center; line-height: 1.4; }
.tk-zahl[hidden] { display: none; }

.tk-filterfeld {
  flex: none; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end;
  margin-bottom: 10px; padding: 10px; background: var(--surface-2, #f4f6f9); border-radius: 10px;
}
.tk-filterfeld[hidden] { display: none; }
.tk-f { min-width: 140px; }
.tk-f label { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); margin-bottom: 3px; }
.tk-f select { width: 100%; max-width: none; }
.tk-f-reset { min-width: 0; display: flex; align-items: flex-end; }

.tk-textknopf {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--brand);
  text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px;
}
.tk-textknopf[disabled] { opacity: 0.4; cursor: default; text-decoration: none; }
.tk-rot { color: var(--danger-ink, #98301f); text-decoration-color: var(--danger-line, #efc9c3); }

/* ── Drei Spalten: Ansichten/Ordner | Liste | Detail ─────────────────── */
.tk-split {
  flex: 1; min-height: 0; position: relative;
  display: grid; grid-template-columns: 232px clamp(330px, 31%, 440px) minmax(0, 1fr); gap: 14px;
}
.tk-leiste, .tk-master, .tk-detail {
  min-height: 0; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-card, none);
}
.tk-leiste { overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 10px; }
.tk-master { display: flex; flex-direction: column; overflow: hidden; }
.tk-liste { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.tk-detail { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; outline: none; }

/* Ordnerleiste (E-Mail-Postfach-Stil) */
.tk-leiste-kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px 4px 14px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
}
.tk-leiste-kopf-ordner { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.tk-anker {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--text-muted); cursor: pointer;
}
.tk-anker:hover { background: var(--surface-2, #f4f6f9); color: var(--text); }
.tk-anker[aria-pressed="false"] { color: var(--accent); }
.tk-ordner-neu {
  height: 26px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0; cursor: pointer;
}
.tk-ordner-neu:hover { border-color: var(--accent); }
.tk-ordnerleiste { list-style: none; margin: 0; padding: 2px 6px; display: flex; flex-direction: column; gap: 1px; }
.tk-ordnerleiste > li { position: relative; display: flex; align-items: center; min-width: 0; }
.tk-ordnerzeile {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: 13px; color: var(--text);
}
.tk-ordnerzeile:hover { background: var(--surface-2, #f4f6f9); }
.tk-ordnerzeile.aktiv { background: var(--info-soft, #e9eff7); border-color: #cfdcee; font-weight: 700; color: var(--brand); }
.tk-ansicht.aktiv { background: #ede9fe; border-color: #c4b5fd; color: #4c1d95; }
.tk-ordnerzeile.tk-drop { background: var(--success-soft, #e6f4ec); border-color: #86efac; box-shadow: inset 0 0 0 1px #86efac; }
.tk-oz-icon { flex: none; width: 18px; text-align: center; font-size: 14px; line-height: 1; }
.tk-oz-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-oz-zahl { flex: none; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #64748b; color: #fff; font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.5; }
.tk-oz-zahl.leer { background: var(--neutral-soft, #eef1f5); color: var(--text-muted); }
.tk-oz-zahl.rot { background: #d64545; color: #fff; }
.tk-oz-aktionen { position: absolute; right: 34px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; }
.tk-ordner-li:hover .tk-oz-aktionen, .tk-ordner-li:focus-within .tk-oz-aktionen { display: flex; }
.tk-oz-mini {
  width: 24px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-muted); font-size: 12px; line-height: 1; cursor: pointer;
}
.tk-oz-mini:hover { color: var(--text); border-color: var(--accent); }
.tk-oz-weg:hover { color: var(--danger-ink, #98301f); background: var(--danger-soft, #fbeae7); }
.tk-ordner-li.sortierbar .tk-ordnerknopf { cursor: grab; }
.tk-ordner-li.tk-sortiert { opacity: 0.55; }
body.tk-zieht-ordner, body.tk-zieht-ordner * { cursor: grabbing !important; user-select: none; }
.tk-leiste-tipp { margin: 10px 14px 0; font-size: 11px; line-height: 1.45; color: var(--text-muted); }

/* gelöst (Anker): schmale Symbolleiste, klappt beim Darüberfahren über die Liste auf */
@media (min-width: 1024px) {
  .tk-geloest .tk-split { grid-template-columns: 52px clamp(330px, 33%, 460px) minmax(0, 1fr); }
  .tk-geloest:not(.tk-schwebt) .tk-leiste .tk-oz-name, .tk-geloest:not(.tk-schwebt) .tk-leiste-kopf span,
  .tk-geloest:not(.tk-schwebt) .tk-ordner-neu, .tk-geloest:not(.tk-schwebt) .tk-leiste-tipp,
  .tk-geloest:not(.tk-schwebt) .tk-oz-aktionen { display: none !important; }
  .tk-geloest:not(.tk-schwebt) .tk-leiste-kopf { justify-content: center; padding: 8px 0 4px; }
  .tk-geloest:not(.tk-schwebt) .tk-ordnerzeile { flex-direction: column; gap: 2px; padding: 4px 0; min-height: 42px; justify-content: center; }
  .tk-geloest:not(.tk-schwebt) .tk-oz-zahl { font-size: 9.5px; min-width: 16px; padding: 0 4px; }
  .tk-geloest.tk-schwebt .tk-leiste {
    position: absolute; left: 0; top: 0; bottom: 0; width: 230px; z-index: 6;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  }
}

/* ── Liste ────────────────────────────────────────────────────────────── */
.tk-master-kopf { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-bottom: 1px solid var(--border); }
.tk-suchfeld { position: relative; display: block; min-width: 0; }
.tk-suchfeld svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.tk-suchfeld input {
  width: 100%; height: 38px; padding: 0 12px 0 36px; box-sizing: border-box;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface);
  font: inherit; font-size: 13px; color: var(--text);
}
.tk-suchfeld input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft, #fdf3e3); }
.tk-listenkopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.tk-alle { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; cursor: pointer; font-weight: 600; color: var(--text); padding-left: 3px; }
.tk-alle input, .tk-check input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.tk-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-weight: 600; min-width: 0; }
.tk-sort select {
  height: 30px; padding: 0 6px; max-width: 180px; min-width: 0;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); font: inherit; font-size: 12.5px; color: var(--text);
}

.tk-sammel { margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2, #f4f6f9); font-size: 12px; color: var(--text-muted); }
.tk-sammel strong { color: var(--text); }

.tk-leer { padding: 32px 16px; text-align: center; color: var(--text-muted); }
.tk-eintrag {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto;
  border-bottom: 1px solid var(--border);
}
.tk-check { grid-row: 1 / span 2; display: flex; align-items: flex-start; justify-content: center; padding-top: 13px; cursor: pointer; }
.tk-eintrag-link {
  grid-column: 2; min-width: 0;
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 0 8px; align-items: start;
  padding: 10px 12px 4px 0; color: inherit; text-decoration: none;
}
.tk-zeile-fuss { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 2px 12px 10px 16px; min-width: 0; }
.tk-eintrag:hover { background: var(--surface-2, #f4f6f9); }
.tk-eintrag-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tk-eintrag.ist-aktiv { background: var(--info-soft, #e9eff7); box-shadow: inset 3px 0 0 var(--brand); }
.tk-eintrag.ist-gewaehlt:not(.ist-aktiv) { background: #fffbeb; }
.tk-eintrag.tk-zieht-zeile { opacity: 0.45; }
body.tk-zieht, body.tk-zieht * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.tk-geist {
  position: fixed; z-index: 1000; pointer-events: none; max-width: 280px; padding: 6px 10px;
  background: var(--brand); color: #fff; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.tk-punkt { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.ist-ungelesen .tk-punkt { background: var(--accent2, #b08d52); box-shadow: 0 0 0 3px var(--accent-soft, #fdf3e3); }
.tk-eintrag-haupt { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tk-eintrag-titel {
  font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--brand); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ist-ungelesen .tk-eintrag-titel { font-weight: 800; }
.tk-schloss { font-size: 0.85em; }
.tk-eintrag-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 5px; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; min-width: 0; }
.tk-nr { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; }
.tk-trenner { opacity: 0.6; }
.tk-eintrag-rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; }
.tk-zeit { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ist-ungelesen .tk-zeit { color: var(--brand); font-weight: 700; }
.tk-badges { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tk-badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px; border: 1px solid transparent;
  font-size: 10px; font-weight: 700; line-height: 1.45; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.2px;
  background: var(--neutral-soft, #eef1f5); color: var(--neutral-ink, #4b5563);
}
.tk-badge.is-info   { background: var(--info-soft, #e9eff7);    color: var(--info-ink, #2b4a75); }
.tk-badge.is-warn   { background: var(--warning-soft, #fbf0df); color: var(--warning-ink, #8f5510); }
.tk-badge.is-ok     { background: var(--success-soft, #e6f4ec); color: var(--success-ink, #1b6b43); }
.tk-badge.is-danger { background: #d64545; color: #fff; }
.tk-badge.is-rand   { background: transparent; border-color: currentColor; }
.tk-badge.prio-critical { background: var(--danger-soft, #fbeae7); color: var(--danger-ink, #98301f); }
.tk-badge.prio-normal   { background: var(--warning-soft, #fbf0df); color: var(--warning-ink, #8f5510); }
.tk-badge.prio-low      { background: var(--info-soft, #e9eff7); color: #3730a3; }
.tk-badge.typ-bug       { background: var(--danger-soft, #fbeae7); color: var(--danger-ink, #98301f); }
.tk-badge.typ-wunsch    { background: #ede9fe; color: #5b21b6; }
.tk-badge.typ-frage     { background: var(--info-soft, #e9eff7); color: var(--info-ink, #2b4a75); }

/* Status-Schnellknöpfe (Liste kurz, Detail lang) — Farben wie im Ticket-Modul der App */
.tk-statusreihe { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tk-stk {
  display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 0 8px;
  border: 1px solid var(--border-strong, #cbd5e1); border-radius: 6px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tk-stk:hover:not([disabled]) { background: var(--surface-2, #f4f6f9); border-color: #94a3b8; }
.tk-stk.aktiv { cursor: default; }
.tk-stk.st-offen.aktiv              { background: var(--info-soft, #e9eff7); color: var(--info-ink, #2b4a75); border-color: #93c5fd; }
.tk-stk.st-in_bearbeitung.aktiv     { background: var(--warning-soft, #fbf0df); color: var(--warning-ink, #8f5510); border-color: #f5c77e; }
.tk-stk.st-warte_auf_antwort.aktiv  { background: #fbcfe8; color: #9d174d; border-color: #f472b6; }
.tk-stk.st-review.aktiv             { background: #ede9fe; color: #5b21b6; border-color: #a78bfa; }
.tk-stk.st-abgeschlossen.aktiv      { background: var(--success-soft, #e6f4ec); color: var(--success-ink, #1b6b43); border-color: #86efac; }
.tk-stk.tk-recheck { background: var(--warning-soft, #fbf0df); border-color: #f5c77e; color: var(--warning-ink, #8f5510); }
.tk-stk.tk-wieder { border-style: dashed; color: var(--warning-ink, #8f5510); }
.tk-d-kopf .tk-statusreihe { margin: 2px 0 12px; }
.tk-d-kopf .tk-stk { min-height: 30px; padding: 0 11px; font-size: 12px; }
.tk-check { min-width: 0; }

/* Interne Notiz (das eine Notizfeld je Ticket) */
.tk-notiz { margin: 0 0 16px; padding: 10px 12px; background: #fffbea; border: 1px dashed #d9a92c; border-radius: 12px; }
.tk-notiz label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: #6b4500; }
.tk-notiz label .k-leise { font-weight: 500; }
.tk-notiz .tk-textfeld { background: #fffdf5; }
.tk-notiz .tk-textfeld:focus, .tk-notiz .tk-textfeld:not(:placeholder-shown) { min-height: 72px; }
.tk-notiz-fuss { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-top: 6px; }
.tk-notiz-fuss .k-klein { flex: 1 1 220px; }
.tk-notiz-fuss .btn { min-height: 34px; }

/* ── Detail ───────────────────────────────────────────────────────────── */
.tk-d-leer { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 40px 20px; text-align: center; color: var(--text-muted); }
.tk-d-leer svg { color: var(--border); margin-bottom: 8px; }
.tk-d-leer p { margin: 0; }
.tk-d-leer strong { color: var(--brand); font-size: 15px; }
.tk-d-laedt { padding: 24px; }

.tk-d-kopf { padding: 16px 20px 14px; border-bottom: 1px solid var(--border); }
.tk-d-oben { display: flex; align-items: flex-start; gap: 8px; }
.tk-d-titel { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--brand); overflow-wrap: anywhere; }
.tk-d-titel .tk-nr { font-weight: 600; }
.tk-d-zurueck { display: none; align-items: center; min-height: var(--tap); padding-right: 8px; margin: -8px 0 -8px -4px; color: var(--text-muted); text-decoration: none; font-weight: 600; flex: none; }
.tk-d-zu {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -4px -6px 0 0;
  border-radius: var(--radius); color: var(--text-muted); text-decoration: none; font-size: 22px; line-height: 1;
}
.tk-d-zu:hover { background: var(--surface-2, #f4f6f9); color: var(--text); }
.tk-d-zurueck:focus-visible, .tk-d-zu:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.tk-d-chips { margin: 10px 0 12px; }
.tk-d-steuerung { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px 10px; }
.tk-d-aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tk-d-aktionen .btn { min-height: 36px; }
.tk-claude-knopf { color: #5b21b6 !important; border-color: #c4b5fd !important; background: #f5f3ff !important; }
.tk-claude-knopf:hover:not([disabled]) { background: #ede9fe !important; }

.tk-d-rumpf { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; padding: 18px 20px 0; }
.tk-d-verlauf { flex: 999 1 440px; min-width: 0; display: flex; flex-direction: column; }
.tk-d-seite { flex: 1 1 250px; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }

/* Verlauf als Chat: Mandant links, Betreiber/Claude/Notiz rechts */
.tk-chat { list-style: none; margin: 0; padding: 0 0 16px; display: flex; flex-direction: column; gap: 14px; }
.tk-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; min-width: 0; }
.tk-msg.ist-links { align-self: flex-start; }
.tk-msg.ist-rechts { align-self: flex-end; flex-direction: row-reverse; }
.tk-avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: 0.3px;
  background: var(--neutral-soft, #eef1f5); color: var(--neutral-ink, #4b5563);
}
.tk-msg-betreiber .tk-avatar { background: var(--brand); color: var(--accent); }
.tk-msg-claude .tk-avatar { background: #ede9fe; color: #5b21b6; font-size: 14px; }
.tk-msg.ist-intern .tk-avatar { background: #fde68a; color: #78350f; }
.tk-blase {
  min-width: 0; padding: 9px 13px 10px; border-radius: 14px;
  background: var(--surface-2, #f4f6f9); border: 1px solid var(--border);
}
.ist-links .tk-blase { border-bottom-left-radius: 4px; }
.ist-rechts .tk-blase { border-bottom-right-radius: 4px; }
.tk-msg-betreiber .tk-blase { background: var(--info-soft, #e9eff7); border-color: #cfdcee; }
.tk-msg-claude .tk-blase { background: #f5f3ff; border-color: #c4b5fd; }
.tk-msg.ist-intern .tk-blase { background: #fff8db; border: 1px dashed #d9a92c; }
.tk-msg-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin-bottom: 3px; }
.tk-msg-kopf strong { font-size: 12.5px; color: var(--brand); }
.tk-msg-rolle { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.tk-msg-claude .tk-msg-rolle, .tk-msg-claude .tk-msg-kopf strong { color: #5b21b6; }
.tk-msg.ist-intern .tk-msg-rolle { color: #8a5a00; }
.tk-msg-zeit { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.tk-msg-status { margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.tk-msg-label { margin: 2px 0 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.tk-msg-system { align-self: center; max-width: 92%; text-align: center; }
.tk-msg-system > span { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--neutral-soft, #eef1f5); color: var(--neutral-ink, #4b5563); font-size: 11.5px; }
.tk-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font-size: 13.5px; }
.tk-pre { white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(0,0,0,0.05); padding: 8px 10px; border-radius: 6px; margin: 0 0 8px; font-size: 12px; }
.tk-umbruch { overflow-wrap: anywhere; word-break: break-word; }

.tk-anhaenge { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tk-anhang { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px 4px 4px; background: rgba(255,255,255,0.7); border: 1px solid var(--border); border-radius: 8px; max-width: 100%; }
.tk-vorschau img { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: 5px; background: #fff; }
.tk-dateisymbol { font-size: 22px; width: 32px; text-align: center; }
.tk-anhang-text { min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; }

/* Antwortfeld */
.tk-composer {
  position: sticky; bottom: 0; z-index: 2;
  margin: 0 0 16px; padding: 10px 12px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px;
  box-shadow: 0 -10px 14px -6px var(--surface, #fff), var(--shadow-card, 0 1px 4px rgba(0,0,0,0.06));
}
.tk-composer:focus-within { border-color: var(--accent); }
.tk-composer.ist-intern { background: #fffbea; border-color: #d9a92c; border-style: dashed; }
.tk-composer-art { flex: none; display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2, #f4f6f9); }
.tk-composer-art label { position: relative; cursor: pointer; }
.tk-composer-art input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tk-composer-art span { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.tk-composer-art input:checked + span { background: var(--brand); color: #fff; }
.tk-composer-art input[value=intern]:checked + span { background: #f6d77a; color: #5c3b00; }
.tk-composer-art input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.tk-textfeld {
  display: block; width: 100%; box-sizing: border-box; min-height: 44px; max-height: 40vh; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface);
  font: inherit; font-size: 13.5px; line-height: 1.5; color: var(--text); resize: vertical;
}
.tk-composer .tk-textfeld { transition: min-height 0.15s; }
.tk-composer:focus-within .tk-textfeld, .tk-composer .tk-textfeld:not(:placeholder-shown) { min-height: 96px; }
.tk-textfeld:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft, #fdf3e3); }
.tk-composer-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.tk-datei {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; max-width: 200px; padding: 0 9px;
  border: 1.5px dashed var(--border); border-radius: var(--radius); background: var(--surface);
  color: var(--text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; min-width: 0;
}
.tk-datei input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.tk-datei:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-datei.hat-datei { border-style: solid; border-color: var(--accent); color: var(--text); }
.tk-datei-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tk-a-status {
  flex: 1 1 120px; max-width: 220px; min-width: 0; height: 36px; margin-left: auto; padding: 0 8px;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface);
  font: inherit; font-size: 12.5px; color: var(--text);
}
.tk-composer-fuss .btn { min-height: 36px; }
.tk-composer-hinweis { margin: 6px 0 0; font-size: 11.5px; color: var(--text-muted); }
.tk-composer .k-meldung { margin: 8px 0 0; }

/* Seitenleiste */
.tk-kasten { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.tk-kasten p { margin: 0; }
.tk-kasten-titel { margin: 0 0 8px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.tk-dl { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 12.5px; }
.tk-dl dt { color: var(--text-muted); font-weight: 600; }
.tk-dl dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.tk-auftraege { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tk-auftraege li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.tk-auftraege li .tk-textknopf { margin-left: auto; }
.tk-aufklapp > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 28px; margin: 0; }
.tk-aufklapp > summary::-webkit-details-marker { display: none; }
.tk-aufklapp > summary::before { content: '▸'; transition: transform 0.15s; }
.tk-aufklapp[open] > summary::before { transform: rotate(90deg); }
.tk-aufklapp[open] > summary { margin-bottom: 6px; }
.tk-protokoll { max-height: 280px; overflow-y: auto; }
.tk-protokoll li { padding: 6px 0; }
.tk-loeschzeile { text-align: right; }

/* Claude-Dialog, Einstellungen */
.tk-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.45; }
.tk-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-knoepfe .btn { min-height: var(--tap); }
.btn.tk-rot { color: var(--danger-ink, #98301f); border-color: var(--danger-line); }
.tk-ordnerliste { list-style: none; margin: 0 0 12px; padding: 0; }
.tk-ordnerliste li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }
.tk-zeile { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.tk-zeile .field { flex: 1 1 220px; margin-bottom: 0; }
.tk-zeile .btn { min-height: var(--tap); }
.k-dialog .field textarea { width: 100%; box-sizing: border-box; }


/* ══ Desktop ≥ 1024: Anker-Leiste nur hier wirksam ════════════════════ */
@media (max-width: 1023px) {
  .tk-anker, .tk-leiste-tipp { display: none; }
}

/* ══ Tablet ≤ 1023: je eine Ebene; Ansichten/Ordner als Klappmenü ══════ */
@media (max-width: 1023px) {
  .k-main:has(> .tk-app) { display: block; overflow-y: auto; padding-bottom: calc(var(--panel-pad) + 24px + var(--safe-b)); }
  .tk-split, .tk-geloest .tk-split { display: block; }
  .tk-leiste-schalter { display: inline-flex; }
  .tk-leiste { display: none; margin-bottom: 12px; overflow: visible; }
  .tk-leiste-offen .tk-leiste { display: block; }
  .tk-app.tk-zeigt-detail .tk-kopf, .tk-app.tk-zeigt-detail .tk-werkzeug, .tk-app.tk-zeigt-detail .tk-filterfeld,
  .tk-app.tk-zeigt-detail .tk-leiste, .tk-app.tk-zeigt-detail .tk-master { display: none; }
  .tk-app:not(.tk-zeigt-detail) .tk-detail { display: none; }
  .tk-master, .tk-detail { overflow: visible; }
  .tk-liste { overflow: visible; }
  .tk-d-zurueck { display: inline-flex; }
  .tk-d-zu { display: none; }
  .tk-composer { position: static; box-shadow: none; }
  /* Ordner-Aktionen ohne Hover sichtbar (Touch) */
  .tk-oz-aktionen { position: static; transform: none; display: flex; margin-left: 4px; }
  .tk-ordnerleiste > li { gap: 2px; }
}

/* ══ Handy ≤ 767 ═══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .k-nav a .k-badge { margin-left: 3px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .tk-kopf { margin-bottom: 10px; }
  .tk-kopfknoepfe .btn { min-height: var(--tap); }
  .tk-werkzeug { display: block; }
  .tk-wz-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; }
  .tk-wz-links > * { grid-column: span 2; }
  .tk-wz-links > .tk-reload, .tk-wz-links > .tk-filterknopf { grid-column: span 1; }
  .tk-wz-rechts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: end; }
  .tk-wz-rechts { margin-top: 8px; padding: 10px; background: #fffbeb; border: 1px solid #f5d98b; border-radius: 10px; }
  .tk-app:not(.tk-hat-auswahl) .tk-wz-rechts { display: none; }
  .tk-wz-links > .tk-leiste-schalter { grid-column: 1 / -1; }
  .tk-wz-feld select, .tk-f select { width: 100%; max-width: none; height: var(--tap); font-size: 16px; }
  .tk-wz-knopf { height: var(--tap); width: 100%; font-size: 14px; padding: 0 8px; }
  .tk-filterknopf > span:not(.tk-zahl) { overflow: hidden; text-overflow: ellipsis; }
  .tk-leiste-schalter { justify-content: flex-start; }
  .tk-leiste-schalter .tk-pfeil { margin-left: auto; }
  .tk-filterfeld .tk-f { flex: 1 1 140px; }
  .tk-suchfeld input { height: var(--tap); font-size: 16px; }
  .tk-alle { min-height: var(--tap); }
  .tk-alle input, .tk-check input { width: 22px; height: 22px; }
  .tk-sort select { height: var(--tap); font-size: 16px; }
  .tk-textknopf { min-height: var(--tap); }
  .tk-ordnerzeile { min-height: var(--tap); font-size: 14px; }
  .tk-oz-mini { width: var(--tap); height: var(--tap); font-size: 15px; }
  .tk-ordner-neu { height: var(--tap); padding: 0 14px; font-size: 13px; }
  .tk-eintrag { grid-template-columns: 46px minmax(0, 1fr); }
  .tk-check { padding-top: 6px; align-items: flex-start; }
  .tk-check input { margin: 5px 0 0; }
  .tk-check { min-height: var(--tap); }
  .tk-eintrag-link { padding: 12px 12px 4px 0; }
  .tk-zeile-fuss { padding: 4px 12px 12px 0; }
  .tk-stk { min-height: var(--tap); flex: 1 1 auto; font-size: 12px; padding: 0 6px; }
  .tk-zeile-fuss .tk-stk { padding: 0 4px; font-size: 11.5px; }
  .tk-d-kopf .tk-stk { min-height: var(--tap); }

  .tk-detail { border-radius: var(--radius-lg, 14px); }
  .tk-d-kopf { padding: 8px 14px 14px; }
  .tk-d-oben { flex-wrap: wrap; align-items: center; gap: 0 8px; }
  .tk-d-zurueck { flex: 1 1 100%; margin: 0 0 0 -4px; }
  .tk-d-titel { font-size: 17px; padding: 2px 0 4px; }
  .tk-d-steuerung { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tk-d-steuerung select, .tk-a-status { height: var(--tap); font-size: 16px; }
  .tk-d-aktionen .btn { min-height: var(--tap); flex: 1 1 auto; justify-content: center; }
  .tk-d-rumpf { padding: 14px 12px 0; gap: 14px; }
  .tk-msg { max-width: 94%; }
  .tk-avatar { width: 26px; height: 26px; font-size: 10px; }
  .tk-anhang { min-height: var(--tap); }
  .tk-textfeld { font-size: 16px; }
  .tk-notiz-fuss .btn { min-height: var(--tap); flex: 1 1 100%; justify-content: center; }
  .tk-composer-art { display: flex; flex: 1 1 100%; }
  .tk-composer-art label { flex: 1 1 0; }
  .tk-composer-art span { min-height: var(--tap); justify-content: center; width: 100%; }
  .tk-datei { height: var(--tap); min-width: var(--tap); }
  .tk-composer-fuss .btn { min-height: var(--tap); }
  .tk-a-status { flex: 1 1 160px; max-width: none; margin-left: 0; }
  .tk-aufklapp > summary { min-height: var(--tap); }
  .tk-loeschzeile { text-align: left; }
  .tk-knoepfe .btn { min-height: var(--tap); }
}

/* ══ Kleines Handy ≤ 479 ═══════════════════════════════════════════════ */
@media (max-width: 479px) {
  .tk-lang { display: none; }
  .tk-kopfknoepfe .btn-outline { width: var(--tap); padding: 0; justify-content: center; }
  .tk-eintrag-link { grid-template-columns: 8px minmax(0, 1fr); }
  .tk-eintrag-rechts { grid-column: 2; flex-direction: row; justify-content: flex-start; margin-top: 4px; }
  .tk-d-aktionen .btn { flex: 1 1 100%; }
  .tk-composer-fuss .btn { flex: 1 1 100%; justify-content: center; }
  .tk-a-status { flex: 1 1 0; }
  .tk-dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tk-dl dd { margin-bottom: 6px; }
  .tk-knoepfe .btn { flex: 1 1 auto; justify-content: center; }
  .tk-sort span { display: none; }
  .tk-filterknopf > span:not(.tk-zahl) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tk-aufklapp > summary::before, .tk-composer .tk-textfeld, .tk-pfeil { transition: none; }
  .tk-reload.dreht { animation: none; }
}

/* ══ Touch-Geräte (Tablet quer/hoch, auch ≥ 768): Ziele ≥ 44px wie shell.css ══ */
@media (pointer: coarse) {
  .tk-kopfknoepfe .btn, .tk-wz-knopf, .tk-wz-feld select, .tk-f select, .tk-sort select, .tk-suchfeld input,
  .tk-d-steuerung select, .tk-a-status, .tk-d-aktionen .btn, .tk-notiz-fuss .btn, .tk-composer-fuss .btn,
  .tk-ordner-neu, .tk-textknopf, .tk-anker { min-height: var(--tap); }
  .tk-wz-feld select, .tk-f select, .tk-sort select, .tk-suchfeld input, .tk-d-steuerung select, .tk-a-status { height: var(--tap); font-size: 16px; }
  .tk-wz-knopf, .tk-ordner-neu { height: var(--tap); }
  .tk-reload, .tk-anker { min-width: var(--tap); }
  .tk-ordnerzeile, .tk-stk, .tk-d-kopf .tk-stk, .tk-alle, .tk-check, .tk-aufklapp > summary, .tk-anhang { min-height: var(--tap); }
  .tk-oz-mini { width: var(--tap); height: var(--tap); }
  .tk-eintrag { grid-template-columns: 46px minmax(0, 1fr); }
  .tk-composer-art span { min-height: var(--tap); }
  .tk-datei { height: var(--tap); min-width: var(--tap); }
}
