/* FDL Ausbildung: Chat (chat.js). Baut auf fdl.css auf und nutzt dessen Farben und Maße.
   Wie Discord: In einer Gruppe links die Kanäle, in der Mitte die Unterhaltung, rechts die Mitglieder
   (oder Dateien, Aufgaben, Einstellungen).
   Ab 1180 px stehen alle drei Spalten nebeneinander. Darunter ist die rechte Spalte eine Seitenleiste zum
   Ausklappen. Bis 760 px (Handy) gibt es nur eine Spalte: erst die Liste, dann die Unterhaltung, und die
   Kanäle sind links ebenfalls eine Seitenleiste. */

/* ------------------------------------------------------------ Navigation: Zahl der ungelesenen */
.nav-badge {
  position: absolute; top: 6px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; font-size: 11px; line-height: 1;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 2px var(--base-flat), 0 0 12px rgba(var(--accent-rgb), .6);
  animation: chipBump .5s var(--ease);
}

/* ------------------------------------------------------------ Gerüst */
.page.chat-page { padding: 0; overflow: hidden; }
.page.chat-page > * { max-width: none; }
.chat { position: relative; height: 100%; display: grid; grid-template-columns: 280px minmax(0, 1fr); overflow: hidden; }
@media (min-width: 1180px) {
  .chat.has-panel { grid-template-columns: 280px minmax(0, 1fr) 300px; }
}

.chat-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--edge); background: rgba(0, 0, 0, .1); }
.chat-side-head { display: flex; align-items: center; gap: 2px; padding: 18px 10px 8px 22px; }
.chat-side-head h1 { font-size: 24px; }
.chat-list { flex: 1; min-height: 0; overflow: hidden auto; padding: 0 10px 18px; overscroll-behavior: contain; }
.chat-list h2.sect { margin: 16px 12px 6px; font-size: 11.5px; }
.chat-list-note { margin: 12px; }
.chat-rows, .chat-channels { list-style: none; margin: 0; padding: 0; }

.chat-row, .chat-chan {
  width: 100%; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left;
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; transition: background .2s, color .2s;
}
.chat-row .rowtext { flex: 1; min-width: 0; gap: 1px; }
.chat-row .rowtext b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .t { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.has-unread .rowtext b, .chat-row.has-unread .rowtext .t { color: var(--text); }
.chat-row.has-unread .rowtext b { font-weight: 600; }
.chat-row.on, .chat-chan.on { background: rgba(255, 255, 255, .08); }
.chat-chan.on { color: var(--text); }
.chat-chan.on .ic { color: var(--accent); }
.row-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row-end .t { font-size: 11px; }
.chat-channels { margin: 0 0 6px; }
.chat-chan { padding: 7px 10px 7px 12px; gap: 8px; color: var(--dim); }
.chat-chan .ic { font-size: 15px; color: var(--faint); }
.chat-chan .cname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-chan.has-unread .cname { color: var(--text); font-weight: 600; }

/* Linke Spalte in einer Gruppe: zurück zu allen Chats, Kopf der Gruppe, Schnellzugriffe, Kanäle */
.chat-side.in-group .chat-list { padding-top: 12px; }
.chat-allback {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--dim); font: inherit; font-size: 13px; font-weight: 600; text-align: left; transition: background .2s, color .2s;
}
.chat-allback .ic { font-size: 16px; }
.chat-allback .unread { margin-left: auto; }
.chat-ghead { display: flex; align-items: center; gap: 11px; padding: 10px 2px 8px 10px; }
.chat-ghead .rowtext { flex: 1; min-width: 0; gap: 1px; }
.chat-ghead .rowtext b { font: 600 17px/1.25 var(--display); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chat-ghead .t { color: var(--faint); font-size: 12.5px; }
.chat-ghead .t.due { color: var(--violet); }
.chat-gdesc {
  margin: 0 10px 8px; color: var(--dim); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.chat-glinks { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 6px 4px 10px; }
.chat-glink {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px;
  border: 1px solid var(--edge); background: rgba(255, 255, 255, .04); color: var(--dim); font: inherit; font-size: 12.5px; font-weight: 600;
  transition: background .2s, border-color .2s, color .2s;
}
.chat-glink .ic { font-size: 15px; }
.chat-glink.on { background: rgba(var(--accent-rgb), .14); border-color: rgba(var(--accent-rgb), .5); color: var(--text); }
.sect-row { display: flex; align-items: center; gap: 4px; margin: 16px 0 4px 12px; }
.chat-list .sect-row h2.sect { flex: 1; margin: 0; }
.sect-row .iconbtn { width: 32px; height: 32px; font-size: 16px; }
/* Punkt am Kanäle-Knopf (Handy): anderswo gibt es Ungelesenes */
.chat-back.dot { position: relative; }
.chat-back.dot::after { content: ""; position: absolute; top: 7px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--base-flat); }
.chat-tools .iconbtn.on { background: rgba(255, 255, 255, .08); color: var(--text); }

.unread {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center;
  font-size: 11.5px; line-height: 1; background: var(--accent); color: var(--on-accent);
}

/* Bild des Kontos: Anfangsbuchstabe, Farbe aus dem Namen. Punkt unten rechts: online (grün) oder nicht. */
.av {
  position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font: 600 15px var(--display); background: hsl(var(--h) 55% 50% / .22); color: hsl(var(--h) 85% 76%);
}
.av.on::after, .av.off::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  border: 2.5px solid #17181d; background: #5b5f68;
}
.av.on::after { background: var(--ok); }
.gic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: rgba(94, 200, 255, .14); color: var(--ice); }
.gic.project { background: rgba(180, 156, 255, .16); color: var(--violet); }

