.chat-workspace{display:grid;grid-template-columns:300px minmax(0,1fr);height:clamp(540px,calc(100dvh - 215px),850px);overflow:hidden;padding:0;border:1px solid var(--hair);border-radius:22px;background:var(--card)}
.chat-sidebar{display:flex;flex-direction:column;min-width:0;background:var(--panel);border-inline-end:1px solid var(--hair)}
.chat-sidebar__head{display:flex;align-items:center;justify-content:space-between;padding:22px 20px 12px}.chat-sidebar__head h2{font-size:15px;font-weight:650}.chat-sidebar__head>span{color:var(--muted);font-size:12px}
.chat-lenses{display:flex;gap:6px;padding:0 16px 10px}.chat-lenses button{border:1px solid var(--hair);background:transparent;border-radius:999px;padding:4px 10px;font:inherit;font-size:11px;color:var(--muted);cursor:pointer}.chat-lenses button[aria-pressed=true]{background:var(--g-100);color:var(--ink);border-color:transparent}.chat-lenses button:focus-visible{outline:2px solid var(--g-600);outline-offset:2px}
.chat-search{display:flex;align-items:center;gap:8px;margin:0 16px 16px;padding:10px 12px;border:1px solid var(--hair);border-radius:12px;background:var(--card)}.chat-search svg{width:17px;height:17px;flex:none;color:var(--muted)}.chat-search input{min-width:0;width:100%;border:0;background:none;outline:none;font-size:12px;color:var(--ink)}
.chat-conversations{flex:1;overflow:auto;padding:0 8px}.chat-conversation{display:flex;gap:10px;align-items:center;width:100%;padding:14px 10px;border:1px solid transparent;border-radius:13px;text-align:start;color:var(--ink);background:transparent;cursor:pointer;margin-bottom:5px}.chat-conversation:hover{background:var(--card)}.chat-conversation.is-active{border-color:var(--hair);background:var(--card);box-shadow:0 3px 15px #192a2110}
.chat-avatar{display:grid;place-items:center;width:42px;height:42px;flex:none;border-radius:14px;background:var(--g-100);color:var(--g-700,var(--ink));font-size:14px;font-weight:650}.chat-avatar--group{background:var(--hair)}.chat-conversation__copy{flex:1;min-width:0}.chat-conversation__top{display:flex;align-items:center;justify-content:space-between;gap:8px}.chat-conversation__top b{font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.chat-conversation__top time{font-size:10px;color:var(--muted);flex:none}.chat-conversation__preview{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:190px;font-size:11px;color:var(--muted);margin-top:5px}
.chat-unread,.chat-nav-badge{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:7px;background:var(--g-700,#235d40);color:#fff;font-size:10px}.chat-nav-badge{margin-inline-start:auto}.chat-nav-badge[hidden]{display:none}.chat-sidebar__foot{font-size:10px;line-height:1.9;color:var(--muted);padding:14px 20px;border-top:1px solid var(--hair)}
.chat-thread{min-width:0;min-height:0}.chat-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px;gap:16px}.chat-empty__icon{width:76px;height:76px;background:var(--g-100);border-radius:25px;display:grid;place-items:center}.chat-empty__icon svg{width:30px;height:30px}.chat-empty h2{font-size:20px}.chat-empty p{font-size:13px;color:var(--muted);line-height:1.8;max-width:330px}.chat-empty .btn{min-height:42px;padding-inline:24px}.chat-empty[hidden]{display:none}
.chat-thread__body{display:flex;flex-direction:column;height:100%;min-width:0}.chat-thread__body[hidden]{display:none}.chat-thread__head{display:flex;align-items:center;gap:12px;padding:18px 22px;border-bottom:1px solid var(--hair);min-width:0}.chat-thread__identity{flex:1;min-width:0}.chat-thread__identity h2{font-size:15px;font-weight:650}.chat-thread__identity p{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px}.chat-thread__head .icon-btn{display:grid;place-items:center;width:34px;height:34px;flex:none}.chat-thread__head .icon-btn svg{width:17px;height:17px}.chat-thread__head .chat-mobile-back{display:none}
.chat-message-search{padding:9px 22px;background:var(--panel);border-bottom:1px solid var(--hair)}.chat-message-search input{width:100%;border:0;background:transparent;font-size:11px;color:var(--ink);padding:5px 0}.chat-message-scroll{flex:1;overflow:auto;min-height:0;padding:20px 24px;overscroll-behavior:contain}.chat-messages{display:flex;flex-direction:column;gap:14px;direction:ltr}.chat-day{text-align:center;color:var(--muted);font-size:10px;align-self:center;background:var(--panel);padding:5px 13px;border-radius:8px;margin:2px 0 8px}.chat-message{direction:rtl;align-self:flex-start;max-width:min(85%,620px);min-width:155px}.chat-message--own{align-self:flex-end}.chat-message__bubble{padding:13px 16px 9px;border:1px solid var(--hair);border-radius:15px 15px 15px 4px;background:var(--panel)}.chat-message--own .chat-message__bubble{background:var(--g-100);border-radius:15px 15px 4px 15px}.chat-message__author{display:block;font-size:10px;font-weight:600;color:var(--muted);margin-bottom:6px}.chat-message__bubble>p{font-size:13px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere;user-select:text}.chat-message__meta{display:flex;align-items:center;gap:8px;font-size:9px;color:var(--muted);margin-top:8px;justify-content:flex-end}.chat-reply{display:flex;flex-direction:column;border-inline-start:3px solid var(--g-600,#4d8061);padding:6px 10px;margin:5px 0 9px;background:var(--card);border-radius:6px;font-size:11px;max-width:100%}.chat-reply b{font-size:10px}.chat-reply span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-top:3px;color:var(--muted)}.chat-reactions{display:flex;gap:4px;margin-top:5px}.chat-reactions button{padding:3px 9px;border:1px solid var(--hair);border-radius:20px;background:var(--panel);font-size:10px;cursor:pointer}.chat-reactions button[aria-pressed=true]{border-color:var(--g-600,#4d8061);background:var(--g-100)}
.chat-composer{padding:15px 22px;border-top:1px solid var(--hair);background:var(--card)}.chat-composer textarea{width:100%;resize:none;min-height:56px;max-height:150px;background:var(--panel);border:1px solid var(--hair);border-radius:12px;padding:12px 14px;color:var(--ink);font-size:12px;line-height:1.7}.chat-composer textarea:focus{outline:2px solid var(--g-600,#4d8061);outline-offset:2px}.chat-composer__foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}.chat-composer__foot>span{font-size:9px;color:var(--muted)}.chat-composer__foot .btn{min-height:36px;padding:7px 16px;font-size:11px}.chat-compose-context{display:flex;align-items:center;gap:10px;padding:7px 10px;margin-bottom:9px;border-radius:9px;background:var(--g-100);font-size:11px}.chat-compose-context[hidden]{display:none}.chat-compose-context>span{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.chat-compose-context .icon-btn{width:25px;height:25px}.chat-status{margin:10px 2px;min-height:22px;font-size:11px;color:var(--muted)}.chat-status.is-error{color:var(--rose,#a03345)}.chat-list-empty{padding:22px;text-align:center;font-size:12px;line-height:1.9;color:var(--muted)}.chat-older{display:block;margin:0 auto 16px;font-size:11px}.chat-older[hidden]{display:none}.chat-peer-list{border:0;max-height:320px;overflow:auto;margin:0;padding:0}.chat-peer-list legend{font-size:12px;margin-bottom:10px}.chat-peer{display:flex;align-items:center;gap:12px;border:1px solid var(--hair);border-radius:12px;padding:10px;margin-bottom:8px;cursor:pointer}.chat-peer b{display:block;font-size:12px}.chat-peer small{display:block;color:var(--muted);font-size:10px;margin-top:3px;direction:ltr}.chat-peer input{width:16px;flex:none}.chat-peer .chat-avatar{width:34px;height:34px;font-size:11px}.chat-view button:focus-visible,.chat-view input:focus-visible{outline:2px solid var(--g-600,#4d8061);outline-offset:2px}
[data-chat-group-title][hidden]{display:none}
@media(max-width:1200px){.chat-workspace{grid-template-columns:260px minmax(0,1fr)}.chat-key-hint{display:none}}
@media(max-width:720px){.chat-view .board__head{gap:16px;align-items:flex-start}.chat-view .board__title{font-size:23px}.chat-view .board__actions .btn{font-size:11px;padding:9px 12px}.chat-workspace{grid-template-columns:minmax(0,1fr);height:calc(100dvh - 230px);min-height:470px;border-radius:16px}.chat-sidebar{border:0}.chat-thread{display:none}.chat-show-thread .chat-sidebar{display:none}.chat-show-thread .chat-thread{display:block}.chat-thread__head{padding:14px 12px;gap:8px}.chat-thread__head .chat-mobile-back{display:grid}.chat-thread__identity h2{font-size:13px}.chat-thread__identity p{font-size:10px}.chat-message-search{padding:7px 14px}.chat-message-scroll{padding:16px 12px}.chat-message{max-width:92%}.chat-composer{padding:12px}.chat-message__bubble>p{font-size:12px}.chat-empty h2{font-size:17px}.chat-sidebar__head{padding-top:18px}}
.assistant-folders{display:flex;flex-direction:column;gap:4px;max-height:180px;overflow:auto;padding:0 8px 12px}.assistant-folder{display:flex;align-items:center;gap:4px;border-radius:10px}.assistant-folder>button:first-child,.assistant-folder[data-assistant-folder-id]{flex:1;min-width:0;text-align:start;border:0;background:transparent;font:inherit;font-size:12px;padding:8px 10px;border-radius:10px;cursor:pointer;color:var(--ink)}.assistant-folder.is-active,.assistant-folder.is-active>button:first-child{background:var(--g-100)}.assistant-folder>[data-assistant-folder-delete]{border:0;background:transparent;color:var(--muted);cursor:pointer;width:28px}
.admin-site-form{display:grid;gap:12px;max-width:640px}.admin-site-form .btn{justify-self:start}
/* Compact messenger with an explicit group action and a card-based start. */
.chat-view .board__head{margin-bottom:18px}.chat-view .board__title{font-size:25px}.chat-view .board__sub{font-size:12px}.chat-view .board__actions .btn{font-size:11px;padding:10px 16px}.chat-workspace{grid-template-columns:250px minmax(0,1fr);height:calc(100dvh - 181px);min-height:500px;border-radius:22px;border-color:#e2e9e3}.chat-sidebar{background:#f7faf7;padding:20px 14px 14px}.chat-sidebar__head{padding:0 8px 16px}.chat-sidebar__head h2{font-size:14px}.chat-lenses{gap:4px;padding:4px;margin:0 0 12px}.chat-lenses button{font-size:10px;padding:7px 5px}.chat-search{margin:0 2px 15px;padding:9px 10px;border-radius:10px}.chat-search input{font-size:10px}.chat-conversation{padding:12px 9px;gap:10px;border-radius:11px;margin:3px 0}.chat-conversation .chat-avatar{width:33px;height:33px;flex-basis:33px;font-size:11px}.chat-conversation__top b{font-size:12px}.chat-conversation__top time{font-size:8px}.chat-conversation__preview{font-size:10px;margin-top:4px}.chat-sidebar__foot{font-size:9px;line-height:1.9;padding-top:16px}.chat-empty{padding:40px clamp(25px,5vw,70px);display:flex;align-items:center;justify-content:center;flex-direction:column;background:#fff}.chat-intro-logo{border-radius:13px;margin-bottom:22px;box-shadow:0 8px 22px #163f3410}.chat-empty h2{font-size:25px;font-weight:650;margin:0 0 12px;line-height:1.8;color:#36583e}.chat-empty>p{font-size:12px;color:#91a285;line-height:2}.chat-start-actions{display:flex;gap:10px;margin:23px 0 30px}.chat-start-actions .btn{font-size:11px}.chat-peer-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;max-width:560px}.chat-peer-grid>button{display:flex;align-items:center;gap:11px;border:1px solid #e1e9da;border-radius:13px;background:#fcfdfa;padding:15px;text-align:right;color:#789268;font:inherit}.chat-peer-grid>button:hover{border-color:#bed2ae;background:#f4f9ee}.chat-peer-grid .chat-avatar{width:35px;height:35px;flex-basis:35px;font-size:11px}.chat-peer-grid>button>span:nth-child(2){min-width:0;flex:1}.chat-peer-grid b{display:block;font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-peer-grid small{display:block;font-size:9px;color:#9eb18f;margin-top:5px}.chat-peer-grid>button>span:last-child{font-size:15px;opacity:.5}.chat-thread__head{padding:17px 23px}.chat-thread__identity h2{font-size:15px}.chat-thread__identity p{font-size:10px}.chat-message-search{padding:0 23px 14px}.chat-message-search input{font-size:11px;border-radius:9px}.chat-composer{padding:16px 24px 20px;border-top:1px solid #e9efe4;background:#fff}.chat-composer textarea{font-size:13px;line-height:1.9;border:1px solid #dce8d4;border-radius:14px;padding:13px 15px;background:#fcfef9}.chat-composer__foot{margin-top:10px;font-size:9px}.chat-composer__foot .btn{font-size:11px;padding:9px 17px}.chat-message__bubble{border-radius:14px}.chat-message__bubble>p{font-size:13px;line-height:2}.chat-message__author{font-size:10px}.chat-status{font-size:10px}.chat-peer[hidden]{display:none!important}#dlg-chat-new{max-width:580px;border-radius:24px}#dlg-chat-new .dlg__form{max-height:85dvh;overflow:auto;padding:30px}#dlg-chat-new .dlg__title{font-size:22px;margin-bottom:22px}#dlg-chat-new .chat-peer-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;max-height:300px;overflow:auto;padding:12px;border:1px solid #e4ebde;border-radius:13px}#dlg-chat-new .chat-peer{border:1px solid #e1e9d8;border-radius:11px;padding:12px 9px;background:#fff;gap:9px}#dlg-chat-new .chat-peer:has(input:checked){border-color:#9fbc89;background:#f0f6e9}#dlg-chat-new .chat-peer b{font-size:11px}#dlg-chat-new .chat-peer small{font-size:9px}#dlg-chat-new .chat-peer .chat-avatar{width:29px;height:29px;flex-basis:29px;font-size:10px}#dlg-chat-new .chat-peer input{accent-color:#618b4a}
@media(min-width:821px){html[dir=rtl] .chat-workspace{display:grid!important;grid-template-columns:minmax(0,1fr) 320px;direction:ltr}html[dir=rtl] .chat-sidebar,.chat-sidebar{display:flex!important;order:2;direction:rtl}html[dir=rtl] .chat-thread,.chat-thread{display:flex!important;min-width:0;order:1;direction:rtl;flex-direction:column}.chat-mobile-back{display:none}.chat-workspace{display:grid!important}}
@media(max-width:820px){.chat-workspace{grid-template-columns:minmax(0,1fr);height:calc(100dvh - 210px)}.chat-sidebar{display:flex}.chat-thread{display:none}.chat-workspace.chat-show-thread .chat-sidebar{display:none!important}.chat-workspace.chat-show-thread .chat-thread{display:flex!important}.chat-mobile-back{display:grid}.chat-empty{padding:25px 20px}.chat-empty h2{font-size:21px}.chat-peer-grid{grid-template-columns:1fr}.chat-view .board__actions{gap:7px}.chat-view .board__actions .btn{font-size:10px;padding:9px 11px}}
@media(max-width:480px){.chat-view .board__head{align-items:flex-start;gap:13px;flex-wrap:wrap}.chat-view .board__sub{font-size:10px}.chat-workspace{height:calc(100dvh - 300px);min-height:350px}.chat-composer{padding:12px 14px}.chat-thread__head{padding:14px}.chat-message-search{padding-inline:14px}#dlg-chat-new .chat-peer-list{grid-template-columns:1fr}#dlg-chat-new .dlg__form{padding:24px}.chat-message__bubble>p{font-size:12px}}

/* More room for the thread on a laptop; attachment controls stay beside Send. */
.chat-thread{flex-direction:column;align-items:stretch}.chat-thread__body,.chat-empty{width:100%}
.chat-workspace{grid-template-columns:220px minmax(0,1fr)}.chat-view .board__head{margin-bottom:14px}.chat-thread__head{padding:14px 20px}.chat-message-scroll{padding:22px 28px}.chat-message{max-width:min(90%,780px)}.chat-message__bubble>p{font-size:14px;line-height:2}.chat-composer{padding:12px 20px}.chat-composer__foot>span{margin-inline-end:auto}.chat-attach{display:grid;place-items:center;width:38px;height:38px;flex:none;border:1px solid #dcd9ec;border-radius:12px;background:#f8f7fc;color:var(--g-700,#6444ad);cursor:pointer}.chat-attach svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7}.chat-file-drafts{display:flex;flex-wrap:wrap;gap:7px}.chat-file-drafts:empty{display:none}.chat-file-drafts>div{display:flex;align-items:center;gap:10px;max-width:240px;border:1px solid #ddd8ec;background:#f7f5fc;border-radius:9px;padding:7px 10px;font-size:11px}.chat-file-drafts span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-file-drafts button{border:0;background:none;cursor:pointer;font-size:18px;color:#775d9b}.chat-file-list{display:flex;flex-direction:column;gap:8px;margin:10px 0}.chat-file-list a{display:flex;gap:10px;align-items:center;color:#4e3d7e;font-size:12px;text-decoration:none;overflow:hidden;max-width:340px}.chat-file-list img{display:block;max-width:100%;max-height:280px;object-fit:contain;border-radius:12px}.chat-file-list a:has(img){flex-direction:column;align-items:flex-start}.chat-file-list a>span{overflow-wrap:anywhere}.chat-file-list small{display:block;font-size:10px;color:#8c819f;margin-top:5px}.chat-file-drafts>span{font-size:11px;color:#77658c;padding:8px}
@media(max-width:820px){.chat-workspace{grid-template-columns:minmax(0,1fr)}.chat-message-scroll{padding:16px}.chat-message__bubble>p{font-size:13px}}@media(max-width:480px){.chat-message-scroll{padding:13px}.chat-composer{padding:12px}.chat-composer__foot{gap:8px}.chat-file-list a{max-width:260px}.chat-file-list img{max-height:210px}}

/* A single composer surface contains the message and its actions. */
.chat-composer{border-top:0;padding:12px 20px 18px;background:#fff}
.chat-compose-box{position:relative;border:1px solid #ded9e9;border-radius:22px;background:#fcfbfe;padding:12px 13px 10px;box-shadow:0 3px 15px #352c4e04;transition:border-color .15s,box-shadow .15s}
.chat-compose-box:focus-within{border-color:#b79bd8;box-shadow:0 0 0 3px #eee8f98c}
.chat-compose-box textarea{display:block;border:0;border-radius:0;background:transparent;box-shadow:none;padding:5px 7px 10px;min-height:58px;font-size:14px;line-height:1.9;outline:none}
.chat-compose-box textarea:focus{outline:none;box-shadow:none}
.chat-composer-tools,.chat-compose-actions{display:flex;align-items:center;gap:5px}
.chat-composer-tools{justify-content:space-between;margin-top:4px}
.chat-tool{display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:12px;background:transparent;color:#82718e;cursor:pointer;flex:none;transition:background .15s,color .15s}
.chat-tool:hover,.chat-tool[aria-expanded=true]{background:#eee7f6;color:#68419c}
.chat-tool:disabled{opacity:.4;cursor:default}
.chat-tool svg,.chat-send-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.chat-send-icon{display:grid;place-items:center;flex:none;width:46px;height:46px;border:0;border-radius:16px;background:var(--g-700,#68419c);background:linear-gradient(145deg,var(--g-600,#8053b6),var(--g-800,#432769));color:#fff;box-shadow:0 4px 12px #60408d22;cursor:pointer;transition:transform .15s,opacity .15s}
.chat-send-icon:hover{transform:translateY(-1px)}.chat-send-icon:disabled{opacity:.4;cursor:default;transform:none}
.chat-emoji-anchor{position:relative}.chat-emoji-picker{position:absolute;bottom:48px;right:0;z-index:30;display:grid;grid-template-columns:repeat(4,40px);gap:4px;padding:10px;border:1px solid #e5ddef;border-radius:17px;background:#fff;box-shadow:0 9px 35px #34234320}.chat-emoji-picker[hidden]{display:none}.chat-emoji-picker button{display:grid;place-items:center;width:40px;height:39px;border:0;background:transparent;border-radius:9px;font-size:23px;cursor:pointer}.chat-emoji-picker button:hover{background:#f1ebf8}
.chat-compose-box .chat-file-drafts{padding:0 5px}.chat-compose-box .chat-file-drafts:not(:empty){margin:4px 0 10px}
.chat-send-icon:focus-visible,.chat-tool:focus-visible,.chat-emoji-picker button:focus-visible{outline:2px solid #9470c2;outline-offset:3px}
@media(max-width:600px){.chat-composer{padding:10px 10px 12px}.chat-compose-box{padding:10px;border-radius:19px}.chat-compose-box textarea{font-size:13px;padding-inline:5px}.chat-tool{width:40px;height:40px}.chat-send-icon{width:44px;height:44px;border-radius:14px}}

/* A sender keeps the same initials and color throughout the messenger. */
.chat-avatar--person{border:0;border-radius:50%;background:var(--chat-avatar-bg,#e6edf8);color:var(--chat-avatar-ink,#36557e);font-family:inherit;line-height:1}
.chat-avatar--tone-0{--chat-avatar-bg:#e6edf8;--chat-avatar-ink:#36557e}.chat-avatar--tone-1{--chat-avatar-bg:#eee5f6;--chat-avatar-ink:#70468b}.chat-avatar--tone-2{--chat-avatar-bg:#e0efe7;--chat-avatar-ink:#31634d}.chat-avatar--tone-3{--chat-avatar-bg:#fae7df;--chat-avatar-ink:#8d4e35}.chat-avatar--tone-4{--chat-avatar-bg:#f7e2eb;--chat-avatar-ink:#8b3c5e}.chat-avatar--tone-5{--chat-avatar-bg:#deeff2;--chat-avatar-ink:#2d656d}
button.chat-avatar{cursor:pointer}button.chat-avatar:hover{box-shadow:0 0 0 3px var(--hair)}.chat-avatar--group svg{width:21px;height:21px}
.chat-message{display:flex;flex-direction:row-reverse;align-items:flex-end;gap:9px}.chat-message--own{flex-direction:row}.chat-message__content{flex:1;min-width:0}.chat-message__avatar{width:38px;height:38px;font-size:12px;margin-bottom:2px}
.chat-message__author{border:0;padding:0;background:none;text-align:start;font-family:inherit;line-height:1.7;cursor:pointer;max-width:100%;overflow-wrap:anywhere}.chat-message__author:hover{text-decoration:underline;color:var(--ink)}.chat-message .chat-file-list a{max-width:100%}
#dlg-chat-profile{width:min(420px,calc(100vw - 32px));max-height:85dvh;overflow:auto}#dlg-chat-profile .dlg__form{padding:26px}.chat-profile__identity{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;margin:22px 0}.chat-profile__identity .chat-avatar{width:76px;height:76px;font-size:25px}.chat-profile__identity h3{font-size:18px;line-height:1.8;overflow-wrap:anywhere;max-width:100%}.chat-profile__self{font-size:11px;color:var(--muted)}.chat-profile dl{margin:0 0 22px;display:grid;gap:14px}.chat-profile dl>div{border-top:1px solid var(--hair);padding-top:12px}.chat-profile dt{font-size:11px;color:var(--muted);margin-bottom:6px}.chat-profile dd{margin:0;font-size:13px;line-height:1.8;overflow-wrap:anywhere}#dlg-chat-profile button:focus-visible{outline:2px solid var(--g-600,#4d8061);outline-offset:3px}
@media(max-width:480px){.chat-message{max-width:100%;gap:7px}.chat-message__avatar{width:34px;height:34px;font-size:11px}.chat-message__bubble{padding:11px 12px 8px}}

/* The log fixes physical message sides; each bubble keeps its own text direction. */
.chat-day,.chat-list-empty{direction:rtl}
.chat-audio{display:flex;flex-direction:column;gap:8px;min-width:0;max-width:100%;padding:3px 0}
.chat-audio>span{font-size:11px;color:var(--muted)}
.chat-audio audio,.chat-voice audio{display:block;width:280px;max-width:100%;height:42px;direction:ltr}
.chat-file-list .chat-audio>a{font-size:10px;color:var(--muted)}
.chat-file-drafts>.chat-file-draft--audio{max-width:100%;align-items:flex-start}
.chat-voice{display:flex;align-items:center;gap:10px;margin:6px 5px 8px;padding:10px 12px;border:1px solid #e6dbf3;border-radius:16px;background:linear-gradient(135deg,#faf7fe,#f2ebfb);box-shadow:0 2px 10px #6f528514;font-size:11px}
.chat-voice[hidden]{display:none}
.chat-voice__badge{flex:none;display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#fff;color:#7a5aa8;box-shadow:inset 0 0 0 1px #e6dbf3}
.chat-voice__badge svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.chat-voice__badge--recording{color:#cf425a;box-shadow:inset 0 0 0 1px #f2c9d4}
.chat-voice__bars{display:flex;align-items:center;gap:3px;height:16px}
.chat-voice__bars i{width:3px;height:5px;border-radius:2px;background:currentColor;animation:chatVoiceBar .9s ease-in-out infinite}
.chat-voice__bars i:nth-child(2){animation-delay:.15s}
.chat-voice__bars i:nth-child(3){animation-delay:.3s}
.chat-voice__bars i:nth-child(4){animation-delay:.45s}
@keyframes chatVoiceBar{0%,100%{height:5px}50%{height:15px}}
.chat-voice__spinner{width:15px;height:15px;border-radius:50%;border:2px solid #dcccec;border-top-color:#7a5aa8;animation:chatVoiceSpin .8s linear infinite}
@keyframes chatVoiceSpin{to{transform:rotate(360deg)}}
.chat-voice__preview,.chat-voice__info{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}
.chat-voice__title{font-size:12px;font-weight:700;color:#4a3560}
.chat-voice__info time{align-self:flex-start;font-variant-numeric:tabular-nums;font-size:11px;font-weight:700;color:#9b3147;background:#fff;padding:2px 10px;border-radius:999px;box-shadow:inset 0 0 0 1px #eedce4}
.chat-voice__stop{display:inline-flex;align-items:center;gap:7px;margin-inline-start:auto;border:0;border-radius:999px;padding:8px 14px;background:#cf425a;color:#fff;font:inherit;font-size:11px;font-weight:700;cursor:pointer;box-shadow:0 3px 10px #cf425a33;transition:background .15s,transform .15s}
.chat-voice__stop:hover{background:#b5364e;transform:translateY(-1px)}
.chat-voice__stop-square{width:9px;height:9px;border-radius:2px;background:#fff}
.chat-voice__remove{flex:none;display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:50%;background:#ffffffd9;color:#8a729e;cursor:pointer;box-shadow:inset 0 0 0 1px #e6dbf3;transition:color .15s,background .15s}
.chat-voice__remove:hover{color:#cf425a;background:#fdecef;box-shadow:inset 0 0 0 1px #eabfcc}
.chat-voice__remove svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
.chat-voice--ready{display:grid;grid-template-columns:minmax(0,1fr) 36px;align-items:center;gap:6px;margin:0;padding:4px 6px;border:0;border-radius:22px;background:#edf5fc;box-shadow:none;direction:ltr}
.chat-voice--ready .chat-voice__preview{display:block;min-width:0}
.chat-voice--ready .chat-audio-player{width:100%}
.chat-voice--ready .chat-voice__remove{background:#fff;color:#7a93a8}
.chat-composer:has(.chat-voice:not([hidden])) .chat-emoji-anchor,
.chat-composer:has(.chat-voice:not([hidden])) .chat-compose-actions,
.chat-composer:has(.chat-voice:not([hidden])) textarea{display:none}
.chat-composer.is-voice-live .chat-send-icon{display:none}
.chat-composer.is-voice-ready .chat-compose-box{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:6px}
.chat-composer.is-voice-ready .chat-voice{grid-column:1}
.chat-composer.is-voice-ready .chat-compose-line{grid-column:2;margin:0;justify-content:center}
.chat-composer.is-voice-ready .chat-compose-context,
.chat-composer.is-voice-ready .chat-file-drafts{grid-column:1/-1}
.chat-tool.is-recording{color:#ba3650;background:#fbeaf0}
.chat-voice__stop:focus-visible,.chat-voice__remove:focus-visible,.chat-audio a:focus-visible{outline:2px solid #9470c2;outline-offset:3px}
@media(max-width:480px){.chat-audio audio{width:230px}.chat-voice{margin-inline:0;padding:9px 10px;gap:8px}.chat-voice__stop{padding:8px 11px;font-size:10px}}

/* Compact message bubbles and a single-line composer. */
.chat-view .chat-message-scroll{background:#edf3f9;padding:22px 24px}
.chat-view .chat-messages{gap:9px}
.chat-view .chat-message{position:relative;min-width:0;max-width:min(82%,600px);gap:7px}
.chat-view .chat-message__avatar{width:29px;height:29px;font-size:10px}
.chat-view .chat-message__bubble{padding:9px 13px 6px;border:0;border-radius:17px 17px 17px 5px;background:#fff;box-shadow:none;touch-action:pan-y;overflow-wrap:anywhere;-webkit-touch-callout:none;transition:filter .15s}
.chat-view .chat-message--own .chat-message__bubble{background:#1768b9;color:#fff;border-radius:17px 17px 5px 17px}
.chat-view .chat-message__author{font-size:10px;color:#567f9e;margin-bottom:3px}
.chat-view .chat-message--own .chat-message__author{display:none}
.chat-view .chat-message__bubble>p{font-size:13px;line-height:1.85}
.chat-message__bubble>p:empty{display:none}
.chat-view .chat-message__meta{gap:5px;margin-top:3px;font-size:9px;color:#8b9dac}
.chat-view .chat-message--own .chat-message__meta{color:#d2e7fb}
.chat-message__sent{display:inline-flex;align-items:center}
.chat-message__sent svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.chat-view .chat-reactions{margin-top:5px;gap:4px;flex-wrap:wrap}
.chat-view .chat-reactions button{border:0;background:#edf4fb;color:#225b91;padding:3px 7px;font-size:11px}
.chat-view .chat-reactions button[aria-pressed=true]{background:#d8eafb;box-shadow:inset 0 0 0 1px #9bc6eb}
.chat-view .chat-message--own .chat-reactions button{background:#ffffff1f;color:#fff}
.chat-view .chat-message--own .chat-reactions button[aria-pressed=true]{background:#ffffff36;box-shadow:inset 0 0 0 1px #ffffff80}
.chat-view .chat-reply{background:#eef5fc;border-color:#5f9acc;margin:2px 0 7px}
.chat-view .chat-message--own .chat-reply{background:#ffffff14;border-color:#a7d4ff}
.chat-view .chat-message--own .chat-reply span,.chat-view .chat-message--own .chat-audio>span,.chat-view .chat-message--own .chat-file-list a,.chat-view .chat-message--own .chat-file-list small{color:#e0efff}
.chat-view .chat-day{background:#dce8f1;color:#7b91a3;padding:4px 11px;border-radius:14px;font-size:9px;margin:0 0 8px}
.chat-view .chat-audio{gap:5px;padding:2px 0}
.chat-view .chat-audio audio{height:36px;width:260px}
.chat-message:focus-visible{outline:2px solid #6babe2;outline-offset:4px;border-radius:18px}
.chat-message.is-menu-open .chat-message__bubble{filter:brightness(.96)}
.chat-message.is-swiping::before{content:'↩';position:absolute;top:50%;left:36px;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#cadfee;color:#4f789e;font-size:20px;transform:translateY(-50%);opacity:.55}
.chat-message--own.is-swiping::before{left:auto;right:36px}
.chat-message.is-swipe-ready::before{opacity:1;background:#b4d4ed;color:#236da8}
.chat-view .chat-composer{padding:10px 16px 14px;background:#edf3f9;border:0}
.chat-view .chat-compose-box,.chat-view .chat-compose-box:focus-within{border:0;box-shadow:none;background:#fff;border-radius:21px;padding:5px 7px}
.chat-compose-line{display:flex;align-items:flex-end;gap:2px;min-width:0}
.chat-view .chat-compose-line textarea{flex:1;min-width:0;width:0;min-height:38px;max-height:128px;margin:0;padding:7px 4px;line-height:1.8;font-size:13px;border:0;background:transparent}
.chat-view .chat-compose-actions{gap:0;align-self:flex-end}
.chat-view .chat-tool{width:34px;height:38px;border-radius:50%;color:#7d95aa}
.chat-view .chat-tool:hover,.chat-view .chat-tool[aria-expanded=true]{background:#edf4fb;color:#1768b9}
.chat-view .chat-send-icon{width:40px;height:40px;border-radius:50%;background:#1768b9;box-shadow:none;margin-inline-start:4px}
.chat-view .chat-send-icon:hover{background:#105ba4;transform:none}
.chat-view .chat-send-icon:disabled{background:#93b2d1}
.chat-view .chat-compose-context{margin:2px 5px 5px;padding:7px 9px;background:#edf5fc;border-radius:11px;color:#477ca7}
.chat-view .chat-voice{background:linear-gradient(135deg,#f4f9fe,#e8f2fc);border-color:#d4e5f5;margin:5px;box-shadow:0 2px 10px #1768b912}
.chat-view .chat-voice__badge{color:#1768b9;box-shadow:inset 0 0 0 1px #d4e5f5}
.chat-view .chat-voice__badge--recording{color:#d64560;box-shadow:inset 0 0 0 1px #f3cbd4}
.chat-view .chat-voice__spinner{border-color:#d4e5f5;border-top-color:#1768b9}
.chat-view .chat-voice__title{color:#1d4568}
.chat-view .chat-voice--ready{background:#edf5fc;border:0;box-shadow:none;margin:2px 0 4px}
.chat-view .chat-voice__info time{color:#b03a50;box-shadow:inset 0 0 0 1px #dcebf7}
.chat-view .chat-voice__remove{color:#6b93b3;box-shadow:inset 0 0 0 1px #d4e5f5}
.chat-view .chat-voice__remove:hover{color:#d64560;box-shadow:inset 0 0 0 1px #f3cbd4}
.chat-view .chat-emoji-picker{border:0;background:#fff;box-shadow:0 5px 30px #24405f26}
.chat-view .chat-emoji-picker button:hover{background:#edf4fb}
.chat-view .chat-file-drafts{padding:0 5px}
.chat-view .chat-file-drafts>div{border:0;background:#edf5fc;color:#477ca7}
.chat-view .chat-tool:focus-visible,.chat-view .chat-send-icon:focus-visible{outline-color:#639ed5}
.chat-message-menu{position:fixed;z-index:1000;width:276px;max-width:calc(100vw - 20px);padding:6px;border:0;border-radius:18px;background:#fff;box-shadow:0 10px 48px #142f5433,0 2px 8px #142f5412;color:#25415b;direction:rtl;font-family:var(--font,inherit)}
.chat-message-menu[hidden]{display:none}
.chat-message-menu__reactions{display:flex;justify-content:space-between;gap:2px;padding:3px 2px 8px}
.chat-message-menu__reactions button{display:grid;place-items:center;width:40px;height:40px;flex:0 1 40px;border:0;border-radius:50%;background:transparent;font-size:24px;cursor:pointer}
.chat-message-menu__reactions button:hover,.chat-message-menu__reactions button[aria-checked=true]{background:#e5f0fb;transform:translateY(-2px)}
.chat-message-menu__actions{display:flex;flex-direction:column;gap:2px;border-top:1px solid #edf1f5;padding-top:4px}
.chat-message-menu__actions button{display:flex;align-items:center;gap:13px;width:100%;padding:10px 12px;border:0;border-radius:10px;background:transparent;color:inherit;text-align:start;font:inherit;font-size:12px;cursor:pointer}
.chat-message-menu__actions button:hover{background:#edf4fb}
.chat-message-menu__actions .is-danger{color:#c14453}
.chat-message-menu__actions svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.chat-message-menu button:focus-visible{outline:2px solid #72a8d7;outline-offset:-2px}
.chat-message-menu.is-reactions-only{border-radius:30px;padding:5px 6px}
.chat-message-menu.is-reactions-only .chat-message-menu__reactions{padding:0}
.chat-forward-preview{max-height:100px;overflow:auto;border-inline-start:3px solid #75a8d2;padding:8px 12px;background:#edf5fc;color:#4d6d87;white-space:pre-wrap;font-size:12px;border-radius:8px;margin:12px 0}
.chat-forward-targets{display:grid;gap:6px;max-height:280px;overflow:auto;border:0;padding:0;margin:10px 0}
.chat-forward-target{display:flex;align-items:center;gap:12px;padding:11px;border-radius:10px;cursor:pointer}
.chat-forward-target[hidden]{display:none}
.chat-forward-target:has(input:checked),.chat-forward-target:hover{background:#edf5fc}
.chat-forward-target input{width:16px;accent-color:#1768b9}
.chat-forward-target b{display:block;font-size:12px}
.chat-forward-target small{display:block;font-size:10px;color:#8a9eae;margin-top:4px}
@media(max-width:600px){.chat-view .chat-message-scroll{padding:15px 12px}.chat-view .chat-message{max-width:86%;gap:6px}.chat-view .chat-message__avatar{width:27px;height:27px;font-size:9px}.chat-view .chat-message__bubble{padding:8px 11px 5px}.chat-view .chat-composer{padding:8px 10px 12px}.chat-view .chat-audio audio{width:230px}.chat-view .chat-compose-line textarea{font-size:12px}.chat-view .chat-workspace{min-height:420px}}
@media(prefers-reduced-motion:reduce){.chat-view .chat-message__bubble,.chat-message-menu__reactions button{transition:none}}

/* Let the transcript shrink inside the app grid so the composer stays visible. */
.shell:has(.chat-view:not([hidden])) #main{min-height:0;overflow:hidden}
.chat-view:not([hidden]){display:flex;flex-direction:column;height:100%;min-height:0}
.chat-view .board__head{flex:none}
.chat-view .chat-workspace{flex:1;height:auto;min-height:0}
.chat-view .chat-status{flex:none;margin:6px 0 0;min-height:16px}
@media(hover:none){.chat-view .chat-message__bubble>p,.chat-view .chat-message__bubble blockquote{user-select:none;-webkit-user-select:none}}

/* Voice notes show the actual sound envelope and a compact round play control. */
.chat-audio-player{--voice-idle:#b8d8f2;--voice-played:#318bd2;--voice-button:#318bd2;--voice-button-ink:#fff;--voice-text:#5689b0;display:grid;grid-template-columns:44px minmax(0,1fr);column-gap:10px;row-gap:2px;align-items:center;width:288px;max-width:100%;min-width:0;direction:ltr;padding:4px 0}
.chat-audio-player audio{display:none!important}
.chat-audio-play{grid-column:1;grid-row:1/3;display:grid;place-items:center;width:44px;height:44px;flex:none;border:0;border-radius:50%;background:var(--voice-button);color:var(--voice-button-ink);cursor:pointer;padding:0;transition:filter .15s}
.chat-audio-play:hover{filter:brightness(.96)}
.chat-audio-play svg{display:block;width:23px;height:23px;fill:currentColor;stroke:none}
.chat-audio-play .chat-audio-icon-pause,.chat-audio-player.is-playing .chat-audio-icon-play{display:none}
.chat-audio-player.is-playing .chat-audio-icon-pause{display:block}
.chat-audio-icon-play{margin-left:3px}
.chat-audio-track{grid-column:2;grid-row:1;position:relative;height:32px;min-width:0;align-self:end}
.chat-audio-waveform{display:flex;align-items:center;justify-content:space-between;gap:2px;width:100%;height:100%;overflow:hidden;pointer-events:none}
.chat-audio-waveform i{display:block;flex:1 1 0;min-width:1px;max-width:4px;height:var(--voice-bar-height,4px);border-radius:4px;background:var(--voice-idle);transition:background-color .12s}
.chat-audio-waveform i.is-played{background:var(--voice-played)}
.chat-audio-seek{position:absolute;inset:0;width:100%;height:100%;min-height:0!important;margin:0!important;padding:0!important;opacity:0;cursor:pointer;touch-action:pan-y;direction:ltr}
.chat-audio-track:focus-within{outline:2px solid var(--voice-played);outline-offset:3px;border-radius:4px}
.chat-audio-meta{grid-column:2;grid-row:2;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:10px;line-height:1.5;color:var(--voice-text);font-variant-numeric:tabular-nums;min-width:0}
.chat-audio-meta time{direction:ltr;white-space:nowrap}
.chat-audio-speed{border:0;border-radius:8px;background:transparent;color:inherit;padding:0 3px;font:inherit;font-size:10px;font-weight:600;cursor:pointer;min-width:26px;line-height:1.5}
.chat-audio-speed:hover{background:#318bd212}
.chat-audio-error{grid-column:1/-1;direction:rtl;font-size:10px;line-height:1.7;color:#b84352}
.chat-audio-error[hidden]{display:none}
.chat-audio-play:focus-visible,.chat-audio-speed:focus-visible{outline:2px solid var(--voice-played);outline-offset:3px}
.chat-view .chat-message--own .chat-audio-player{--voice-idle:#79b3e3;--voice-played:#fff;--voice-button:#fff;--voice-button-ink:#1768b9;--voice-text:#d7ecff}
.chat-view .chat-message--own .chat-audio-error{color:#fff0da}
.chat-view .chat-message--own .chat-audio-speed:hover{background:#ffffff1f}
.chat-voice__preview .chat-audio-player{width:100%}
.chat-avatar--saved{background:#318bd2!important;color:#fff!important}
.chat-avatar--saved svg,.chat-saved-trigger svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
.chat-saved-trigger{margin-inline-start:auto;width:30px;height:30px;color:#6b93b3}
.chat-sidebar__head [data-chat-count]{margin-inline-start:7px}
@media(max-width:600px){.chat-audio-player{grid-template-columns:38px minmax(0,1fr);column-gap:8px;width:262px}.chat-audio-play{width:38px;height:38px}.chat-audio-waveform{gap:1.5px}.chat-audio-track{height:29px}}
@media(prefers-reduced-motion:reduce){.chat-audio-play,.chat-audio-waveform i{transition:none}.chat-voice__bars i,.chat-voice__spinner{animation:none}.chat-voice__stop{transition:none}}

/* One shared attachment control with a compact picker menu. */
.chat-attach-anchor{position:relative;align-self:flex-end}
.chat-attach-menu{position:absolute;bottom:48px;inset-inline-end:0;z-index:30;display:grid;gap:2px;min-width:180px;padding:8px;border:1px solid #e5ddef;border-radius:15px;background:#fff;box-shadow:0 9px 35px #34234320}
.chat-attach-menu[hidden]{display:none}
.chat-attach-menu button{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;border-radius:10px;padding:10px 12px;font:inherit;font-size:12px;color:#4a3d5c;cursor:pointer;text-align:start}
.chat-attach-menu button:hover{background:#f1ebf8}
.chat-attach-menu button:focus-visible{outline:2px solid #9470c2;outline-offset:-2px}
.chat-attach-menu svg{width:20px;height:20px;flex:none;fill:none;stroke:#68419c;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
/* The file input stays in the layout (opacity) so iOS Safari can open the
   gallery/camera picker from it; display:none inputs never open there. */
.chat-file-input{position:fixed;bottom:0;inset-inline-start:0;width:2px;height:2px;opacity:.01;pointer-events:none;border:0;padding:0;margin:0}

/* Mobile bottom tab bar — equal five tabs, AI marked inside the bar (no overflow). */
.tabbar{display:none}
@media (max-width:820px){
 .tabbar{position:fixed;bottom:0;inset-inline:0;z-index:45;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));height:calc(56px + env(safe-area-inset-bottom,0px));padding:4px 2px calc(6px + env(safe-area-inset-bottom,0px));background:var(--panel);border-top:1px solid var(--hair);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
 .app{padding-bottom:calc(60px + env(safe-area-inset-bottom,0px))}
 .app:has(.chat-view:not([hidden]) .chat-workspace.chat-show-thread){padding-bottom:10px}
 .app:has(.chat-view:not([hidden]) .chat-workspace.chat-show-thread) .tabbar{display:none}
 .tabbar__item{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:0;border-radius:12px;background:transparent;color:var(--muted);font:inherit;font-size:10px;font-weight:600;line-height:1.2;text-decoration:none;cursor:pointer;min-width:0;min-height:44px;padding:2px 0}
 .tabbar__item>span:not(.tabbar__ai):not(.tabbar__badge){max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .tabbar__item svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
 .tabbar__item.is-active{color:var(--g-700,#1768b9);background:transparent}
 .tabbar__item:focus-visible{outline:2px solid var(--g-600,#639ed5);outline-offset:-2px}
 .tabbar__item--ai{color:var(--muted)}
 .tabbar__ai{display:grid;place-items:center;width:34px;height:34px;margin:0;border-radius:50%;background:var(--g-700,#12857d);color:#fff;box-shadow:0 4px 10px #12857d33}
 .tabbar__item--ai svg{width:18px;height:18px;stroke-width:1.6}
 .tabbar__item--ai.is-active{color:var(--g-700,#12857d)}
 .tabbar__item--ai.is-active .tabbar__ai{box-shadow:0 0 0 3px var(--panel),0 0 0 5px var(--g-600,#1aa89a)}
 .tabbar__badge{position:absolute;top:2px;inset-inline-end:calc(50% - 18px);min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:#c14453;color:#fff;font-size:9px;display:grid;place-items:center}
 .tabbar__badge[hidden]{display:none}
 .board{overflow:auto;-webkit-overflow-scrolling:touch}
 .app{height:var(--sf-vh,auto)}
}
@media (prefers-reduced-motion:reduce){.tabbar{backdrop-filter:none;-webkit-backdrop-filter:none}}
