/* Unified Chat on phones (/chat). Full-screen, large touch targets, safe areas of notched phones. */
:root{--navy:#123f4a;--teal:#1286a0;--line:#dde7ea;--bg:#f3f7f8;--muted:#6a7e83;--ink:#17262b;--own:#d9eef4;--at:#c2410c}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;height:100%;background:#fff;color:var(--ink);font:16px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-text-size-adjust:100%}
button,input,textarea{font:inherit;color:inherit}
.mc{display:flex;flex-direction:column;height:100dvh;max-width:760px;margin:0 auto;background:#fff;border-inline:1px solid var(--line)}
.mc-loading{margin:40vh auto;color:var(--muted)}
.mc-top{display:flex;align-items:center;gap:6px;padding:calc(env(safe-area-inset-top) + 8px) 10px 8px;background:var(--navy);color:#fff;flex:0 0 auto}
.mc-top h1{flex:1;margin:0 0 0 4px;font-size:21px}
.mc-logo-sm{height:30px;background:#fff;border-radius:6px;padding:2px 4px}
.mc-icon{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:44px;border:0;border-radius:12px;background:none;color:inherit;font-size:21px;cursor:pointer}
.mc-top .mc-icon:active{background:#ffffff22}
.mc-back{font-size:34px;line-height:1;padding-bottom:4px}
.mc-title{flex:1;min-width:0}.mc-title strong{display:block;font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mc-title small{display:block;font-size:12.5px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mc-scroll{flex:1;overflow:auto;padding:4px 0 calc(env(safe-area-inset-bottom) + 16px);-webkit-overflow-scrolling:touch}
.mc-scroll h2{margin:16px 16px 4px;font-size:12.5px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.mc-row{display:flex;align-items:center;gap:12px;width:100%;padding:10px 16px;border:0;background:none;text-align:left;cursor:pointer}
.mc-row:active{background:var(--bg)}
.mc-av{flex:0 0 44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e3eef1;color:var(--navy);font-weight:700;font-size:19px}
.mc-av.dm{background:var(--teal);color:#fff}
.mc-row-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;border-bottom:1px solid var(--line);padding-bottom:10px}
.mc-row-top{display:flex;justify-content:space-between;gap:8px}.mc-row-top strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mc-row-top time{flex:0 0 auto;font-size:12.5px;color:var(--muted)}
.mc-row-sub{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:14.5px;color:var(--muted)}
.mc-row-sub>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mc-row-sub b{flex:0 0 auto;min-width:22px;padding:1px 7px;border-radius:999px;background:var(--teal);color:#fff;font-size:12.5px;text-align:center}.mc-row-sub b.at{background:var(--at)}
.mc-add{display:block;margin:4px 16px;padding:8px 0;border:0;background:none;color:var(--teal);font-weight:600;cursor:pointer}
.mc-none{margin:8px 16px;color:var(--muted);font-size:14.5px}.mc-empty{text-align:center;margin-top:30vh}
.mc-notice{margin:12px 12px 4px;padding:12px 14px;border-radius:14px;background:#eaf5f8;border:1px solid #cbe4eb;display:flex;flex-direction:column;gap:4px;font-size:14.5px}
.mc-notice strong{color:var(--navy)}.mc-notice .mc-primary{margin-top:6px;align-self:flex-start}
.mc-primary{min-height:44px;padding:0 18px;border:0;border-radius:12px;background:var(--teal);color:#fff;font-weight:700;cursor:pointer}
.mc-chip{display:inline-flex;align-items:center;min-height:40px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--navy);font-weight:600;text-decoration:none;cursor:pointer}
/* conversation */
.mc-msgs{flex:1;overflow:auto;padding:8px 10px 12px;background:var(--bg);display:flex;flex-direction:column;gap:3px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.mc-day{text-align:center;margin:10px 0 6px;font-size:12px;color:var(--muted)}.mc-day span{background:#fff;padding:3px 10px;border-radius:999px;border:1px solid var(--line)}
.mc-older{text-align:center;margin:4px 0 8px}
.mc-m{display:flex;flex-direction:column;align-items:flex-start;max-width:86%}.mc-m.own{align-self:flex-end;align-items:flex-end}
.mc-who{margin:6px 0 1px 10px;font-size:12.5px;color:var(--teal);font-weight:600}
.mc-bubble{position:relative;padding:7px 11px 5px;border-radius:16px;background:#fff;box-shadow:0 1px 1px #0000000d;cursor:pointer;-webkit-user-select:text;user-select:text;max-width:100%}
.mc-m.own .mc-bubble{background:var(--own)}.mc-m.at .mc-bubble{box-shadow:inset 3px 0 0 var(--at),0 1px 1px #0000000d}
.mc-bubble p{margin:0;font-size:16px;overflow-wrap:anywhere}.mc-bubble p a{color:#0f6f88}
.mc-bubble time{display:block;margin-top:2px;text-align:right;font-size:11px;color:var(--muted)}
.mc-bubble .ck-pics,.mc-bubble .ck-files{max-width:min(320px,70vw)}
.mc-gone{color:var(--muted)}
.mc-links{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}.mc-links span{font-size:12.5px;border:1px solid var(--line);border-radius:6px;padding:1px 6px;background:#ffffffaa}
.mc-m .ck-reacts{margin:2px 4px 2px}
.mc-m.flash .mc-bubble{animation:mcflash 1.6s}@keyframes mcflash{0%,40%{background:#fff0b3}}
.mc-compose{position:relative;flex:0 0 auto;border-top:1px solid var(--line);padding:6px 6px calc(env(safe-area-inset-bottom) + 6px);background:#fff}
.mc-compose-row{display:flex;align-items:flex-end;gap:2px}
.mc-compose textarea{flex:1;min-height:42px;max-height:140px;padding:9px 12px;border:1px solid #cbdadd;border-radius:21px;resize:none;font-size:16px;line-height:1.35;outline:none;background:#fff}
.mc-compose textarea:focus{border-color:var(--teal)}
.mc-attach{color:var(--muted);font-size:22px;cursor:pointer}
.mc-send{flex:0 0 44px;height:44px;margin-left:4px;border:0;border-radius:50%;background:var(--teal);color:#fff;font-size:19px;cursor:pointer}.mc-send:disabled{opacity:.5}
.mc-compose .ck-pending{padding:4px 4px 2px}
.mc-replying{display:flex;align-items:center;gap:8px;margin:2px 4px 6px;padding:5px 10px;border-left:3px solid var(--teal);background:#eef5f7;border-radius:6px;font-size:13.5px;color:#33555e}
.mc-replying span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mc-replying button{border:0;background:none;font-size:22px;color:var(--muted);min-width:32px;cursor:pointer}
.mc-mention{position:absolute;left:8px;right:8px;bottom:100%;margin-bottom:6px;background:#fff;border:1px solid #cbdadd;border-radius:14px;box-shadow:0 10px 30px #123d4c2e;padding:4px;max-height:40vh;overflow:auto}
.mc-mention button,.mc-people button{display:flex;align-items:baseline;gap:8px;width:100%;min-height:44px;padding:8px 12px;border:0;border-radius:10px;background:none;text-align:left;cursor:pointer}
.mc-mention button:first-child{background:var(--bg)}.mc-mention small,.mc-people small{color:var(--muted)}
.mc-err{margin:4px 8px 0;font-size:13.5px;color:#a33d26}.mc-err:empty{display:none}
/* sheets */
.mc-sheet-bg{position:fixed;inset:0;z-index:20;background:#0f1f2466;display:flex;align-items:flex-end;justify-content:center;animation:mcfade .15s}
.mc-sheet{width:100%;max-width:520px;max-height:85dvh;overflow:auto;background:#fff;border-radius:18px 18px 0 0;padding:10px 10px calc(env(safe-area-inset-bottom) + 10px);display:flex;flex-direction:column;gap:2px;animation:mcup .18s}
.mc-sheet>button{min-height:50px;border:0;border-radius:12px;background:none;text-align:left;padding:0 14px;font-size:17px;cursor:pointer}.mc-sheet>button:active{background:var(--bg)}
.mc-sheet .danger{color:#b2391e}.mc-sheet-close{margin-top:4px;text-align:center!important;font-weight:600;background:var(--bg)!important}
.mc-sheet h2{margin:6px 12px 8px;font-size:18px}
.mc-sheet-reacts{display:flex;justify-content:space-between;gap:2px;padding:4px 2px 10px;border-bottom:1px solid var(--line);margin-bottom:4px}
.mc-sheet-reacts button{flex:1;height:48px;border:0;border-radius:12px;background:var(--bg);font-size:24px;cursor:pointer}.mc-sheet-reacts button.mine{background:#d2ebf2;outline:2px solid var(--teal)}
.mc-sheet-who{margin:6px 14px;font-size:13.5px;color:var(--muted)}
@keyframes mcfade{from{opacity:0}}@keyframes mcup{from{transform:translateY(40px)}}
/* search, settings, sign in */
.mc-q{flex:1;min-height:42px;padding:0 14px;border:0;border-radius:21px;font-size:16px;outline:none;background:#fff;color:var(--ink)}
.mc-result{display:flex;flex-direction:column;gap:2px;width:100%;padding:10px 16px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left;cursor:pointer}
.mc-result small{color:var(--teal);font-weight:600;font-size:13px}.mc-result>span:last-child{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:15px}
.mc-settings section{padding:4px 16px 14px;border-bottom:1px solid var(--line)}.mc-settings h2{margin:14px 0 8px}
.mc-radio{display:flex;align-items:flex-start;gap:10px;padding:10px 0;font-size:16px;cursor:pointer}.mc-radio input{width:22px;height:22px;margin:1px 0 0;accent-color:var(--teal)}
.mc-radio small{display:block;color:var(--muted);font-size:13.5px}.mc-muted{color:var(--muted);font-size:14px}
.mc-signin{margin:auto;width:100%;max-width:380px;padding:24px 20px calc(env(safe-area-inset-bottom) + 24px);display:flex;flex-direction:column;align-items:center}
.mc-logo{width:200px;max-width:70%}.mc-signin h1{margin:14px 0 18px;font-size:24px;color:var(--navy)}
.mc-signin form{width:100%;display:flex;flex-direction:column;gap:12px}
.mc-signin label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:14.5px}
.mc-signin input{min-height:48px;padding:0 14px;border:1px solid #cbdadd;border-radius:12px;font-size:16px}
.mc-signin .mc-primary{min-height:50px;font-size:17px}
@media(min-width:761px){body{background:var(--bg)}}
/* Folding sections and the floating new-message bubble */
.mc-sec{border-bottom:1px solid var(--line)}
.mc-sec-head{display:flex;align-items:center;gap:8px;width:100%;border:0;background:none;padding:14px 16px 8px;font-size:12.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);cursor:pointer;text-align:left}
.mc-sec-head small{font-weight:600;letter-spacing:0;opacity:.8}
.mc-sec-head b{margin-left:auto;background:var(--teal);color:#fff;border-radius:10px;padding:1px 8px;font-size:12px;letter-spacing:0}
.mc-caret{display:inline-block;transition:transform .15s;font-size:14px}
.mc-sec.shut .mc-caret{transform:rotate(-90deg)}
.mc-sec-body{padding-bottom:6px}
.mc-scroll{padding-bottom:calc(env(safe-area-inset-bottom) + 90px)}
.mc{position:relative}
.mc-fab{position:absolute;right:18px;bottom:calc(env(safe-area-inset-bottom) + 18px);display:inline-flex;align-items:center;gap:6px;height:56px;padding:0 22px 0 18px;border:0;border-radius:28px;background:var(--teal);color:#fff;font-size:17px;font-weight:700;box-shadow:0 6px 18px #12404a55;cursor:pointer;z-index:5}
.mc-fab span{font-size:24px;line-height:1}
.mc-fab:active{transform:scale(.97)}
