/* ClearBooks Portal — Team chat (v3 look: hairlines, layered shadows, Inter, navy #1D4757 / teal #16AFB8). */
.avatar.xs{width:18px;height:18px;font-size:8px;box-shadow:0 0 0 1.5px #fff}
.cl-badge.sm{width:24px;height:24px;border-radius:7px;font-size:9.5px}
.nav-badge.chat-badge.mention{background:#E5484D;color:#fff}
.nav-badge[hidden]{display:none!important}

/* layout (desktop: list + conversation in one card that fills the window) */
body.chat-body .content{padding-top:24px;padding-bottom:24px}
body.chat-body .content>.flash{margin-bottom:12px}
.chat-app{display:grid;grid-template-columns:316px minmax(0,1fr);height:calc(100vh - 48px);height:calc(100dvh - 48px);min-height:520px;background:#fff;border-radius:var(--r);box-shadow:var(--sh-2);overflow:hidden}
.chat-side{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--hair);background:linear-gradient(180deg,#FBFDFD,#F6FAFA)}
.chat-side-head{display:flex;align-items:center;justify-content:space-between;padding:20px 18px 10px}
.chat-side-head h1{font-size:24px;margin:0;letter-spacing:-.03em}
.chat-side-actions{display:flex;gap:4px}
.chat-side-actions .icon-btn,.chat-head .icon-btn{width:36px;height:36px;border-radius:10px;display:inline-grid;place-items:center;color:var(--ink-2);background:transparent;border:1px solid transparent;cursor:pointer;transition:background .2s,color .2s}
.chat-side-actions .icon-btn:hover,.chat-head .icon-btn:hover{background:var(--teal-t);color:var(--teal-ink)}
.chat-filter{display:flex;align-items:center;gap:8px;margin:0 14px 8px;padding:0 12px;height:38px;border-radius:10px;background:#fff;box-shadow:inset 0 0 0 1px var(--hair-2);color:var(--ink-3)}
.chat-filter .ic{width:16px;height:16px;flex:none}
.chat-filter input{border:0;box-shadow:none!important;padding:0;height:36px;background:transparent;font-size:14px;width:100%}
.chat-list{flex:1;overflow-y:auto;padding:4px 8px 16px;-webkit-overflow-scrolling:touch}
.ch-group h3{font-size:11.5px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);margin:14px 10px 6px}
.ch-item{display:flex;align-items:center;gap:11px;width:100%;padding:9px 10px;border-radius:12px;color:var(--ink);text-decoration:none;border:0;background:transparent;text-align:left;font:inherit;cursor:pointer;transition:background .18s}
.ch-item[hidden]{display:none}
.ch-item:hover{background:rgba(22,175,184,.07)}
.ch-item.on{background:#fff;box-shadow:var(--sh-1),inset 3px 0 0 var(--teal)}
.ch-item .avatar,.ch-item .cl-badge{width:34px;height:34px;font-size:12px;flex:none}
.ch-item .cl-badge{border-radius:10px}
.ch-hash{width:34px;height:34px;border-radius:10px;display:inline-grid;place-items:center;flex:none;background:var(--teal-t);color:var(--teal-ink);font-weight:750;font-size:17px}
.ch-hash.big{width:40px;height:40px;font-size:20px;border-radius:12px}
.ch-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.ch-name{font-weight:600;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-.005em}
.ch-last{font-size:12.5px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ch-item.unread .ch-name{font-weight:750;color:var(--navy)}.ch-item.unread .ch-last{color:var(--ink-2);font-weight:550}
.ch-meta{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none}
.ch-meta time{font-size:11.5px;color:var(--ink-3);font-variant-numeric:tabular-nums}
.ch-item.unread .ch-meta time{color:var(--teal-ink);font-weight:600}
.ch-badge{min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--teal);color:#fff;font-size:11px;font-weight:700;display:inline-grid;place-items:center;font-variant-numeric:tabular-nums}
.ch-badge.mention{background:#E5484D}
.ch-empty .ch-name{color:var(--teal-ink);font-weight:600}

.chat-main{display:flex;flex-direction:column;min-width:0;min-height:0;position:relative;background:
  radial-gradient(600px 260px at 100% 0,rgba(22,175,184,.06),transparent 70%),linear-gradient(180deg,#F7FAFB,#F2F7F8)}
.chat-main.drop::after{content:"Drop to attach";position:absolute;inset:12px;border:2px dashed var(--teal);border-radius:16px;background:rgba(228,245,246,.85);display:grid;place-items:center;font-weight:650;color:var(--teal-ink);z-index:30}
.chat-head{display:flex;align-items:center;gap:12px;padding:14px 20px;background:rgba(255,255,255,.82);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-bottom:1px solid var(--hair);z-index:5}
.chat-head .avatar,.chat-head .cl-badge{width:40px;height:40px;font-size:14px;border-radius:12px}
.chat-head .avatar{border-radius:50%}
.chat-title{flex:1;min-width:0}
.chat-title h2{margin:0;font-size:17px;font-weight:700;letter-spacing:-.02em;color:var(--navy);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-title p{margin:1px 0 0;font-size:12.5px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-head-actions{display:flex;gap:6px;align-items:center}
.chat-head-actions .btn .ic{width:16px;height:16px}
.chat-back{display:none}
.chat-none{flex:1;display:grid;place-items:center;align-content:center;gap:8px;color:var(--ink-3)}.chat-none .ic{width:40px;height:40px;color:var(--teal)}

.chat-scroll{flex:1;overflow-y:auto;overflow-anchor:none;padding:18px 22px 10px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.chat-older{text-align:center;margin:0 0 10px}
.chat-msgs{display:flex;flex-direction:column;gap:2px;max-width:860px;margin:0 auto}
.chat-skel{display:flex;flex-direction:column;gap:12px;padding:20px 0}
.chat-skel i{display:block;height:42px;border-radius:16px;background:linear-gradient(90deg,#EAF1F3,#F5F9FA,#EAF1F3);background-size:200% 100%;animation:shimmer 1.2s infinite linear;width:46%}
.chat-skel i:nth-child(2){width:62%;align-self:flex-end;background-color:#DDF2F3}.chat-skel i:nth-child(3){width:38%}
@keyframes shimmer{to{background-position:-200% 0}}
.chat-empty{display:grid;justify-items:center;text-align:center;gap:6px;padding:60px 20px;color:var(--ink-2)}
.chat-empty b{font-size:16px;color:var(--navy)}.chat-empty p{margin:0;max-width:340px;font-size:14px;color:var(--ink-3)}
.ce-art{position:relative;width:96px;height:70px;margin-bottom:10px}
.ce-art span{position:absolute;border-radius:16px;height:26px}
.ce-art span:nth-child(1){left:0;top:4px;width:58px;background:#fff;box-shadow:var(--sh-2)}
.ce-art span:nth-child(2){right:0;top:24px;width:62px;background:linear-gradient(135deg,#16AFB8,#1D4757);border-bottom-right-radius:5px}
.ce-art span:nth-child(3){left:10px;top:46px;width:40px;background:#fff;box-shadow:var(--sh-2);border-bottom-left-radius:5px}

.day-sep{display:flex;justify-content:center;margin:16px 0 10px;pointer-events:none}
.day-sep span{font-size:12px;font-weight:600;color:var(--ink-2);background:rgba(255,255,255,.9);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);padding:5px 12px;border-radius:999px;box-shadow:var(--sh-1)}
.new-sep{display:flex;align-items:center;gap:10px;margin:10px 0;color:#E5484D;font-size:12px;font-weight:700}
.new-sep::before,.new-sep::after{content:"";flex:1;height:1px;background:rgba(229,72,77,.35)}

.msg{display:flex;align-items:flex-end;gap:8px;position:relative;margin-top:10px;padding:0 34px 0 0}
.msg.grouped{margin-top:2px}
.msg.mine{flex-direction:row-reverse;padding:0 0 0 34px}
.msg-av,.msg-av-sp{width:30px;height:30px;font-size:11px;flex:none;margin-bottom:2px}
.msg-av-sp{display:inline-block}
.msg-col{display:flex;flex-direction:column;align-items:flex-start;max-width:min(560px,78%);min-width:0}
.msg.mine .msg-col{align-items:flex-end}
.msg-who{font-size:12px;font-weight:650;color:var(--ink-2);margin:0 0 3px 12px}
.bubble{position:relative;background:#fff;border-radius:18px;padding:9px 13px 7px;box-shadow:0 0 0 1px rgba(16,42,52,.06),0 1px 2px rgba(16,42,52,.06);min-width:64px;max-width:100%;overflow-wrap:anywhere}
.msg:not(.grouped):not(.mine) .bubble{border-bottom-left-radius:6px}
.msg.mine .bubble{background:linear-gradient(135deg,#1B5466 0%,#1D4757 55%,#173E4C 100%);color:#fff;box-shadow:0 1px 0 rgba(255,255,255,.12) inset,0 6px 16px -10px rgba(23,63,78,.6)}
.msg.mine:not(.grouped) .bubble{border-bottom-right-radius:6px}
.msg.at-me:not(.mine) .bubble{box-shadow:0 0 0 1.5px rgba(242,179,90,.9),0 4px 14px -8px rgba(242,179,90,.7);background:#FFFBF3}
.msg-text{font-size:15px;line-height:1.42;white-space:normal}
.msg-text a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.msg.mine .msg-text a{color:#BFF3F5}
.msg-text .mention{display:inline;color:var(--teal-ink);font-weight:650;background:var(--teal-t);border-radius:5px;padding:0 3px;white-space:nowrap}
.msg-text .mention.me{background:#FDECC8;color:#7A4A00}
.msg.mine .msg-text .mention{background:rgba(255,255,255,.16);color:#fff}
.msg-time{display:block;text-align:right;font-size:11px;color:var(--ink-3);margin-top:2px;font-variant-numeric:tabular-nums;white-space:nowrap}
.msg.mine .msg-time{color:rgba(255,255,255,.66)}
.deleted-text{font-style:italic;color:var(--ink-3);font-size:14px}
.msg.deleted .bubble{background:transparent;box-shadow:inset 0 0 0 1px var(--hair-2)}
.msg.mine.deleted .bubble{background:transparent;box-shadow:inset 0 0 0 1px var(--hair-2)}.msg.mine.deleted .msg-time{color:var(--ink-3)}
.quote{display:flex;flex-direction:column;align-items:flex-start;width:100%;text-align:left;border:0;cursor:pointer;margin:2px 0 6px;padding:6px 10px;border-radius:10px;background:rgba(22,175,184,.09);box-shadow:inset 3px 0 0 var(--teal);font:inherit;color:inherit}
.quote b{font-size:12px;color:var(--teal-ink)}.quote span{font-size:13px;color:var(--ink-2);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.msg.mine .quote{background:rgba(255,255,255,.12);box-shadow:inset 3px 0 0 #7FE3E8}.msg.mine .quote b{color:#9FEDF1}.msg.mine .quote span{color:rgba(255,255,255,.82)}
.att-imgs{display:grid;gap:4px;margin:0 -7px 6px;border-radius:14px;overflow:hidden}
.att-imgs.n2,.att-imgs.n4{grid-template-columns:1fr 1fr}.att-imgs.n3{grid-template-columns:1fr 1fr}.att-imgs.n3 .att-img:first-child{grid-column:span 2}
.att-img{display:block;padding:0;border:0;background:#E9F0F2;cursor:zoom-in;line-height:0}
.att-img img{width:100%;max-height:320px;min-height:90px;object-fit:cover;display:block}
.att-imgs.n1 .att-img img{max-width:340px;max-height:380px;object-fit:cover}
.att-video{margin:0 -7px 6px;border-radius:14px;overflow:hidden;background:#000;line-height:0;text-align:center}
.att-video video{width:100%;max-width:380px;max-height:min(420px,52vh);display:block;margin:0 auto}
.msg.media-only .bubble{padding:4px 4px 4px;background:#fff}
.msg.media-only .att-imgs,.msg.media-only .att-video{margin:0 0 2px}
.msg.media-only .msg-time{position:absolute;right:12px;bottom:10px;color:#fff;background:rgba(0,0,0,.45);padding:1px 7px;border-radius:999px;margin:0}
.msg.mine.media-only .bubble{background:#fff}
.att-file{display:flex;align-items:center;gap:10px;padding:9px 12px;margin:2px 0 6px;border-radius:12px;background:rgba(16,42,52,.05);text-decoration:none;color:inherit;min-width:220px;max-width:100%}
.att-file .ic{width:26px;height:26px;color:var(--teal-ink);flex:none}
.att-file span{display:flex;flex-direction:column;min-width:0}.att-file b{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.att-file small{font-size:12px;color:var(--ink-3)}
.msg.mine .att-file{background:rgba(255,255,255,.12)}.msg.mine .att-file .ic{color:#9FEDF1}.msg.mine .att-file small{color:rgba(255,255,255,.7)}
.att-file.mini{min-width:0;padding:2px 0;background:none;font-size:12px;opacity:.75}
.voice{display:flex;align-items:center;gap:10px;min-width:220px;padding:2px 0 0}
.v-play{width:38px;height:38px;border-radius:50%;border:0;flex:none;display:grid;place-items:center;cursor:pointer;background:linear-gradient(135deg,#16AFB8,#1D4757);color:#fff;box-shadow:0 6px 14px -6px rgba(22,175,184,.7);transition:transform .2s var(--spring)}
.v-play:active{transform:scale(.92)}
.v-play svg{width:16px;height:16px;margin-left:2px}.voice.playing .v-play svg{margin-left:0}
.msg.mine .v-play{background:#fff;color:var(--navy);box-shadow:none}
.v-wave{flex:1;display:flex;align-items:center;gap:2px;height:30px;cursor:pointer;min-width:120px}
.v-wave i{flex:1;max-width:4px;border-radius:2px;background:rgba(29,71,87,.25);height:30%;transition:background .15s}
.v-wave i.h1{height:22%}.v-wave i.h2{height:34%}.v-wave i.h3{height:48%}.v-wave i.h4{height:62%}.v-wave i.h5{height:78%}.v-wave i.h6{height:92%}.v-wave i.h7{height:56%}
.v-wave i.on{background:var(--teal)}
.msg.mine .v-wave i{background:rgba(255,255,255,.35)}.msg.mine .v-wave i.on{background:#7FE3E8}
.v-dur{font-size:12px;font-weight:600;color:var(--ink-2);font-variant-numeric:tabular-nums;min-width:34px}
.msg.mine .v-dur{color:rgba(255,255,255,.85)}
.voice audio{display:none}
.msg-task{display:inline-flex;align-items:center;gap:5px;margin:4px 6px 0;font-size:12px;font-weight:600;color:var(--ok);text-decoration:none;background:var(--ok-t);padding:3px 9px;border-radius:999px}
.msg-task .ic{width:13px;height:13px}
.msg-more{position:absolute;right:0;bottom:6px;width:30px;height:30px;border-radius:9px;border:0;background:#fff;box-shadow:var(--sh-1);color:var(--ink-3);display:grid;place-items:center;cursor:pointer;opacity:0;transition:opacity .15s}
.msg.mine .msg-more{right:auto;left:0}
.msg-more .ic{width:18px;height:18px}
.msg:hover .msg-more,.msg.menu-on .msg-more,.msg-more:focus-visible{opacity:1}
@media (hover:none){.msg-more{display:none}.msg{padding-right:0}.msg.mine{padding-left:0}}
.msg.flash-hl .bubble{animation:hl 1.6s var(--ease)}
@keyframes hl{0%,30%{box-shadow:0 0 0 3px rgba(22,175,184,.55)}}
.seen-row{display:flex;justify-content:flex-end;align-items:center;gap:6px;margin:4px 2px 2px;font-size:11.5px;color:var(--ink-3)}
.seen-row .seen{color:var(--teal-ink);display:inline-flex;align-items:center;gap:3px;font-weight:550}
.seen-row .seen .ic{width:13px;height:13px}
.seen-avs{display:inline-flex}.seen-avs .avatar+.avatar{margin-left:-5px}
.jump-new{position:absolute;left:50%;bottom:92px;transform:translateX(-50%);border:0;border-radius:999px;padding:8px 14px;background:var(--navy);color:#fff;font:600 13px Inter,system-ui,sans-serif;display:inline-flex;align-items:center;gap:6px;box-shadow:var(--sh-3);cursor:pointer;z-index:6}
.jump-new .ic{width:15px;height:15px}
.jump-new[hidden]{display:none}

/* composer */
.composer{position:relative;padding:10px 16px 14px;background:rgba(255,255,255,.88);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-top:1px solid var(--hair);z-index:5}
.comp-row{display:flex;align-items:flex-end;gap:8px;max-width:900px;margin:0 auto}
.comp-row[hidden]{display:none}
.comp-tools{display:flex;gap:2px}
.comp-btn{width:40px;height:40px;border-radius:12px;display:inline-grid;place-items:center;color:var(--ink-2);cursor:pointer;border:0;background:transparent;font-size:19px;transition:background .2s,color .2s}
.comp-btn input{display:none!important}
.comp-btn:hover{background:var(--teal-t);color:var(--teal-ink)}
.comp-btn .ic{width:21px;height:21px}
.comp-input{flex:1;min-width:0;position:relative}
.comp-input textarea{width:100%;resize:none;min-height:42px;max-height:160px;border-radius:21px;padding:10px 16px;font-size:15px;line-height:1.4;background:#fff;border:1px solid var(--hair-2);display:block;overflow-y:auto}
.comp-input .mention-pop{bottom:calc(100% + 6px);top:auto;left:8px}
.comp-mic,.comp-send{width:42px;height:42px;border-radius:50%;border:0;flex:none;display:grid;place-items:center;cursor:pointer;color:#fff;background:linear-gradient(135deg,#16AFB8,#1D4757);box-shadow:0 8px 18px -8px rgba(22,175,184,.8);transition:transform .2s var(--spring),box-shadow .2s;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.comp-mic:hover,.comp-send:hover{transform:translateY(-1px) scale(1.04)}
.comp-mic:active{transform:scale(.94)}
.comp-mic .ic,.comp-send .ic{width:20px;height:20px}
.comp-mic[hidden],.comp-send[hidden]{display:none}
.composer.sending .comp-send{opacity:.6}
.reply-bar,.edit-bar{display:flex;align-items:center;gap:10px;max-width:900px;margin:0 auto 8px;padding:7px 8px 7px 12px;border-radius:12px;background:var(--teal-t);font-size:13px}
.reply-bar[hidden],.edit-bar[hidden],.att-tray[hidden],.rec-bar[hidden]{display:none}
.rb-line{width:3px;align-self:stretch;border-radius:3px;background:var(--teal)}
.rb-main{flex:1;min-width:0;display:flex;flex-direction:column}.rb-main b{color:var(--teal-ink);font-size:12.5px}.rb-main span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink-2)}
.edit-bar{color:var(--teal-ink);font-weight:600}.edit-bar span{flex:1}.edit-bar .ic{width:16px;height:16px}
.reply-bar .icon-btn,.edit-bar .icon-btn{width:28px;height:28px;border-radius:8px;border:0;background:transparent;cursor:pointer;color:var(--ink-2)}
.att-tray{display:flex;gap:8px;flex-wrap:wrap;max-width:900px;margin:0 auto 8px;position:relative;padding-bottom:6px}
.att-chip{position:relative;display:flex;align-items:center;gap:8px;padding:8px 30px 8px 10px;border-radius:12px;background:#fff;box-shadow:var(--sh-1);font-size:13px;max-width:240px}
.att-chip span{display:flex;flex-direction:column;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.att-chip small{color:var(--ink-3)}
.att-chip .ic{width:22px;height:22px;color:var(--teal-ink);flex:none}
.att-chip.thumb{padding:0;width:64px;height:64px;overflow:hidden}
.att-chip.thumb img,.att-chip.thumb video{width:100%;height:100%;object-fit:cover}
.att-chip.vid::before{content:"▶";position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:16px;background:rgba(0,0,0,.25);z-index:1}
.att-x{position:absolute;top:4px;right:4px;width:20px;height:20px;border-radius:50%;border:0;background:rgba(16,42,52,.72);color:#fff;font-size:10px;cursor:pointer;z-index:2;display:grid;place-items:center}
.up-bar{position:absolute;left:0;right:0;bottom:0;height:3px;border-radius:3px;background:var(--hair);opacity:0}
.up-bar.on{opacity:1}.up-bar i{display:block;height:100%;width:0;border-radius:3px;background:var(--teal);transition:width .2s}
.rec-bar{display:flex;align-items:center;gap:12px;max-width:900px;margin:0 auto;height:44px;padding:0 4px 0 6px;border-radius:22px;background:#fff;box-shadow:inset 0 0 0 1px rgba(229,72,77,.35),0 8px 20px -14px rgba(229,72,77,.6)}
.rec-cancel{width:36px;height:36px;border-radius:50%;border:0;background:transparent;color:var(--ink-3);display:grid;place-items:center;cursor:pointer}
.rec-cancel:hover{color:#E5484D;background:#FDECEE}.rec-cancel .ic{width:19px;height:19px}
.rec-dot{width:10px;height:10px;border-radius:50%;background:#E5484D;box-shadow:0 0 0 0 rgba(229,72,77,.6);animation:recpulse 1.2s infinite}
@keyframes recpulse{70%{box-shadow:0 0 0 8px rgba(229,72,77,0)}100%{box-shadow:0 0 0 0 rgba(229,72,77,0)}}
.rec-time{font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink);min-width:38px}
.rec-wave{flex:1;display:flex;align-items:center;gap:3px;height:26px;overflow:hidden}
.rec-wave i{flex:1;max-width:4px;height:100%;border-radius:2px;background:#E5484D;opacity:.75;transform:scaleY(.15);transition:transform .09s linear}
.rec-hint{font-size:12.5px;color:var(--ink-3);white-space:nowrap}
.rec-send{width:38px;height:38px;border-radius:50%;border:0;background:linear-gradient(135deg,#16AFB8,#1D4757);color:#fff;display:grid;place-items:center;cursor:pointer;flex:none}
.rec-send .ic{width:18px;height:18px}
.emoji-pop{position:absolute;bottom:calc(100% - 4px);left:16px;display:grid;grid-template-columns:repeat(8,36px);gap:2px;padding:8px;border-radius:14px;background:#fff;box-shadow:var(--sh-3);z-index:20}
.emoji-pop[hidden]{display:none}
.emoji-pop button{width:36px;height:36px;border:0;background:transparent;border-radius:9px;font-size:20px;cursor:pointer}
.emoji-pop button:hover{background:var(--teal-t)}

/* menus, dialogs, lightbox */
.msg-menu{position:fixed;z-index:60;min-width:190px;padding:6px;border-radius:14px;background:rgba(255,255,255,.96);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);box-shadow:var(--sh-3);animation:pop .16s var(--ease)}
.msg-menu[hidden]{display:none}
.msg-menu button{display:flex;align-items:center;gap:10px;width:100%;padding:9px 12px;border:0;background:transparent;border-radius:9px;font:500 14px Inter,system-ui,sans-serif;color:var(--ink);cursor:pointer;text-align:left}
.msg-menu button[hidden]{display:none}
.msg-menu button:hover{background:var(--teal-t)}.msg-menu .ic{width:17px;height:17px;color:var(--ink-3)}
.msg-menu .danger{color:var(--danger)}.msg-menu .danger .ic{color:var(--danger)}
@keyframes pop{from{opacity:0;transform:scale(.96) translateY(-4px)}}
.lightbox{position:fixed;inset:0;z-index:80;background:rgba(6,20,26,.92);display:grid;place-items:center;padding:max(16px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom))}
.lightbox[hidden]{display:none}
.lightbox img{max-width:100%;max-height:calc(100vh - 120px);border-radius:12px;box-shadow:0 30px 80px rgba(0,0,0,.5)}
.lb-close{position:absolute;top:max(14px,env(safe-area-inset-top));right:16px;width:42px;height:42px;border-radius:50%;border:0;background:rgba(255,255,255,.14);color:#fff;font-size:18px;cursor:pointer}
.lb-dl{position:absolute;bottom:max(18px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%)}
.chat-dialog{border:0;border-radius:18px;padding:0 20px 20px;width:min(440px,calc(100vw - 32px));box-shadow:var(--sh-3)}
.chat-dialog::backdrop{background:rgba(11,34,43,.45);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.cd-head{display:flex;align-items:center;justify-content:space-between;margin:0 -4px 6px;padding:16px 0 4px}
.cd-head h3{margin:0;font-size:18px;color:var(--navy)}
.cd-head .icon-btn{width:34px;height:34px;border-radius:10px;border:0;background:transparent;cursor:pointer;color:var(--ink-2)}
.dm-pick{list-style:none;margin:0;padding:0}
.dm-pick a{display:flex;align-items:center;gap:12px;padding:10px;border-radius:12px;color:var(--ink);text-decoration:none}
.dm-pick a:hover{background:var(--teal-t)}.dm-pick span{display:flex;flex-direction:column}.dm-pick small{color:var(--ink-3)}
.dm-pick .avatar{width:38px;height:38px;font-size:13px}
.hash-input{display:flex;align-items:center;border:1px solid var(--line-2);border-radius:10px;padding-left:12px;background:#fff}
.hash-input i{font-style:normal;color:var(--ink-3);font-weight:700}
.hash-input input{border:0!important;box-shadow:none!important}
.member-pick{display:flex;flex-direction:column;gap:4px;max-height:220px;overflow:auto;margin-top:6px;padding:6px;border-radius:12px;background:#F6FAFA}
.member-pick .check{display:flex;align-items:center;gap:8px;font-weight:500}
.channel-form .radio{display:flex;align-items:center;gap:8px;font-weight:500}
.channel-form input[type=radio],.channel-form input[type=checkbox]{width:18px;height:18px;flex:none;margin:0;padding:0;accent-color:var(--teal)}
.member-pick .check{justify-content:flex-start}
.channel-form fieldset:has(input[name=everyone][value="1"]:checked) .member-pick{display:none}
.chat-dialog .danger-zone{margin-top:14px}

/* client page card + My Day mentions + task link */
.chat-recent .sec{justify-content:flex-start}.sec-link{margin-left:auto;font-size:13px;font-weight:600;display:inline-flex;align-items:center;gap:4px}
.sec-link .ic{width:14px;height:14px}
.cr-list{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-direction:column;gap:2px}
.cr-list a{display:flex;gap:10px;padding:8px;border-radius:12px;color:var(--ink);text-decoration:none}
.cr-list a:hover{background:var(--teal-t)}
.cr-main{display:flex;flex-direction:column;min-width:0;flex:1}
.cr-head{display:flex;justify-content:space-between;gap:8px;font-size:13px}.cr-head time{color:var(--ink-3);font-size:11.5px;white-space:nowrap}
.cr-text{font-size:13.5px;color:var(--ink-2);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.mention-link{display:block;color:inherit;text-decoration:none}
.mention-card .sec .ic{background:#FDF0DC;color:#9A5B06}
.from-chat{display:inline-flex;align-items:center;gap:6px;margin-top:10px;font-weight:600;font-size:13.5px}
.from-chat .ic{width:15px;height:15px}
.topbar .top-admin{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:10px;color:#CFE6EA}
.topbar .top-admin .ic{width:20px;height:20px}.topbar .top-admin.on{background:rgba(255,255,255,.12);color:#fff}

@media (prefers-reduced-motion:no-preference){
  .msg.enter{animation:msgin .32s var(--ease) both}
  .msg.mine.enter{animation-name:msginr}
  @keyframes msgin{from{opacity:0;transform:translateY(8px) scale(.98)}}
  @keyframes msginr{from{opacity:0;transform:translateY(8px) scale(.98);transform-origin:right bottom}}
}
body.chat-body .content>*{animation:none!important}

/* tablet */
@media (min-width:901px) and (max-width:1180px){.chat-app{grid-template-columns:272px minmax(0,1fr)}}

/* phone: the list is its own screen; a conversation is full-screen with the composer pinned above the keyboard/home bar */
@media (max-width:900px){
  body.chat-body .content{padding:0 0 0;margin:0}
  .chat-app{display:block;height:auto;min-height:0;border-radius:0;box-shadow:none;background:transparent;overflow:visible}
  .chat-mode-list .chat-main{display:none}
  .chat-mode-list .chat-side{border:0;background:transparent;padding-bottom:110px}
  .chat-mode-list .chat-side-head{padding:18px 16px 8px}
  .chat-mode-list .chat-side-head h1{font-size:28px}
  .chat-mode-list .chat-filter{margin:0 16px 6px;height:42px;box-shadow:var(--sh-1)}
  .chat-mode-list .chat-list{overflow:visible;padding:0 10px}
  .chat-mode-list .ch-group{background:#fff;border-radius:16px;box-shadow:var(--sh-1);padding:2px 4px 6px;margin:12px 0}
  .chat-mode-list .ch-group h3{margin:12px 12px 4px}
  .chat-mode-list .ch-item{padding:10px 10px;min-height:60px}
  .chat-mode-list .ch-item .avatar,.chat-mode-list .ch-item .cl-badge,.chat-mode-list .ch-hash{width:42px;height:42px;font-size:14px}
  .chat-mode-list .ch-item.on{box-shadow:none;background:transparent}
  .chat-mode-conv .topbar,.chat-mode-conv .bottomnav{display:none}
  .chat-mode-conv .chat-side{display:none}
  .chat-mode-conv .chat-main{position:fixed;inset:0;z-index:30;height:100vh;height:100dvh}
  .chat-head{padding:8px 12px 8px 6px;padding-top:max(8px,env(safe-area-inset-top));gap:10px;background:rgba(11,34,43,.96);border:0;color:#fff;box-shadow:0 8px 24px -16px rgba(0,0,0,.5)}
  .chat-head .chat-title h2{color:#fff;font-size:16.5px}.chat-head .chat-title p{color:#A9C7CE}
  .chat-head .avatar,.chat-head .cl-badge,.chat-head .ch-hash.big{width:36px;height:36px;font-size:13px}
  .chat-head .ch-hash.big{background:rgba(22,175,184,.2);color:#7FE3E8}
  .chat-back{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:12px;color:#fff}
  .chat-back .ic{width:24px;height:24px}
  .chat-head .icon-btn{color:#CFE6EA}
  .chat-head-actions .btn{padding:0;width:38px;height:38px;justify-content:center;background:rgba(255,255,255,.1);border-color:transparent;color:#fff}
  .chat-head-actions .btn span{display:none}
  .chat-scroll{padding:12px 10px 8px}
  .msg-col{max-width:84%}
  .msg-av,.msg-av-sp{width:26px;height:26px;font-size:10px}
  .composer{padding:8px 8px max(8px,env(safe-area-inset-bottom));padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
  .comp-tools{gap:0}.comp-btn{width:38px;height:42px}
  .emoji-btn{display:none}
  .comp-input textarea{font-size:16px;min-height:42px}
  .comp-mic,.comp-send{width:44px;height:44px}
  .rec-bar{height:48px}
  .jump-new{bottom:calc(84px + env(safe-area-inset-bottom))}
  .att-imgs.n1 .att-img img{max-width:100%}
  .voice{min-width:200px}
}