/* ------------------------------------------------------------ Unterhaltung */
.chat-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-main.drop::after {
  content: "Zum Senden hier loslassen"; position: absolute; inset: 12px; z-index: 5; pointer-events: none;
  display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 16px;
  background: rgba(var(--accent-rgb), .08); font-weight: 600;
}
.chat-head { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 10px 14px 10px 22px; border-bottom: 1px solid var(--edge); }
.chat-title { flex: 1; min-width: 0; display: grid; }
.chat-title b { font: 600 17px/1.25 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title .t { color: var(--faint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title .t.online { color: var(--ok); }
.chat-tools { display: flex; gap: 2px; }
.chat-back, .chat-more { display: none !important; }
.chip.due { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; background: rgba(180, 156, 255, .16); color: var(--violet); }
.chat.has-panel .chat-head .chip.due { display: none; }

.chat-scroll-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.chat-scroll { flex: 1; min-height: 0; overflow: hidden auto; padding: 10px 0 6px; overscroll-behavior: contain; outline: none; }
.chat-msgs { padding: 0 12px; }
.chat-older { display: grid; place-items: center; min-height: 26px; }
.chat-start { margin: 10px 0 0; color: var(--faint); font-size: 12.5px; text-align: center; }
.chat-first { text-align: center; margin: 30px auto; }
.chat-loading { flex: 1; display: grid; place-items: center; }
.loader.small { width: 16px; height: 16px; border-width: 2px; }

.chat-day, .chat-new { display: flex; align-items: center; gap: 12px; margin: 18px 12px 6px; font-size: 12px; font-weight: 600; color: var(--faint); }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--edge); }
.chat-new { margin: 10px 12px 2px; color: var(--accent); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.chat-new::before { content: ""; flex: 1; height: 1px; background: rgba(var(--accent-rgb), .6); }

.msg { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; padding: 2px 12px; border-radius: 10px; transition: background .15s; }
.msg.first { margin-top: 10px; padding-top: 6px; }
.msg > .av { width: 40px; height: 40px; margin-top: 1px; font-size: 16px; }
.msg-side { padding-top: 3px; font-size: 10.5px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .15s; }
.msg.sel { background: rgba(255, 255, 255, .045); }
.msg.sel .msg-side { opacity: 1; }
.msg-body { min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; }
.msg-meta b { font-weight: 600; }
.msg-meta time { color: var(--faint); font-size: 11.5px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.msg-text a { color: var(--ice); text-underline-offset: 3px; }
.msg-edited { color: var(--faint); font-size: 11px; }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.msg-image { padding: 0; border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .25); max-width: min(100%, 360px); cursor: zoom-in; }
.msg-image img { display: block; max-width: 100%; max-height: 280px; min-width: 60px; min-height: 40px; object-fit: contain; }
.msg-file {
  display: flex; align-items: center; gap: 12px; width: min(100%, 360px); padding: 10px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--edge); color: inherit; text-decoration: none; transition: background .2s, border-color .2s;
}
.msg-file .rowtext { flex: 1; }
.msg-file .rowtext b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-file .t { color: var(--faint); font-size: 12px; }
.msg-file > .ic { color: var(--dim); font-size: 18px; }
.fic { display: grid; place-items: center; flex: none; font-size: 20px; color: var(--accent); }
.msg-actions {
  position: absolute; right: 10px; top: -16px; z-index: 2; display: none; gap: 2px; padding: 2px; border-radius: 10px;
  background: var(--solid-menu); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 10px 24px -10px #000;
}
.msg.first .msg-actions { top: -8px; }
.msg.sel .msg-actions { display: flex; }
.msg-actions .iconbtn { width: 34px; height: 34px; font-size: 16px; }
.iconbtn.danger { color: var(--bad); }
.msg-edit { display: grid; gap: 8px; margin: 4px 0; }
.msg-edit .actions { gap: 8px; }

.chat-jump {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; height: 34px; padding: 0 14px; border: 0; border-radius: 17px;
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -8px rgba(var(--accent-rgb), .9); animation: pageIn .3s var(--ease);
}
.chat-typing { min-height: 20px; padding: 0 26px; font-size: 12px; color: var(--dim); opacity: 0; transition: opacity .2s; }
.chat-typing.on { opacity: 1; }

/* ------------------------------------------------------------ Schreiben */
.chat-compose { padding: 0 16px 14px; }
.compose-row {
  display: flex; align-items: flex-end; gap: 6px; padding: 5px; border-radius: 14px;
  background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .12); transition: border-color .2s, box-shadow .2s;
}
.compose-row:focus-within { border-color: rgba(var(--accent-rgb), .75); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12); }
.compose-text, .msg-edit-text { width: 100%; resize: none; outline: none; line-height: 1.45; font-size: 14.5px; }
.compose-text { flex: 1; min-width: 0; max-height: 180px; padding: 9px 6px; border: 0; background: transparent; }
.compose-text::placeholder { color: var(--faint); }
.msg-edit-text { padding: 10px 14px; border-radius: var(--r-inner); border: 1px solid rgba(var(--accent-rgb), .7); background: rgba(0, 0, 0, .25); }
.compose-send { width: 42px; height: 38px; padding: 0; flex: none; }
.compose-send .ic { font-size: 18px; }
.compose-files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.fchip {
  position: relative; display: flex; align-items: center; gap: 8px; max-width: 280px; padding: 6px 4px 6px 10px; overflow: hidden;
  border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid var(--edge); animation: pageIn .3s var(--ease);
}
.fchip .rowtext { min-width: 0; }
.fchip .rowtext b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fchip .t { font-size: 11.5px; color: var(--faint); }
.fchip .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 0; }
.fchip .bar > i { transition: width .2s; }
.fchip .iconbtn { width: 32px; height: 32px; font-size: 15px; }
.fchip.done .fic { color: var(--ok); }
.fchip.bad { border-color: rgba(255, 140, 150, .5); }
.fchip.bad .fic, .fchip.bad .t { color: var(--bad); }

