/* Let the text grid shrink inside each chat row, including unbroken titles and session tags. */
.chat-topbar #new-message{display:flex;align-items:center;gap:10px}.chat-topbar #new-message svg{width:18px;height:18px}.chat-topbar p{margin:0}.chat-layout{min-width:0;max-width:100%;display:grid;grid-template-columns:minmax(250px,.85fr) minmax(0,1.65fr);gap:0;height:clamp(500px,70svh,800px);border:1px solid #28313a;border-radius:16px;overflow:hidden;background:#0f141b}.chat-sidebar{min-width:0;display:flex;flex-direction:column;border-right:1px solid #28313a;background:#111720}.chat-search{padding:16px}.chat-search input{font-size:.85rem;border-radius:12px;background:#19212b;border:0;min-height:42px}.chat-thread-list{min-width:0;overflow-y:auto;min-height:0;flex:1;padding:0 8px 10px;overscroll-behavior:contain}.chat-thread{position:relative;display:flex;align-items:center;gap:12px;width:100%;border:0;border-radius:10px;background:none;padding:15px 10px;text-align:left;min-height:94px}.chat-thread:hover{background:#19212b}.chat-thread.selected{background:#1c2b28}.chat-thread[hidden]{display:none}.chat-avatar{width:42px;height:42px;flex-shrink:0;display:grid;place-items:center;border-radius:50%;background:#294044;color:#9bddd4;font-weight:650;font-size:1.05rem}.chat-avatar.group{background:#33304b;color:#b2a4e3}.chat-avatar svg{width:19px;height:19px}.chat-thread-copy{min-width:0;flex:1;display:grid;grid-template-columns:minmax(0,1fr);gap:5px}.chat-thread-title{min-width:0;display:flex;align-items:baseline;justify-content:space-between;gap:8px}.chat-thread-title strong{font-size:.9rem;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-thread-title time{flex:none;font-size:.65rem;color:#90a0ab}.chat-thread-preview{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#acb8c0;font-size:.8rem;line-height:1.4}.chat-thread-meta{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:26px;font-size:.65rem;color:#71838f}.chat-unread{position:absolute;right:10px;bottom:15px;min-width:18px;height:18px;display:grid;place-items:center;padding:0 5px;border-radius:20px;color:#112319;background:#b3e878;font-size:.6rem;font-weight:650}.chat-empty{padding:35px 18px;color:#8a9ca6;font-size:.85rem}.chat-empty h2{font-size:1rem}.chat-thread-list>#more-threads{width:100%;margin:14px 0;background:transparent;color:#99b8ae;border:0;font-size:.8rem}
.chat-detail{min-width:0;min-height:0;display:flex;flex-direction:column;background:#0e141b}.chat-welcome{margin:auto;text-align:center;padding:35px;color:#8a9ca6;font-size:.85rem}.chat-welcome>svg{width:40px;height:40px;color:#8fac9e;margin-bottom:18px}.chat-welcome h2{color:#d4e0e7;margin-bottom:10px}.chat-welcome a{font-size:.75rem;color:#86a6a0}.chat-loading{margin:auto;color:#8d9da6;padding:30px}
.chat-header{display:flex;align-items:center;gap:12px;padding:16px 20px;min-height:79px;border-bottom:1px solid #26313a;background:#141b24;flex-shrink:0}.chat-header-copy{flex:1;min-width:0}.chat-header h2{margin:0;font-size:.95rem;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-header p{margin:5px 0 0;font-size:.68rem;color:#8fabb0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.chat-header #chat-back{display:none;border:0;background:none;padding:5px;width:34px;min-height:40px;color:#c2d3da}.chat-header #chat-back svg{width:24px;height:24px}.chat-resolve{border:0;background:#ffffff06;color:#8da8a2;min-height:36px;padding:8px 10px;font-size:.7rem;white-space:nowrap}
.chat-messages{overflow-y:auto;flex:1;min-height:0;padding:16px 24px 20px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#364550 transparent;background:radial-gradient(ellipse at top right,#1a2a2626,transparent 65%),#0d141a}.chat-day{text-align:center;color:#8b9aab;font-size:.65rem;margin:12px 0 22px}.chat-message{display:flex;justify-content:flex-start;margin:12px 0}.chat-message.own{justify-content:flex-end}.chat-bubble{max-width:86%;padding:12px 14px 8px;border-radius:16px 16px 16px 4px;background:#1d2732;border:1px solid #ffffff04;box-shadow:0 2px 8px #0001}.chat-message.own .chat-bubble{background:#243b31;border-color:#405e432b;border-radius:16px 16px 4px 16px}.chat-author{display:block;font-size:.7rem;color:#91c7db;font-weight:600}.own .chat-author{color:#b3d99d}.chat-bubble p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55;margin:6px 0 5px;font-size:.9rem;color:#e2ecee}.chat-bubble footer{display:flex;align-items:center;justify-content:flex-end;gap:6px;font-size:.6rem;color:#99aeb4}.chat-bubble footer time{font-size:.6rem}.chat-version{position:relative}.chat-version summary{display:flex;list-style:none;cursor:pointer;padding:3px;color:#95bdaa}.chat-version summary::-webkit-details-marker{display:none}.chat-version svg{width:13px;height:13px}.chat-version code{position:absolute;bottom:22px;right:0;white-space:nowrap;padding:8px;border:1px solid #34434a;border-radius:8px;background:#111a20;font-size:.65rem;z-index:2}.chat-messages>#older-messages{display:block;margin:0 auto 16px;border:0;background:transparent;color:#8caea4;font-size:.75rem;padding:8px;min-height:36px}.chat-messages>#older-messages[hidden]{display:none}
.chat-composer{flex-shrink:0;display:flex;align-items:flex-end;gap:12px;padding:14px 20px;background:#131b23;border-top:1px solid #29333c;flex-wrap:wrap}.chat-composer textarea{flex:1;min-width:0;min-height:44px;max-height:140px;resize:none;border:0;border-radius:16px;background:#1e2932;line-height:1.4;padding:12px 15px;font-size:.9rem}.chat-composer .chat-send{flex:none;width:44px;height:44px;min-height:44px;display:grid;place-items:center;padding:9px;border-radius:50%;background:#b3e878;border-color:#b3e878;color:#183321}.chat-send svg{width:21px;height:21px}.chat-composer .error{width:100%;margin:0;font-size:.8rem}.chat-composer .error:empty{display:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:950px) and (min-width:751px){.chat-layout{grid-template-columns:minmax(210px,.85fr) minmax(0,1.3fr)}.chat-thread{gap:8px}.chat-thread .chat-avatar{width:32px;height:32px}.chat-messages{padding:12px}.chat-header{padding:14px 12px}}
@media(max-width:750px){.chat-topbar{display:flex;align-items:center;flex-wrap:nowrap;gap:14px}.chat-topbar>div:first-child{width:auto;flex:1;min-width:0}.chat-topbar h1{margin-bottom:6px}.chat-topbar p{font-size:.75rem}.chat-topbar #new-message{width:44px;min-height:44px;height:44px;flex:none;padding:11px;border-radius:50%;justify-content:center}.chat-topbar #new-message span{display:none}.chat-layout{display:block;height:auto;min-height:0;border:0;border-radius:0;background:transparent;overflow:visible}.chat-sidebar{border:0;background:transparent}.chat-search{padding:0 0 14px}.chat-search input{font-size:16px;min-height:44px}.chat-thread-list{padding:0;overflow:visible}.chat-thread{padding:16px 0;gap:14px;border-radius:0;border-bottom:1px solid #26323a;min-height:96px}.chat-thread.selected,.chat-thread:hover{background:transparent}.chat-thread .chat-avatar{width:49px;height:49px}.chat-thread-title strong{font-size:1rem}.chat-thread-title time{font-size:.68rem}.chat-thread-preview{font-size:.85rem}.chat-thread-meta{font-size:.7rem}.chat-detail{display:none}.chat-layout.has-active{position:fixed;inset:var(--chat-top,0px) 0 auto;height:var(--chat-height,100dvh);z-index:20;background:#0e141b;display:flex;flex-direction:column;overflow:hidden}.has-active .chat-sidebar{display:none}.has-active .chat-detail{display:flex;flex:1;min-height:0}.chat-conversation{overflow:hidden}.chat-conversation .mobile-header,.chat-conversation .nav{display:none}.chat-header{padding:calc(12px + env(safe-area-inset-top)) 12px 12px;gap:10px;min-height:74px}.chat-header #chat-back{display:grid;place-items:center;flex:none}.chat-header .chat-avatar{width:36px;height:36px;font-size:.9rem}.chat-header h2{font-size:.95rem}.chat-header p{font-size:.66rem}.chat-header .chat-resolve{font-size:.63rem;padding:8px;min-height:38px}.chat-messages{padding:12px 15px 20px}.chat-bubble{max-width:90%;padding:11px 13px 7px}.chat-bubble p{font-size:.95rem;line-height:1.5}.chat-composer{padding:10px max(12px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));gap:10px}.chat-composer textarea{font-size:16px;border-radius:18px;min-height:44px}.chat-composer .chat-send{width:44px;height:44px}.chat-day{font-size:.65rem}}

.mention-picker{margin:6px 0;max-height:180px;overflow-y:auto;border:1px solid #34454b;border-radius:12px;background:#17232b;z-index:30;min-width:0}.mention-picker[hidden]{display:none}.mention-picker button{display:block;width:100%;min-width:0;border:0;border-radius:0;background:transparent;text-align:left;padding:12px 14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.85rem;color:#b6d9cc}.mention-picker button[aria-selected=true],.mention-picker button:hover{background:#293e36}.chat-composer{position:relative}.chat-composer .mention-picker{position:absolute;bottom:100%;left:12px;right:12px;margin:0 0 6px}
