/* chat – Gruppen/Direkt, Erwähnungen, mobile/iOS-Anpassungen */
.view.chat-view{overflow:hidden}
.chat-split{display:grid;grid-template-columns:280px minmax(0,1fr);height:100%;min-height:0;background:var(--glass);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.chat-side{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--border)}
.chat-pane{display:flex;flex-direction:column;min-width:0;min-height:0}
.chat-side-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 12px 6px 18px}
.chat-side-head h2{font-size:17px}
.chat-new{background:var(--primary);color:var(--on-primary);box-shadow:var(--shadow)}
.chat-new:hover{background:var(--primary-h);color:var(--on-primary)}
.chat-new:active{transform:scale(.92)}
.chat-list{flex:1;min-height:0;overflow-y:auto;padding:0 0 12px}
.chat-sec h3{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2);padding:12px 20px 4px}
.chat-empty{color:var(--text-2);font-size:13px;padding:6px 20px}
.chat-item{display:flex;align-items:center;gap:10px;margin:1px 8px;padding:8px 12px;border-radius:var(--radius-s);color:inherit;text-decoration:none;min-width:0;transition:background .15s}
.chat-item:hover{background:var(--surface-2)}
.chat-item.active{background:var(--ink);color:var(--on-ink)}
.chat-item.active .chat-sub{color:rgba(238,246,243,.7)}
.chat-item.active .chat-ic{background:rgba(255,255,255,.12);color:inherit}
.chat-item .dot{width:9px;height:9px;border-radius:50%;background:var(--accent);flex:none}
.chat-name{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.chat-name>.ellip{font-weight:600}
.chat-sub{font-size:12px;color:var(--text-2)}
.chat-chev{display:none;color:var(--text-2)}
.chat-ic{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:var(--primary-soft);color:var(--primary);flex:none}
.ellip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.chat-head{display:flex;align-items:center;gap:10px;padding:10px 12px 10px 16px;border-bottom:1px solid var(--border);background:var(--surface);min-width:0}
.chat-head-t{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.chat-back{display:none;color:var(--text)}
.chat-pane .msgs{flex:1;min-height:0}
.chat-pane .composer{position:relative;align-items:flex-end}
.chat-pane .composer textarea{flex:1;min-height:40px;border-radius:20px;padding:9px 14px}
.chat-send{border-radius:20px;min-height:40px}

/* Erwähnungen */
.mention{color:var(--primary);font-weight:600;background:var(--primary-soft);border-radius:6px;padding:0 3px}
.mention.me{color:var(--accent);background:var(--accent-soft)}
.msg.for-me{background:linear-gradient(90deg,var(--accent-soft),transparent 70%);border-radius:var(--radius-s);margin:0 -8px;padding:5px 8px}
.chat-mention{position:absolute;left:10px;right:10px;bottom:calc(100% + 6px);z-index:20;max-height:240px;overflow-y:auto;background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-lg,var(--shadow));padding:4px}
.chat-mention[hidden]{display:none}
.chat-mention-row{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;border-radius:12px;background:transparent;color:inherit;text-align:left;cursor:pointer}
.chat-mention-row.on,.chat-mention-row:hover{background:var(--primary-soft)}

/* Dialog „Neuer Chat“ */
.chat-seg{display:flex;background:var(--surface-2);border-radius:22px;padding:3px;margin-bottom:14px}
.chat-seg-btn{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;background:transparent;padding:8px 12px;border-radius:19px;cursor:pointer;color:var(--text-2);font-weight:600;transition:background .15s,color .15s}
.chat-seg-btn.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow)}
.chat-pick{display:flex;flex-direction:column;gap:2px;max-height:min(46vh,360px);overflow-y:auto;border:1px solid var(--border);border-radius:var(--radius-s);padding:4px}
.chat-pick-row{display:flex;align-items:center;gap:12px;width:100%;padding:8px 10px;border:0;border-radius:10px;background:transparent;color:inherit;text-align:left;cursor:pointer;min-height:48px}
.chat-pick-row:hover{background:var(--surface-2)}
.chat-pick-row.locked{cursor:default;opacity:.8}
.chat-pick-name{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.chat-check{width:24px;height:24px;border-radius:50%;border:2px solid var(--border);display:grid;place-items:center;color:transparent;flex:none;transition:background .15s,border-color .15s}
.chat-pick-row.on .chat-check{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.chat-hint{margin:0 0 10px}
.chat-err{color:var(--danger,#c0392b);font-size:13px;min-height:1em}
.chat-err:empty{display:none}
@media(prefers-color-scheme:dark){.chat-seg-btn.on{background:var(--primary);color:var(--on-primary)}}

/* Handy: Liste und Gespräch als zwei Ebenen (iOS-Muster) */
@media(max-width:760px){
  .view.flush.chat-view{padding:0 0 var(--tab-space)}
  .chat-split{grid-template-columns:minmax(0,1fr);border:0;border-radius:0;box-shadow:none;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
  .chat-side{border-right:0}
  .chat-split.has-active .chat-side{display:none}
  .chat-split:not(.has-active) .chat-pane{display:none}
  .chat-side-head{padding:10px 16px 4px 20px}
  .chat-side-head h2{font-size:26px;letter-spacing:-.01em}
  .chat-new{width:40px;height:40px}
  .chat-item{margin:0 8px;padding:10px 12px;min-height:56px}
  .chat-item.active{background:transparent;color:inherit}
  .chat-item.active .chat-sub{color:var(--text-2)}
  .chat-item.active .chat-ic{background:var(--primary-soft);color:var(--primary)}
  .chat-item:active{background:var(--surface-2)}
  .chat-chev{display:block}
  .chat-ic{width:40px;height:40px;border-radius:12px}
  .chat-item .avatar{width:40px!important;height:40px!important;font-size:15px!important}
  .chat-head{padding:6px 10px 6px 4px;background:var(--glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
  .chat-back{display:inline-grid;width:40px;height:40px}
  .chat-pane{background:transparent}
  .chat-pane .composer{padding:8px 10px;background:var(--glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
  .chat-send{width:40px;height:40px;padding:0;border-radius:50%;justify-content:center;flex:none}
  .chat-send-lbl{display:none}
  .chat-mention{left:6px;right:6px}
  .msg.for-me{margin:0 -6px;padding:5px 6px}
  /* Tastatur offen: Leiste weg, nur Chat-Bereich rückt über die Tastatur */
  .kbd .view.flush.chat-view{padding-bottom:0}
  .kbd .chat-pane .composer{padding-bottom:8px}
}