.chat-empty { margin: auto; max-width: 460px; padding: 24px; display: grid; justify-items: center; gap: 8px; text-align: center; }
.chat-empty h2 { margin: 10px 0 0; }
.chat-empty .note { margin: 0; }
.chat-empty .actions { justify-content: center; margin-top: 12px; }
.badge.big-badge { width: 60px; height: 60px; border-radius: 18px; font-size: 30px; box-shadow: 0 0 30px -6px rgba(var(--accent-rgb), .5); }

.chat-offline {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; background: var(--solid-toast); border: 1px solid var(--edge); color: var(--dim); font-size: 12.5px; white-space: nowrap;
}

/* ------------------------------------------------------------ Seitenleiste rechts und Fenster */
.chat-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--edge); background: rgba(0, 0, 0, .1); animation: pageIn .35s var(--ease); }
.panel-head { display: flex; align-items: center; gap: 8px; min-height: 66px; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--edge); }
.panel-head h2 { flex: 1; margin: 0; font: 600 17px var(--display); }
.panel-body { flex: 1; min-height: 0; overflow: hidden auto; padding: 14px 16px 22px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; }
.sheet .body > .panel-body { padding: 4px 0 0; overflow: visible; }
.panel-body > .rows { margin: 0; }
.panel-sect { margin: 10px 0 0; font: 600 12px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.panel-foot { margin-top: 6px; }
.form.tight { margin-top: 0; gap: 12px; }

.picker { display: grid; gap: 8px; }
.picker .search { width: 100%; }
.picker-rows { max-height: 280px; overflow: hidden auto; margin: 0; }
.rows .picker-none { display: block; border: 0; padding: 8px 4px; color: var(--faint); font-size: 13px; }
.picker-rows .rowbtn, .member-rows .rowbtn { grid-template-columns: 36px minmax(0, 1fr) auto; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.member-chips:empty { display: none; }
.mchip { gap: 4px; padding-right: 6px; }
.mchip button { display: grid; padding: 2px; border: 0; background: none; color: inherit; font-size: 13px; cursor: pointer; }
.add-member > summary { list-style: none; display: inline-flex; cursor: pointer; }
.add-member > summary::-webkit-details-marker { display: none; }
.add-member[open] > summary { margin-bottom: 10px; }
.member-rows li.member { display: block; padding: 5px 4px; }
.member-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.member-name b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-tag { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.role-tag .ic { font-size: 12px; }
.role-tag.owner { background: rgba(255, 196, 80, .14); color: #ffd27a; }
.role-tag.admin { background: rgba(94, 200, 255, .14); color: var(--ice); }
.member-rows.away .rowbtn > .av, .member-rows.away .member-name b { opacity: .5; }
.panel-body > .panel-sect:first-child, .panel-body > .add-member + .panel-sect { margin-top: 2px; }
.member-acts { display: none; flex-wrap: wrap; gap: 6px; padding: 8px 0 2px 48px; }
.member.open .member-acts { display: flex; }
.chev.more { transform: none; }
.chev.dl { transform: none; }
.file-rows .thumb { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: rgba(255, 255, 255, .06); }
.chan-rows li { grid-template-columns: 34px minmax(0, 1fr) auto; }
.chan-rows .actions { gap: 2px; flex-wrap: nowrap; }

.task-add { display: flex; gap: 8px; }
.task-add input, .task-add select, .task-who {
  height: 40px; min-width: 0; padding: 0 12px; border-radius: 10px; outline: none;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .25); color: var(--text);
}
.task-add input { flex: 1; }
.task-add select, .task-who { max-width: 130px; padding: 0 8px; }
.task-add input:focus, .task-add select:focus, .task-who:focus { border-color: rgba(var(--accent-rgb), .8); }
.task-add .btn { flex: none; height: 40px; }
.chat select option { background: var(--solid-menu); }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.task { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); transition: opacity .2s; }
.task .check { align-items: flex-start; color: var(--text); font-size: 14px; }
.task .check b { margin-top: 1px; }
.task-title { overflow-wrap: anywhere; }
.task.done { opacity: .7; }
.task.done .task-title { text-decoration: line-through; color: var(--faint); }
.task-meta { display: flex; align-items: center; gap: 6px; padding-left: 28px; }
.task-who { height: 32px; font-size: 12.5px; }
.task-meta .iconbtn { margin-left: auto; width: 32px; height: 32px; font-size: 16px; }
.task-progress { display: grid; gap: 6px; }
.task-progress .t { color: var(--dim); font-size: 12.5px; }
.due-line { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--violet); font-weight: 600; }

/* Seitenleisten zum Ausklappen (rechte Spalte unter 1180 px, linke auf dem Handy) */
.chat-scrim { display: none; position: absolute; inset: 0; z-index: 7; background: rgba(5, 6, 8, .55); animation: fade .2s; }
.chat.drawer-leaving .chat-scrim { animation: chatFadeOut .19s forwards; }
@keyframes chatFadeOut { to { opacity: 0; } }
@keyframes drawerRight { from { transform: translateX(100%); } }
@keyframes drawerRightOut { to { transform: translateX(100%); } }
@keyframes drawerLeft { from { transform: translateX(-100%); } }
@keyframes drawerLeftOut { to { transform: translateX(-100%); } }
@media (max-width: 1179px) {
  .chat-panel {
    position: absolute; top: 0; right: 0; bottom: 0; z-index: 8; width: min(340px, 88%);
    background: var(--solid-menu); border-left: 1px solid rgba(255, 255, 255, .1); box-shadow: -24px 0 60px -24px #000;
    animation: drawerRight .3s var(--ease);
  }
  .chat-panel.leaving { animation: drawerRightOut .19s ease-in forwards; }
  .chat.has-panel .chat-scrim { display: block; }
}

/* Bild groß ansehen */
.chat-lightbox {
  position: fixed; inset: 0; z-index: 95; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); background: rgba(5, 6, 8, .9); animation: fade .2s;
}
.chat-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px -20px #000; }
.lb-bar { display: flex; align-items: center; gap: 10px; width: min(760px, 100%); padding-top: 12px; }
.lb-name { flex: 1; min-width: 0; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-bar a.btn { text-decoration: none; color: inherit; }

/* ------------------------------------------------------------ Maus, Finger, Breiten */
@media (hover: hover) {
  .chat-row:hover, .chat-chan:hover, .chat-allback:hover { background: rgba(255, 255, 255, .05); }
  .chat-allback:hover { color: var(--text); }
  .chat-glink:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
  .chat-row.on:hover, .chat-chan.on:hover { background: rgba(255, 255, 255, .09); }
  .chat-chan:hover { color: var(--text); }
  .msg:hover { background: rgba(255, 255, 255, .03); }
  .msg:hover .msg-side { opacity: 1; }
  .msg:hover .msg-actions { display: flex; }
  .msg-file:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
  .msg-image:hover { border-color: rgba(255, 255, 255, .2); }
  .chat-jump:hover { filter: brightness(1.08); }
}
@media (pointer: coarse) {
  .compose-text, .msg-edit-text, .task-add input { font-size: 16px; }
  .compose-send { height: 44px; width: 46px; }
  .chat-row, .chat-allback { padding: 10px; }
  .chat-glink { height: 36px; }
  .chat-chan { padding-top: 10px; padding-bottom: 10px; }
  .task-who { height: 40px; }
  .task-meta .iconbtn, .msg-actions .iconbtn { width: 40px; height: 40px; }
}
@media (max-width: 1040px) {
  .chat { grid-template-columns: 250px minmax(0, 1fr); }
}
/* Schmal: Liste oder Unterhaltung, nicht beides */
@media (max-width: 760px) {
  .chat, .chat.has-panel { grid-template-columns: minmax(0, 1fr); }
  .chat[data-view="conv"] .chat-side { display: none; }
  .chat:not([data-view="conv"]) .chat-main { display: none; }
  .chat-side { border-right: 0; background: none; }
  /* Kanäle der Gruppe als Seitenleiste von links */
  .chat[data-view="conv"].side-open .chat-side {
    display: flex; position: absolute; top: 0; left: 0; bottom: 0; z-index: 8; width: min(320px, 86%);
    background: var(--solid-menu); border-right: 1px solid rgba(255, 255, 255, .1); box-shadow: 24px 0 60px -24px #000;
    animation: drawerLeft .3s var(--ease);
  }
  .chat-side.leaving { animation: drawerLeftOut .19s ease-in forwards; }
  .chat.side-open .chat-scrim { display: block; }
  .chat-side-head { padding: 18px 8px 6px 18px; }
  .chat-back { display: grid !important; }
  .chat-head { gap: 8px; min-height: 58px; padding: 6px 8px 6px 4px; }
  .chat-msgs { padding: 0 4px; }
  .msg { grid-template-columns: 36px minmax(0, 1fr); gap: 0 10px; padding: 2px 8px; }
  .msg > .av { width: 36px; height: 36px; font-size: 15px; }
  .chat-compose { padding: 0 10px 10px; }
  .chat-typing { padding: 0 18px; }
}
@media (max-width: 560px) {
  .chat-tools .iconbtn { display: none; }
  .chat-tools .iconbtn:only-child, .chat-tools .chat-members-btn, .chat-tools .chat-more { display: grid !important; }
  .chat-head .chip.due { display: none; }
}
