.login-shell{width:100%;display:grid;place-items:center;padding:24px}.login-shell .card{max-width:420px;width:100%}.login-shell img{width:150px}.login-shell button{margin-top:20px}.login-shell p{line-height:1.6}.project-preview{display:block;font-size:11px;margin-top:3px}.attachment{display:block;color:#8dceff;text-decoration:none;overflow-wrap:anywhere;padding:8px 0}.attachment small{white-space:nowrap}.reaction.mine{background:#487aa4;color:white}.readonly{margin:0;border-radius:0;text-align:center}.draft-files{display:flex;gap:8px;flex-wrap:wrap;font-size:12px}.draft-files span{padding:6px;background:#233548;border-radius:8px}.important-toggle{display:flex;gap:7px;align-items:center;font-size:11px;margin:8px 0 0}.important-toggle input{display:inline-block;width:auto;min-height:0;margin:0}.font-settings>.card{margin-bottom:16px}.session{padding:14px 0;border-bottom:1px solid #34475a;font-size:13px}.pending{opacity:.8}.pending .msgmeta{flex-wrap:wrap;color:#ffdb9c}.main{min-height:0}.messages{overflow-anchor:none}.older{align-self:center;flex-shrink:0}.inputbar .iconbutton{padding:6px}.messages>.empty{margin:auto}.contentview .card{overflow-wrap:anywhere}@media(max-width:700px){.login-shell{padding:15px}.important-toggle{font-size:10px}.composerwrap{padding-top:8px}.inputbar{gap:1px}.inputbar .iconbutton{padding:5px}}
.task-attachment{padding:8px 0;border-bottom:1px solid #34475a}.task-file-toggle{display:flex;align-items:center;gap:8px}.task-file-toggle input{width:auto;min-height:0;margin:0}.task-attachment:has(input:checked)>.attachment{opacity:.5;text-decoration:line-through}

.attachment-photo{display:block;max-width:100%;max-height:250px;border-radius:9px;object-fit:contain;margin-bottom:6px}.attachment{overflow-wrap:anywhere}

/* Anchored compact picker; the grid scrolls as the emoji catalog grows. */
.emoji-panel{position:fixed;visibility:hidden;z-index:40;width:264px;max-width:calc(100vw - 16px);display:flex;flex-direction:column;overflow:hidden;background:#17212b;border:1px solid #34475a;border-radius:12px;padding:8px;box-shadow:0 8px 28px #0007}
.emoji-heading{display:flex;align-items:center;justify-content:space-between;padding:0 3px 6px;color:#9bb0c1;font-size:12px;flex-shrink:0}
.emoji-heading button{display:grid;place-items:center;width:28px;height:28px;font-size:20px;border-radius:7px}
.emoji-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;max-height:210px;overflow-y:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin}
.emoji-grid button{display:grid;place-items:center;padding:0;min-width:0;height:34px;font-size:23px;border-radius:7px;line-height:1}
.emoji-panel button:hover,.emoji-panel button:focus-visible{background:#2b5278}
.emoji-categories{display:flex;gap:4px;border-bottom:1px solid #293a4a;padding-bottom:6px;flex-shrink:0}.emoji-categories button{flex:1;height:32px;border-radius:7px;color:#91a8bc;font-size:22px}.emoji-categories button[aria-pressed=true]{color:#82c5f2;background:#2b5278}.emoji-category-title{color:#91a8bc;font-size:11px;padding:8px 4px;flex-shrink:0}
.login-shell .login-actions{display:flex;flex-direction:column;gap:10px;margin-top:20px}.login-shell .login-actions button{margin:0;min-height:46px}.login-method{display:flex;align-items:center;justify-content:space-between;color:#94a8ba;font-size:13px;margin:14px 0}.login-shell .login-link{margin:0;color:#79c3f5;padding:8px;font-size:13px}.login-shell #login-error{color:#ffb7c1;margin-top:14px;line-height:1.5;font-size:14px}.login-shell #login-notice{color:#9ecbed;font-size:13px;line-height:1.5;margin-top:12px}.login-shell input[readonly]{color:#9bb0c1}.login-shell .card>button{width:100%;margin-top:12px}.login-shell{overflow:auto;min-height:100dvh}

/* Telegram-like bubbles, with server-confirmed send status only. */
.main{background:#0e171e}.messages{background:#0e171e;background-image:none;padding:24px max(20px,calc((100% - 940px)/2));gap:9px}
.messages .message{--bubble-color:#1f2d3a;background:var(--bubble-color);border-radius:22px;padding:9px 13px;max-width:82%;min-width:70px;line-height:1.4;isolation:isolate}
.messages .message.own{--bubble-color:#3865a1;border-radius:22px}
.messages .message::before{content:'';position:absolute;bottom:0;left:-7px;width:17px;height:19px;background:var(--bubble-color);clip-path:polygon(45% 0,100% 0,100% 100%,0 100%,27% 75%,40% 45%);z-index:-1}
.messages .message.own::before{left:auto;right:-7px;transform:scaleX(-1)}
.message-text{display:flow-root;line-height:1.4!important}.message-stamp{float:right;display:inline-flex;align-items:center;gap:3px;margin:7px 0 -2px 12px;color:#aebfcf;font-size:12px;line-height:1.2;white-space:nowrap}.own .message-stamp{color:#d6e5f8}.sent-check{font-size:17px;line-height:12px}.read-check{font-size:15px;font-weight:700;letter-spacing:-3px;padding-right:3px;color:#8ed0ff}.messages .sender{margin:0 0 4px;font-size:max(12px,calc(var(--chat-font-size) * .8));color:#83bee8}.message-reactions:empty{display:none}
.message-actions{position:absolute;right:6px;top:-29px;display:flex;align-items:center;gap:2px;padding:2px;background:#223345;border:1px solid #34475a;border-radius:18px;opacity:0;pointer-events:none;z-index:2;transition:opacity .12s}.message-actions button{display:grid;place-items:center;width:30px;height:26px;border-radius:14px;color:#b9d0e3;font-size:20px}.message-actions svg{width:19px;height:19px}.message-actions button:hover{background:#365573}.message:hover .message-actions,.message:focus-within .message-actions{opacity:1;pointer-events:auto}.messages .message:hover,.messages .message:focus-within{z-index:3}
.composerwrap{background:#0e171e;padding:10px max(16px,calc((100% - 960px)/2)) max(16px,env(safe-area-inset-bottom))}.composer{gap:10px;align-items:flex-end}.inputbar{border:1px solid #2c3844;border-radius:28px;background:#17212b;gap:5px;padding:5px 10px;align-items:flex-end}.inputbar textarea{order:1;padding:9px 3px;background:transparent}.inputbar [data-action=attach]{order:0}.inputbar [data-action=emoji]{order:2}.inputbar .iconbutton{color:#aec2d3;margin-bottom:2px;padding:8px}.inputbar .iconbutton svg{width:25px;height:25px}.send{width:51px;height:51px;background:#17212b;border:1px solid #2c3844;color:#dceaf6}.send:hover{background:#2b5278}.messages .quoteblock{border-radius:8px}.messages .attachment-photo{border-radius:14px}
@media(hover:none){.message-actions{position:static;float:left;opacity:1;pointer-events:auto;background:transparent;border:0;padding:0;margin:3px 0 -4px -4px}.message-actions button{width:30px;height:28px;color:#a8c1d7}}
@media(max-width:700px){.messages{padding:18px 17px;gap:9px}.messages .message{max-width:90%;border-radius:20px;padding:8px 11px}.messages .message.own{border-radius:20px}.composerwrap{padding:9px 8px max(10px,env(safe-area-inset-bottom))}.composer{gap:7px}.inputbar{padding:4px 7px}.send{width:48px;height:48px}.message-stamp{font-size:11px;margin-top:7px}}

.photo-viewer{position:fixed;inset:0;width:100vw;width:100dvw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#080d13f5;color:#edf4fa;overflow:hidden}.photo-viewer[open]{display:flex;flex-direction:column}.photo-viewer::backdrop{background:#080d13}.photo-toolbar{display:flex;align-items:center;gap:20px;padding:12px max(18px,env(safe-area-inset-right)) 12px max(18px,env(safe-area-inset-left));padding-top:max(12px,env(safe-area-inset-top));background:#131d28;flex-shrink:0}.photo-toolbar strong{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500}.photo-toolbar a{color:#83c6f3;text-decoration:none;font-size:14px;padding:10px 0}.photo-close{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:#233345;flex-shrink:0}.photo-close:hover{background:#365573}.photo-stage{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:16px 16px max(16px,env(safe-area-inset-bottom));overflow:auto}.photo-stage img{display:block;max-width:100%;max-height:100%;object-fit:contain;min-height:0}.photo-stage [hidden]{display:none!important}.photo-status{color:#b8c9da;text-align:center;max-width:420px;line-height:1.6;padding:20px}.attachment[data-photo]{cursor:zoom-in}@media(max-width:700px){.photo-toolbar{gap:12px;padding-inline:12px}.photo-stage{padding-inline:0}.photo-toolbar strong{font-size:12px}}
.deleted-message{opacity:.7}.deleted-message p{font-style:italic;color:#b1c2d2;font-size:calc(var(--chat-font-size) * .9)}.message-actions [data-delete-message]{color:#f0a5ad}

/* Keep the mobile layout within its viewport without disabling pinch zoom. */
html,body{max-width:100%;overflow-x:clip;-webkit-text-size-adjust:100%;text-size-adjust:100%}#app{width:100%;min-width:0}.main,.sidebar,.composerwrap,.composer,.inputbar,.messages,.chathead,.pin{min-width:0}.composerwrap,.chathead,.pin{max-width:100%}.messages{overflow-x:hidden}.messages .sender,.draft-files span,.replybar{overflow-wrap:anywhere}.inputbar .iconbutton{flex-shrink:0}.inputbar textarea{flex:1 1 0;width:0;min-width:0}.draft-files{min-width:0}.draft-files span{max-width:100%}.attachment small{white-space:normal}
@media(max-width:700px){#app{max-width:100%;height:100dvh}.mobile-open .main{width:100%;max-width:100%;flex-basis:100%}.sidebar{max-width:100%}.client-top,.searchbox,.tabs{min-width:0}.login-shell input,.searchbox input,.inputbar textarea,.contentview input,.contentview textarea,.contentview select{font-size:max(16px,var(--chat-font-size))}.inputbar textarea{line-height:1.5}.messages .message{min-width:0}.message-actions{max-width:100%}.important-toggle{flex-wrap:wrap}.composerwrap{flex-shrink:0}}

.message-context{position:fixed;inset:auto;margin:0;padding:0;width:286px;max-width:calc(100vw - 20px);border:1px solid #303b46;border-radius:20px;background:#202830;color:#f4f6f9;box-shadow:0 12px 40px #0007;overflow:auto}.message-context::backdrop{background:#0003}.context-reactions,.context-extra{display:flex;align-items:center;justify-content:space-around;gap:1px;padding:9px 5px;background:#252e38}.context-reactions button,.context-extra button{display:grid;place-items:center;width:37px;height:39px;padding:0;font-size:26px;border-radius:50%}.context-reactions button:hover,.context-extra button:hover{background:#3b4754}.context-actions{padding:7px 12px}.context-actions button{display:flex;align-items:center;gap:13px;padding:11px 9px;width:100%;border-radius:9px;font-size:15px;text-align:left}.context-actions button:hover{background:#303b47}.context-actions svg{width:21px;height:21px;flex-shrink:0}.context-actions [data-context=delete]{color:#ff666f;border-top:1px solid #38424d;border-radius:0;margin-top:4px}.message-context [hidden]{display:none!important}.message-context header{display:flex;align-items:center;justify-content:space-between;padding:15px;font-size:16px}.message-context header button{font-size:24px}.forward-search{display:block;width:calc(100% - 24px);margin:0 12px 8px;padding:10px;border:1px solid #3a4757;background:#17212b;border-radius:9px;color:white;font-size:16px}.forward-chats{max-height:320px;overflow:auto;padding:5px 8px}.forward-chats button{display:block;width:100%;padding:12px;text-align:left;border-radius:9px;overflow-wrap:anywhere}.forward-chats button:hover{background:#32455a}.forward-chats small{display:block;color:#9eb2c5;margin-top:5px}.forward-empty{padding:10px;color:#9eb2c5}.forwarded-label{font-size:12px;color:#9cc7ea;border-left:2px solid #8ebde3;padding-left:7px;margin-bottom:6px}.message-context button:disabled{opacity:.5}.messages .message[aria-haspopup]{cursor:pointer;-webkit-touch-callout:none}@media(hover:none){.messages .message-text{-webkit-user-select:none;user-select:none}}
.context-reactions button[aria-pressed=true],.context-extra button[aria-pressed=true]{background:#38618a;box-shadow:inset 0 0 0 1px #81b9e3}

/* Compact composer: keyboard submission, with a full-width input. */
.composer .inputbar{padding:2px 7px;border-radius:23px;gap:4px;align-items:center;min-height:44px}.composer .inputbar textarea{height:38px;min-height:38px;max-height:144px;overflow-y:hidden;padding:7px 4px;line-height:24px}.composer .inputbar .iconbutton{display:grid;place-items:center;width:38px;height:38px;padding:7px;margin:0}.composer .inputbar [data-action=emoji] svg{width:24px;height:24px;stroke-width:1.5}

.install-help{max-width:480px;width:calc(100% - 32px);box-sizing:border-box;max-height:85dvh;overflow:auto;border:1px solid #40566d;border-radius:16px;padding:24px;background:#17212b;color:#fff}.install-help::backdrop{background:#0009}.install-help li{margin:12px 0;line-height:1.5}.install-help h2{margin-top:0}.login-shell [data-action="install-app"]{margin-top:14px}

/* Acknowledgements use the same dark palette as the chat. */
.ack-dialog{box-sizing:border-box;width:min(440px,calc(100vw - 24px));max-height:80dvh;overflow:auto;border:1px solid #2b3b4c;border-radius:14px;padding:16px;background:#17212b;color:#e6edf3;box-shadow:0 20px 70px #0007;font-size:14px;color-scheme:dark}
.ack-dialog::backdrop{background:#060d16a6}
.ack-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.ack-dialog h2{font-size:17px;font-weight:600;margin:0}
.ack-dialog header button{display:grid;place-items:center;width:30px;height:30px;flex-shrink:0;padding:0;border-radius:8px;color:#8da7bc;font-size:24px;line-height:1}
.ack-dialog header button:hover{background:#253647;color:#e6edf3}
.ack-dialog>.helper{margin:5px 0 14px;line-height:1.45}
.ack-dialog h3{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:#83bee8;margin:14px 0 4px}
.ack-dialog h3 span{padding:1px 6px;border-radius:8px;background:#253b50;color:#a9d5f1;font-size:11px}
.ack-dialog ul{list-style:none;padding:0;margin:0}
.ack-dialog li{display:flex;align-items:center;justify-content:space-between;gap:6px 12px;border-bottom:1px solid #263544;padding:8px 0;overflow-wrap:anywhere;line-height:1.4}
.ack-dialog li:last-child{border-bottom:0}.ack-dialog li>span{min-width:0}.ack-dialog li small{color:#8da7bc;font-size:11px;text-align:right;flex-shrink:0;max-width:48%}
.ack-dialog footer{display:flex;justify-content:flex-end;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid #2b3b4c}
.ack-dialog footer button{padding:8px 12px;font-size:12px;white-space:normal;border-radius:8px;min-height:34px}
.ack-dialog footer .primary{background:#5dabe0;color:#102235}.ack-dialog footer button:disabled{background:#253647;color:#6f879b;opacity:1}
.ack-feedback{font-size:12px;line-height:1.45;color:#8da7bc;margin:10px 0 0}.ack-feedback:empty{display:none}.ack-details{margin-left:4px}.read-check{display:inline-flex;align-items:center;border:0;background:transparent;color:#78c6ff;padding:0 1px;margin-left:2px;font:inherit;font-weight:700;letter-spacing:-2px;line-height:1;cursor:pointer}.read-check:hover{color:#b5e2ff;text-decoration:underline}.read-check:focus-visible{outline:2px solid #83bee8;outline-offset:3px;border-radius:3px}
@media(max-width:380px){.ack-dialog{padding:14px}.ack-dialog li{flex-wrap:wrap}.ack-dialog li small{max-width:100%}.ack-dialog footer{gap:6px}}
/* Chat photos use the same compact, dark surfaces as the messenger. */
.chat-avatar{position:relative;overflow:hidden;flex-shrink:0}.chat-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.chat-icon-slot{display:flex;flex:none}.chathead .chat-avatar{width:40px;height:40px;font-size:18px}.chat-icon-edit{position:relative;display:block;border:0;padding:0;background:none;border-radius:50%;cursor:pointer}.chat-icon-pencil{position:absolute;right:-3px;bottom:-2px;width:17px;height:17px;border-radius:50%;background:#3865a1;color:#fff;font-size:12px;line-height:17px}.chat-icon-edit:focus-visible{outline:2px solid #83bee8;outline-offset:4px}.chat-icon-dialog{color:#e3edf5;background:#172634;border:1px solid #34485b;border-radius:20px;padding:20px;width:min(380px,calc(100vw - 28px));max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;box-shadow:0 20px 60px #0008}.chat-icon-dialog::backdrop{background:#050b11ba}.chat-icon-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.chat-icon-dialog h2{font-size:18px;margin:0}.chat-icon-dialog header button{background:none;border:0;color:#aebfcf;font-size:26px;line-height:1;padding:4px 8px}.chat-icon-dialog .helper{font-size:12px;line-height:1.4;color:#9eb6ca;margin:12px 0}.chat-icon-dialog button{font-size:13px}.chat-icon-dialog footer{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.icon-current{display:flex;justify-content:center;padding:8px}.icon-current .chat-avatar{width:100px;height:100px;font-size:36px}.icon-crop canvas{display:block;width:min(100%,264px);height:auto;aspect-ratio:1;margin:0 auto;border-radius:50%;cursor:grab;touch-action:none;background:#0e1923;outline:1px solid #7096b4}.icon-crop canvas:active{cursor:grabbing}.icon-crop canvas:focus-visible{outline:3px solid #83bee8}.icon-zoom{display:flex;align-items:center;gap:10px;font-size:12px;color:#aebfcf}.icon-zoom input{min-width:0;flex:1;accent-color:#6db0e3}.icon-zoom output{width:36px;text-align:right}.icon-options{display:flex;gap:8px;flex-wrap:wrap}.chat-icon-dialog .icon-remove{color:#efafb5}.chat-icon-dialog [hidden]{display:none!important}.chat-icon-dialog button:disabled{opacity:.45;cursor:default}
/* Personal photos share the chat photo editor and palette. */
.user-avatar{position:relative;overflow:hidden;flex-shrink:0}.user-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.profile-card{display:flex;align-items:center;gap:16px}.profile-card h2{margin:0 0 10px;overflow-wrap:anywhere}.profile-card>div{min-width:0}.profile-avatar-button{position:relative;flex-shrink:0;padding:0;border-radius:50%;background:none}.profile-avatar-button .user-avatar{width:72px;height:72px;font-size:28px}.profile-avatar-button:focus-visible{outline:2px solid #83bee8;outline-offset:4px}.icon-current .user-avatar{width:100px;height:100px;font-size:36px}.drawer .drawer-profile{display:flex;align-items:center;gap:12px;padding:14px 0;text-align:left}.drawer-profile .user-avatar{width:44px;height:44px;font-size:20px}.drawer-profile strong{overflow-wrap:anywhere;min-width:0}.messages .sender{display:flex;align-items:center;gap:7px}.messages .sender .user-avatar{width:24px;height:24px;font-size:12px}.messages .sender>span:last-child{min-width:0;overflow-wrap:anywhere}

.quoteblock{display:flex;flex-direction:column;gap:2px;width:100%;padding:5px 8px;border:0;border-left:3px solid #78bce9;border-radius:4px;background:#ffffff0a;text-align:left;cursor:pointer;min-width:0}.quoteblock:hover{background:#ffffff12}.quote-author{font-size:12px;font-weight:600;color:#9bd2f5}.quote-text{font-size:12px;color:#d0dce7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.replybar{display:flex;align-items:center;gap:10px;padding:8px 10px;margin:0 0 8px;border-left:3px solid #78bce9;border-radius:7px;background:#172633;min-width:0}.replybar>div{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.replybar strong{font-size:12px;color:#9bd2f5}.replybar span{font-size:12px;color:#d0dce7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.replybar>button{flex:none}.message.reply-target-highlight{outline:2px solid #65b4e8;box-shadow:0 0 0 5px #65b4e822;transition:outline-color .2s,box-shadow .2s}

/* Telegram-style day separators in the message history. */
.messages .date-separator{display:flex;justify-content:center;align-items:center;align-self:stretch;flex:none;margin:8px 0 3px;pointer-events:none}
.messages .date-separator span{display:inline-block;padding:5px 12px;border:1px solid #34495b;border-radius:14px;background:#263746eF;color:#d5e2ed;font-size:12px;font-weight:500;line-height:1.2;box-shadow:0 1px 3px #0003}
.messages .date-separator:first-child{margin-top:2px}

/* Explicit line-break and send controls for touch keyboards. */
.composer .inputbar .newline{flex:0 0 34px;width:34px;height:38px;padding:0;font-size:25px;line-height:1;display:grid;place-items:center;color:#aec2d3}.composer>.send{flex:0 0 51px;display:grid;place-items:center;border-radius:50%}.composer>.send svg{width:23px;height:23px}
@media(max-width:700px){.composer .inputbar .newline{flex-basis:32px;width:32px;height:38px;font-size:24px}.composer>.send{flex-basis:48px;width:48px;height:48px}}


/* Telegram-like pinned-message strip with a compact next-pin indicator. */
.main>.pin{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:10px 18px;border:0;border-bottom:1px solid #293b4b;border-left:3px solid #66b9ed;border-radius:0;background:#172633;color:#e4edf5;text-align:left;text-decoration:none;font:inherit;cursor:pointer;min-height:52px}
.main>.pin>span:first-child,.main>.pin>div{display:flex;flex-direction:column;gap:3px;min-width:0;overflow-wrap:anywhere;font-size:13px;line-height:1.35}
.main>.pin strong{font-size:12px;font-weight:600;color:#80c8f4}
.main>.pin .pin-next{flex:none;font-size:28px;line-height:1;color:#8daec5}
.main>.pin:hover{background:#1d3040}
.main>.pin:focus-visible{outline:2px solid #83bee8;outline-offset:-3px}

.main>.legacy-pin>button{flex:none;padding:7px 11px;border:1px solid #40566d;border-radius:8px;background:#22384a;color:#dceaf6;font-size:12px}
.main>.legacy-pin>button:hover{background:#2b5278}

.message-editor-dialog{width:min(420px,calc(100vw - 20px));padding:0 0 12px}.message-editor-dialog header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px}.message-editor-dialog header button{font-size:24px;line-height:1}.message-editor{display:block;box-sizing:border-box;width:calc(100% - 24px);min-height:150px;max-height:55dvh;margin:0 12px;padding:11px 12px;border:1px solid #40566d;border-radius:10px;background:#17212b;color:#f4f6f9;font:inherit;font-size:16px;line-height:1.5;resize:vertical;white-space:pre-wrap}.message-editor:focus{outline:2px solid #5b9bd5;outline-offset:1px}.message-editor-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 12px 0}.message-editor-actions button{padding:9px 14px;border-radius:9px}.edited-label{margin-left:5px;color:#9eb2c5;font-size:11px;white-space:nowrap}

/* Search messages in the active chat. */
.message-search-dialog{box-sizing:border-box;width:min(520px,calc(100vw - 24px));max-height:min(78dvh,720px);padding:0;border:1px solid #34485b;border-radius:18px;background:#172634;color:#e5edf5;box-shadow:0 20px 60px #0008;overflow:hidden}
.message-search-dialog::backdrop{background:#050b11b8}
.message-search-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 17px;border-bottom:1px solid #304253}
.message-search-dialog>header button{font-size:25px;line-height:1;padding:3px 8px}
.message-search-form{display:flex;gap:8px;padding:12px}
.message-search-form input{box-sizing:border-box;min-width:0;flex:1;padding:10px 12px;border:1px solid #40566d;border-radius:9px;background:#0f1b25;color:#f4f6f9;font:inherit;font-size:16px}
.message-search-form button{padding:9px 15px;border-radius:9px}
.message-search-status{padding:0 14px;margin:0 0 9px;color:#9eb6ca;font-size:12px}
.message-search-results{max-height:52dvh;overflow:auto;padding:0 10px 10px}
.message-search-result{display:flex;flex-direction:column;align-items:stretch;gap:5px;width:100%;padding:11px 10px;border-top:1px solid #2c3c4b;text-align:left;overflow-wrap:anywhere}
.message-search-result:hover{background:#22384a}
.message-search-meta{color:#8fb6d4;font-size:11px}
.message-search-highlight{padding:0 2px;border-radius:3px;background:#f3d36b;color:#17212b;font-weight:700}
.chathead .head-search{flex:none;margin-left:auto}
@media(max-width:700px){.message-search-dialog{max-height:80dvh}.message-search-results{max-height:58dvh}.chathead .head-search{padding:6px}}

/* Live typing indicator in the message composer. */
.typing-indicator{padding:0 12px 5px;color:#83bee8;font-size:12px;line-height:1.3;min-height:0}.typing-indicator:empty{display:none}

.mention{color:#8dccff;font-weight:600;background:#284a65;border-radius:5px;padding:0 2px}.mention-suggestions{display:flex;flex-direction:column;gap:2px;max-height:220px;overflow:auto;margin:0 56px 8px 48px;padding:5px;background:#202d39;border:1px solid #3a5064;border-radius:12px;box-shadow:0 8px 24px #0005}.mention-suggestions[hidden]{display:none}.mention-suggestions button{display:flex;align-items:center;gap:9px;width:100%;padding:8px 10px;border-radius:8px;text-align:left;color:#e7f1fa}.mention-suggestions button:hover,.mention-suggestions button:focus{background:#344d62;outline:none}.mention-suggestions .avatar{flex-shrink:0}

/* Private favorites area */
.favorites-nav{display:block;width:calc(100% - 20px);margin:8px 10px;padding:10px 12px;text-align:left;border:1px solid #2b3d4e;border-radius:10px;background:#17212b;color:#b9cddd;font-size:13px}
.favorites-nav:hover,.favorites-nav.active{background:#263e54;color:#e7f3fc;border-color:#4a789b}
.favorites-view{display:flex;flex:1;min-height:0;flex-direction:column;background:#0e171e}
.favorites-search{display:flex;flex-direction:column;gap:6px;padding:12px max(16px,calc((100% - 940px)/2));color:#9fb5c8;font-size:12px}
.favorites-search input{box-sizing:border-box;width:100%;min-height:40px;padding:9px 12px;border:1px solid #34475a;border-radius:10px;background:#17212b;color:#eef5fa;font:inherit;font-size:14px}
.favorites-messages{flex:1;min-height:0;overflow-y:auto}
.favorites-items{display:flex;flex-direction:column;gap:12px;max-width:940px;margin:0 auto;width:100%}
.favorites-items>.empty{margin:auto;text-align:center;max-width:420px;line-height:1.6;padding:24px}
.favorite-message{max-width:82%}
.favorites-message .favorite-source,.favorite-source{font-size:11px;color:#b5cee1;margin:0 0 6px;line-height:1.4}
.favorite-message .message-text{white-space:pre-wrap;overflow-wrap:anywhere}
.favorite-message .message-text a{color:#c7e7ff;text-decoration:underline;overflow-wrap:anywhere}
.favorite-footer{display:flex;justify-content:flex-end;align-items:center;gap:12px;color:#c5d8e8;font-size:11px;margin-top:8px}
.favorite-delete{font-size:11px;color:#ffd0d4;padding:4px 7px;border-radius:7px;background:#6b3540}
.favorite-delete:hover{background:#884653}
.favorites-composer-wrap{padding-top:10px}
.favorites-composer-wrap .composer{max-width:960px;margin:0 auto}
.favorites-composer-wrap .inputbar textarea{min-height:42px;max-height:120px}
.favorite-save{flex:0 0 auto;min-height:44px;padding:0 16px;border-radius:22px;background:#3865a1;color:#fff}
@media(max-width:700px){
 .favorites-search{padding:10px 12px}
 .favorites-messages{padding:12px}
 .favorites-items{gap:10px}
 .favorites-composer-wrap{padding:9px 8px max(10px,env(safe-area-inset-bottom))}
 .favorite-message{max-width:94%}
}


/* Per-user light theme. The dark palette remains the default. */
:root[data-theme="light"]{color-scheme:light;background:#f4f6f8;color:#202b36}
:root[data-theme="light"] body,:root[data-theme="light"] #app,:root[data-theme="light"] .main,:root[data-theme="light"] .favorites-view{background-color:#f4f6f8;color:#202b36}
:root[data-theme="light"] .sidebar,:root[data-theme="light"] .chathead,:root[data-theme="light"] .pin,:root[data-theme="light"] .inputbar,:root[data-theme="light"] .card,:root[data-theme="light"] .drawer,:root[data-theme="light"] .chat-section-tabs,:root[data-theme="light"] .chat-section-panel,:root[data-theme="light"] .chat-member,:root[data-theme="light"] .favorites-nav,:root[data-theme="light"] .favorites-search input,:root[data-theme="light"] .favorites-search{background-color:#fff;color:#202b36;border-color:#dce3e9}
:root[data-theme="light"] .messages{background-color:#edf2f6;background-image:radial-gradient(#aab8c540 1px,transparent 1px)}
:root[data-theme="light"] .message{background:#fff;color:#202b36;border:1px solid #e0e6eb}
:root[data-theme="light"] .message.own{background:#dceeff;color:#183047;border-color:#c8e1f5}
:root[data-theme="light"] .message p,:root[data-theme="light"] .message-text,:root[data-theme="light"] .chatline strong,:root[data-theme="light"] .headtext h1,:root[data-theme="light"] .contentview h2,:root[data-theme="light"] .card h2,:root[data-theme="light"] .card h3{color:#202b36}
:root[data-theme="light"] .searchbox,:root[data-theme="light"] .favorites-search input,:root[data-theme="light"] .forward-search,:root[data-theme="light"] .message-search-form input{background:#eef2f5;color:#202b36;border-color:#d4dde5}
:root[data-theme="light"] .searchbox input,:root[data-theme="light"] .inputbar textarea,:root[data-theme="light"] input,:root[data-theme="light"] textarea,:root[data-theme="light"] select{color:#202b36}
:root[data-theme="light"] .chatitem:hover,:root[data-theme="light"] .drawer>button:hover,:root[data-theme="light"] .message-search-result:hover{background:#edf3f8}
:root[data-theme="light"] .chatitem.active{background:#dceeff;color:#183047}
:root[data-theme="light"] .chatitem.active .preview,:root[data-theme="light"] .chatitem.active .chatline time{color:#49677f}
:root[data-theme="light"] .card p,:root[data-theme="light"] .contentview p,:root[data-theme="light"] .chat-section-panel p{color:#526474}
:root[data-theme="light"] .preview,:root[data-theme="light"] .headtext p,:root[data-theme="light"] .helper,:root[data-theme="light"] .drawer p,:root[data-theme="light"] .drawer small,:root[data-theme="light"] .intro,:root[data-theme="light"] .font-scale,:root[data-theme="light"] .favorites-source,:root[data-theme="light"] .favorite-source{color:#647586}
:root[data-theme="light"] .tabs,:root[data-theme="light"] .chat-section-tabs,:root[data-theme="light"] .chat-member,:root[data-theme="light"] .shared-file-list,:root[data-theme="light"] .shared-link-list{border-color:#dce3e9}
:root[data-theme="light"] .datepill,:root[data-theme="light"] .messages .date-separator span{background:#e1e9ef;color:#526474;border-color:#d1dce5}
:root[data-theme="light"] .replybar,:root[data-theme="light"] .quoteblock{background:#edf3f7;color:#40566a}
:root[data-theme="light"] .quote-text,:root[data-theme="light"] .replybar span{color:#52697d}
:root[data-theme="light"] .chat-section-tabs button[aria-pressed="true"],:root[data-theme="light"] .favorites-nav.active{background:#e2f1fc;color:#17649a}
:root[data-theme="light"] .favorites-items,:root[data-theme="light"] .chat-member{color:#202b36}
:root[data-theme="light"] .favorite-message .message-text a,:root[data-theme="light"] .favorite-source{color:#285f89}
:root[data-theme="light"] .message-context,:root[data-theme="light"] .install-help,:root[data-theme="light"] .ack-dialog,:root[data-theme="light"] .chat-icon-dialog,:root[data-theme="light"] .chat-people-dialog,:root[data-theme="light"] .message-editor-dialog,:root[data-theme="light"] .message-search-dialog,:root[data-theme="light"] .photo-viewer,:root[data-theme="light"] .schedule-dialog{background:#fff;color:#202b36;border-color:#d5dee6}
:root[data-theme="light"] .message-context button:hover,:root[data-theme="light"] .chat-icon-dialog button:hover,:root[data-theme="light"] .chat-people-dialog button:hover{background:#edf3f7}
:root[data-theme="light"] .message-editor,:root[data-theme="light"] .message-search-form input,:root[data-theme="light"] .message-context input{background:#f5f7f9;color:#202b36;border-color:#d5dee6}
:root[data-theme="light"] .message-context header,:root[data-theme="light"] .chat-icon-dialog header,:root[data-theme="light"] .chat-people-dialog header{color:#202b36}
:root[data-theme="light"] .chat-icon-dialog .helper,:root[data-theme="light"] .ack-feedback,:root[data-theme="light"] .message-search-status{color:#647586}
:root[data-theme="light"] .drawer{box-shadow:8px 0 30px #20304020}
:root[data-theme="light"] .font-slider{accent-color:#287eb5}
.theme-options{display:flex;gap:10px;flex-wrap:wrap}
.theme-options button{min-width:130px}
@media(max-width:700px){:root[data-theme="light"] .drawer{background:#fff}}


/* Light theme: make the message composer and its controls use light surfaces. */
:root[data-theme="light"] .composerwrap,
:root[data-theme="light"] .favorites-composer-wrap{background:#f4f6f8;color:#202b36}
:root[data-theme="light"] .composerwrap .inputbar,
:root[data-theme="light"] .favorites-composer-wrap .inputbar{background:#fff;border-color:#d5dee6}
:root[data-theme="light"] .composerwrap .inputbar textarea,
:root[data-theme="light"] .favorites-composer-wrap .inputbar textarea{background:transparent;color:#202b36}
:root[data-theme="light"] .composerwrap .inputbar textarea::placeholder,
:root[data-theme="light"] .favorites-composer-wrap .inputbar textarea::placeholder{color:#8493a0;opacity:1}
:root[data-theme="light"] .composerwrap .inputbar .iconbutton,
:root[data-theme="light"] .composerwrap .schedule-send{background:transparent;color:#52697d}
:root[data-theme="light"] .composerwrap .inputbar .iconbutton:hover,
:root[data-theme="light"] .composerwrap .schedule-send:hover{background:#edf3f8;color:#285f89}
:root[data-theme="light"] .composerwrap .send{background:#dceeff;border-color:#c4dced;color:#17649a}
:root[data-theme="light"] .composerwrap .send:hover{background:#c9e5fa}
:root[data-theme="light"] .composerwrap .draft-files span{background:#e7edf2;color:#40566a}
:root[data-theme="light"] .composerwrap .important-toggle{color:#526474}
:root[data-theme="light"] .composerwrap .typing-indicator{color:#2876a8}
:root[data-theme="light"] .composerwrap .mention-suggestions{background:#fff;border-color:#d5dee6;color:#202b36}
:root[data-theme="light"] .composerwrap .mention-suggestions button{color:#202b36}
:root[data-theme="light"] .composerwrap .mention-suggestions button:hover,
:root[data-theme="light"] .composerwrap .mention-suggestions button:focus{background:#edf3f8}
:root[data-theme="light"] .favorites-composer-wrap .favorite-save{background:#287eb5;color:#fff}
:root[data-theme="light"] .favorites-composer-wrap .favorite-save:hover{background:#17699f}


/* Light theme: clear, readable actions above the chat list. */
:root[data-theme="light"] .chat-create-actions .secondary{
 background:#dceeff;
 color:#185b87;
 border:1px solid #c3dced;
}
:root[data-theme="light"] .chat-create-actions .secondary:hover{
 background:#c9e5fa;
 color:#124d76;
}
:root[data-theme="light"] .chat-create-actions .secondary:focus-visible{
 outline-color:#287eb5;
}


/* Light theme: readable controls in personal settings and security forms. */
:root[data-theme="light"] .font-settings label{color:#526474}
:root[data-theme="light"] .font-settings label input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
:root[data-theme="light"] .font-settings label select,
:root[data-theme="light"] .font-settings label textarea,
:root[data-theme="light"] .font-settings .auth-form input:not([type="range"]):not([type="checkbox"]):not([type="radio"]){background:#fff;color:#202b36;border-color:#cbd7e1}
:root[data-theme="light"] .font-settings input::placeholder,
:root[data-theme="light"] .font-settings textarea::placeholder{color:#8493a0;opacity:1}
:root[data-theme="light"] .font-settings .primary{background:#dceeff;color:#185b87;border:1px solid #c3dced}
:root[data-theme="light"] .font-settings .primary:hover{background:#c9e5fa;color:#124d76}
:root[data-theme="light"] .font-settings .secondary{background:#edf3f8;color:#28536f;border:1px solid #d5e0e9}
:root[data-theme="light"] .font-settings .secondary:hover{background:#e1edf6;color:#194966}
:root[data-theme="light"] .font-settings button:focus-visible{outline-color:#287eb5}
