:root{color-scheme:dark;--bg:#0b1021;--surface:#10172a;--panel:#111a2f;--line:#25314a;--muted:#8292af;--text:#edf3ff;--accent:#7d8fff;--accent-2:#a0acff;--green:#5ad7ac;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);min-width:320px}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:not-allowed}.hidden{display:none!important}
.ambient{position:fixed;pointer-events:none;filter:blur(80px);opacity:.24}.ambient-one{width:460px;height:460px;top:-230px;left:-180px;background:#526fff;border-radius:50%}.ambient-two{width:390px;height:390px;bottom:-230px;right:-180px;background:#7553d4;border-radius:50%}
.auth-screen{min-height:100dvh;display:grid;place-items:center;padding:26px}.auth-card{position:relative;width:min(100%,460px);border:1px solid #293553;background:linear-gradient(155deg,rgba(24,34,59,.96),rgba(14,20,36,.98));border-radius:28px;padding:42px;box-shadow:0 25px 90px #0006}.auth-logo{display:grid;place-items:center;width:62px;height:62px;border-radius:19px;background:linear-gradient(135deg,#8294ff,#636dcd);font-size:33px;box-shadow:0 10px 32px #7884ff55;margin-bottom:27px}.eyebrow{color:#a5b4ff;font-size:10px;font-weight:800;letter-spacing:2.4px}.auth-card h1{font-size:37px;line-height:1.13;margin:9px 0 13px;letter-spacing:-1.5px}.auth-card h1 span{color:#9ba9ff}.auth-subtitle{color:#a4b0ca;line-height:1.55;font-size:14px;margin:0 0 27px}.auth-switch{display:flex;gap:4px;background:#0d1426;border:1px solid #28344a;padding:5px;border-radius:12px;margin-bottom:21px}.auth-tab{flex:1;border:0;border-radius:9px;background:transparent;color:#8996b1;padding:11px 0;font-weight:700;font-size:13px}.auth-tab.active{background:#293554;color:white;box-shadow:0 2px 8px #0002}.field{display:flex;flex-direction:column;gap:8px;margin:0 0 16px;color:#b8c6df;font-size:12px;font-weight:650}.field input{outline:0;width:100%;border:1px solid #34415c;border-radius:11px;background:#0c1426;padding:13px 14px;color:white;font-size:14px}.field input:focus,.search-wrap:focus-within,.composer:focus-within{border-color:#8597ff;box-shadow:0 0 0 3px #7188ff19}.primary,.secondary{border:0;border-radius:11px;padding:12px 16px;font-size:13px;font-weight:750}.primary{color:white;background:linear-gradient(110deg,#7789fb,#6472df);box-shadow:0 7px 18px #6476e72c}.primary span{margin-left:10px}.secondary{color:#d8e1fb;border:1px solid #3c4865;background:#202b45}.wide{width:100%;padding:15px;margin-top:10px}.auth-note{text-align:center;color:#70819e;font-size:11px;margin:23px 0 0}
.app-shell{position:relative;display:flex;margin:22px auto;width:min(1500px,calc(100% - 44px));height:calc(100dvh - 44px);min-height:430px;border:1px solid #303b54;border-radius:21px;overflow:hidden;box-shadow:0 20px 85px #0006;background:#10182c}.sidebar{width:348px;min-width:295px;display:flex;flex-direction:column;background:linear-gradient(155deg,#17213a,#111a2f 65%);border-right:1px solid #283550}.sidebar-brand{height:92px;display:flex;align-items:center;gap:13px;padding:22px 23px;border-bottom:1px solid #283450}.brand-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;color:white;background:linear-gradient(120deg,#8696ff,#6674d9);font-size:24px}.sidebar-brand strong{display:block;font-size:15px;letter-spacing:-.5px}.sidebar-brand small{display:block;color:#8c9ab6;font-size:11px;margin-top:4px}.sidebar-top{display:flex;justify-content:space-between;align-items:center;padding:26px 23px 15px}.sidebar-top h2{margin:0;font-size:23px;letter-spacing:-.8px}.icon-btn{border:0;background:#293554;color:#bfcaff;border-radius:10px;width:35px;height:35px;display:grid;place-items:center;font-size:20px}.icon-btn:hover,.secondary:hover{background:#3a486a}.search-wrap{display:flex;align-items:center;margin:0 17px 23px;background:#0d1529;border:1px solid #26334d;border-radius:12px;padding:0 13px}.search-wrap .search-icon{font-size:24px;color:#8495b4;margin-right:9px}.search-wrap input{border:0;outline:0;background:transparent;color:white;width:100%;padding:12px 0;font-size:13px}.search-wrap input::placeholder{color:#72819d}.list-caption{padding:0 23px 12px;color:#7788a7;font-size:10px;font-weight:800;letter-spacing:1.7px}.chat-list{overflow-y:auto;flex:1;padding:0 9px 10px;scrollbar-color:#3b4966 transparent}.chat-entry{border:0;background:transparent;color:inherit;width:100%;display:flex;align-items:center;text-align:left;gap:12px;padding:13px 13px;border-radius:12px}.chat-entry:hover{background:#273450}.chat-entry.active{background:#2d3b60}.avatar{position:relative;display:grid;place-items:center;flex-shrink:0;width:45px;height:45px;border-radius:15px;background:linear-gradient(135deg,#465fa5,#7153a2);color:white;font-size:17px;font-weight:800;overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover}.avatar.online::after{content:"";position:absolute;right:0;bottom:0;width:10px;height:10px;background:var(--green);border:2px solid #18223b;border-radius:50%}.entry-body{min-width:0;flex:1}.entry-top{display:flex;gap:8px;align-items:center;justify-content:space-between}.entry-name{font-size:13px;font-weight:740;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.entry-time{font-size:10px;color:#8290ac;white-space:nowrap}.entry-bottom{display:flex;justify-content:space-between;gap:7px;margin-top:5px;color:#91a0bb;font-size:12px}.entry-preview{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.unread{min-width:19px;height:19px;padding:1px 5px;border-radius:12px;background:#7d91fa;color:white;text-align:center;font-size:11px;font-weight:800}.placeholder-list{padding:35px 16px;text-align:center;color:#8392ad;font-size:13px;line-height:1.55}.my-profile{width:100%;display:flex;align-items:center;gap:12px;border:0;border-top:1px solid #293651;background:#151f36;color:white;text-align:left;padding:15px 19px}.avatar-me{width:40px;height:40px}.my-profile-text{min-width:0;flex:1}.my-profile-text strong,.my-profile-text small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.my-profile-text strong{font-size:13px}.my-profile-text small{font-size:11px;color:#8da0c2;margin-top:3px}.settings-gear{color:#a5b4db;font-size:21px}
.main-pane{flex:1;min-width:0;background:radial-gradient(ellipse at 50% 45%,#18233c 0%,#101728 70%);position:relative}.empty-chat{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:24px;text-align:center}.empty-mark{width:116px;height:116px;display:grid;place-items:center;border-radius:35px;background:linear-gradient(145deg,#273b67,#3e3b74);border:1px solid #536391;transform:rotate(-10deg);box-shadow:0 18px 55px #0003}.empty-mark span{font-size:63px;transform:rotate(10deg)}.empty-chat h2{font-size:25px;margin:35px 0 10px}.empty-chat p{max-width:360px;color:#9ca9bf;font-size:14px;line-height:1.65;margin:0 0 25px}.chat-panel{height:100%;display:flex;flex-direction:column}.chat-header{height:79px;flex-shrink:0;border-bottom:1px solid #283550;padding:0 27px;display:flex;gap:13px;align-items:center;background:#161f34c9}.chat-header .avatar{width:43px;height:43px}.peer-info{flex:1;min-width:0}.peer-info strong,.peer-info small{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.peer-info strong{font-size:14px}.peer-info small{font-size:12px;color:#94a5c0;margin-top:5px}.peer-info small.online-text{color:#62d6ae}.header-mark{color:#637491;font-size:11px}.header-mark span{color:#76e6be;margin-left:6px}.back-btn{display:none}.message-list{flex:1;overflow-y:auto;min-height:0;padding:22px 32px;scrollbar-color:#394867 transparent}.older{display:block;margin:0 auto 20px;border:1px solid #35476d;background:#21304e;color:#aabbdb;border-radius:18px;font-size:11px;padding:9px 16px}.day-label{width:max-content;margin:18px auto 24px;background:#26334e;color:#9caacc;border:1px solid #3c4b69;border-radius:18px;padding:7px 14px;font-size:11px}.message-row{display:flex;margin:9px 0}.message-row.mine{justify-content:flex-end}.bubble{max-width:min(74%,560px);min-width:100px;padding:11px 13px 8px;border:1px solid #33415c;border-radius:15px 15px 15px 5px;background:#24314b;box-shadow:0 2px 8px #0002}.mine .bubble{background:linear-gradient(115deg,#465ab5,#5762ad);border-color:#6577ce;border-radius:15px 15px 5px 15px}.bubble-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13.5px;line-height:1.5}.bubble-meta{display:flex;justify-content:flex-end;gap:7px;align-items:center;margin-top:5px;font-size:10px;color:#bbcae5}.mine .bubble-meta{color:#d4dcff}.ticks{font-weight:800;font-size:13px}.ticks.read{color:#8df2d5}.typing-indicator{height:21px;flex-shrink:0;color:#8fa4ca;font-size:12px;padding-left:33px}.composer{flex-shrink:0;display:flex;align-items:flex-end;gap:10px;border:1px solid #31405c;border-radius:14px;background:#18243d;padding:8px 9px;margin:0 26px}.composer textarea{resize:none;flex:1;min-height:29px;max-height:130px;color:white;background:none;outline:0;border:0;padding:7px 9px;line-height:1.45;font-size:13px}.composer textarea::placeholder{color:#8495b4}.send-btn{width:41px;height:39px;border:0;border-radius:11px;background:#7d90fa;color:white;font-size:19px}.send-btn:hover{background:#94a3ff}.composer-hint{text-align:center;color:#566681;font-size:10px;padding:9px 0 14px}
.modal-overlay{position:fixed;inset:0;z-index:20;background:#02040cc9;display:grid;place-items:center;padding:18px}.modal{width:min(100%,490px);max-height:90dvh;overflow:auto;background:#17223a;border:1px solid #3b4a68;border-radius:20px;padding:24px 27px;box-shadow:0 25px 90px #000a}.modal-head{display:flex;align-items:center;justify-content:space-between}.modal h2{margin:0;font-size:22px}.modal-profile{display:flex;align-items:center;gap:13px;margin:24px 0}.avatar-large{width:65px;height:65px;font-size:27px}.modal-profile strong,.modal-profile small{display:block}.modal-profile small{color:#9babca;margin-top:5px;font-size:12px}.inline-form{display:flex;flex-direction:column;gap:10px;padding-bottom:21px;border-bottom:1px solid #34415b}.upload-label{color:#9dacc8;font-size:12px}.upload-label input{display:block;margin-top:10px;width:100%;font-size:11px}.form-section{margin-top:20px;padding-bottom:19px;border-bottom:1px solid #34415b}.form-section h3{font-size:14px;margin:0 0 16px}.form-section .field{margin-bottom:12px}.logout-btn{width:100%;border:1px solid #714752;background:#3a2639;color:#ffc6cf;padding:12px;border-radius:11px;margin-top:20px;font-weight:700}.toast{position:fixed;bottom:28px;left:50%;transform:translate(-50%,20px);z-index:40;padding:12px 21px;background:#2a3e61;color:white;border:1px solid #6379a6;border-radius:12px;opacity:0;pointer-events:none;transition:.2s;font-size:13px;box-shadow:0 10px 32px #0006}.toast.show{opacity:1;transform:translate(-50%,0)}.toast.error{background:#5d2a3d;border-color:#9c516a}
@media(max-width:800px){.app-shell{width:100%;height:100dvh;margin:0;border:0;border-radius:0}.sidebar{width:315px;min-width:275px}.header-mark{display:none}.message-list{padding:18px 16px}.chat-header{padding:0 16px}.composer{margin:0 13px}}
@media(max-width:630px){.app-shell .sidebar{width:100%;min-width:0;border:0}.app-shell .main-pane{display:none}.app-shell.chat-open .sidebar{display:none}.app-shell.chat-open .main-pane{display:block}.back-btn{display:grid}.chat-header{height:72px}.bubble{max-width:87%}.auth-card{padding:28px}.auth-card h1{font-size:32px}}

/* v0.2 additions: responsive group / voice / message controls */
.sidebar-buttons{display:flex;gap:7px}
.group-avatar{background:linear-gradient(130deg,#805ea6,#516ea6);font-size:26px}
.icon-btn{flex-shrink:0}
.pinned-strip{background:#1d2942;border-bottom:1px solid #35456a;padding:8px 22px;flex-shrink:0}
.pinned-strip button{width:100%;display:flex;align-items:center;gap:12px;background:transparent;border:0;color:#e1e8ff;text-align:left;font-size:12px;cursor:pointer}
#pinned-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reply-tray{display:flex;align-items:center;gap:15px;margin:0 26px 8px;padding:9px 13px;border-left:3px solid #a1adff;background:#23324e;border-radius:10px}
.reply-tray>div{min-width:0;flex:1}.reply-tray strong,.reply-tray small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-tray strong{font-size:12px;color:#bac7ff}.reply-tray small{font-size:12px;color:#aebbd5;margin-top:3px}
.message-row{position:relative}.message-row .bubble{max-width:min(78%,570px);min-width:155px}.message-row.flash .bubble{outline:2px solid #b3b9ff}
.bubble.deleted .bubble-text{font-style:italic}.muted{color:#94a3c0}
.message-author{display:block;color:#b7caff;font-size:11px;font-weight:800;margin:0 0 6px}.mine .message-author{color:white}
.quoted{width:100%;max-width:100%;margin:0 0 9px;padding:6px 9px;display:block;text-align:left;border:0;border-left:3px solid #91aaff;border-radius:5px;background:#141f36aa;color:white}
.quoted span,.quoted small{display:block;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quoted span{font-size:11px;font-weight:700;color:#bfcfff}.quoted small{font-size:11px;margin-top:3px}
.reaction-line{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}.reaction-chip{background:#243f68;border:1px solid #496a97;color:#e5efff;border-radius:12px;padding:2px 7px;font-size:11px}.reaction-chip.selected{background:#596d9e;border-color:#91acff}
.message-actions{position:relative;display:flex;justify-content:flex-end}.message-menu-toggle{background:transparent;color:#c6d7ed;border:0;min-width:32px;height:20px;font-size:20px;line-height:15px}.message-menu{position:absolute;top:24px;right:0;z-index:10;display:flex;flex-direction:column;min-width:190px;padding:7px;background:#1b2a45;border:1px solid #6179a6;border-radius:12px;box-shadow:0 14px 35px #0009}.message-menu>button{background:transparent;border:0;text-align:left;color:#e8efff;font-size:12px;padding:9px;border-radius:7px}.message-menu>button:hover,.quick-reactions button:hover{background:#354969}.message-menu .danger-text{color:#ffafb9}.quick-reactions{display:flex;gap:2px;justify-content:space-between;padding:8px 0;border-block:1px solid #34435f}.quick-reactions button{font-size:15px;background:transparent;border:0;border-radius:7px;padding:4px 2px}
.modal-actions{display:flex;gap:9px;margin-top:16px}.member-list{display:flex;flex-direction:column;gap:7px}.members-heading{font-size:13px;color:#c6d5f7;margin:16px 0 8px}.member-row{display:flex;align-items:center;gap:10px;border:1px solid #344563;border-radius:11px;padding:9px;background:#1c2a46;color:#f0f4ff;text-align:left}.member-row .avatar{height:35px;width:35px;border-radius:11px}.member-info{flex:1;min-width:0}.member-info strong,.member-info small{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.member-info strong{font-size:12px}.member-info small{font-size:11px;color:#a0afce;margin-top:3px}.member-controls{display:flex;flex-wrap:wrap;gap:5px;justify-content:flex-end}.mini-btn{border:1px solid #53658a;border-radius:7px;background:#293957;color:#dce7fa;font-size:10px;padding:6px;cursor:pointer}.mini-btn.danger-text{color:#ff9bad}.pick-member{width:100%;cursor:pointer}.selection-info{font-size:11px;color:#a9b8d5;margin:9px 0;line-height:1.5}.pinned-list{display:flex;flex-direction:column;gap:9px;margin-top:22px}.pin-item{background:#24344f;color:#e9eeff;border:1px solid #3e5476;border-radius:10px;padding:12px;display:flex;gap:8px;text-align:left;overflow-wrap:anywhere}
@media(max-width:760px){.header-mark{display:none}.message-row .bubble{max-width:86%}}
@media(max-width:630px){.chat-header{padding:0 10px;gap:9px}.chat-header .avatar{width:38px;height:38px}.chat-header .icon-btn{width:32px;height:32px}.chat-header .peer-info{font-size:12px}.reply-tray{margin:0 12px 8px}.message-row .bubble{max-width:94%}.bubble{padding:10px}.quick-reactions button{padding:4px 1px}.composer-hint{padding:7px 0 12px}.modal{padding:18px 16px}.member-row{flex-wrap:wrap}.member-controls{flex:1 1 100%;justify-content:flex-start}}

/* v0.2.1: safe viewport positioning for contextual message menus */
.message-menu{position:fixed;top:0;left:0;right:auto;z-index:80;width:min(238px,calc(100vw - 16px));max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain}
.message-menu .quick-reactions{display:flex;flex-wrap:wrap;gap:1px}
.message-menu .quick-reactions button{flex:1 1 13%;min-width:24px}
@media(max-width:630px){.message-menu{width:min(210px,calc(100vw - 16px))}.message-menu>button{min-height:36px}.message-row .bubble{min-width:0;max-width:94%;overflow-wrap:anywhere}}


/* v0.3: search, forward, settings and group permissions */
.latest-button{display:block;background:#2d4269;border:1px solid #4a69a6;color:#fff;border-radius:10px;margin:9px auto;padding:9px 20px;font-weight:700;font-size:12px}
.v3-options .field select,#group-send-policy{background:#111a2c;color:#eef4ff;border:1px solid #405474;border-radius:10px;padding:11px;width:100%}
.option-line{display:flex;align-items:center;gap:10px;color:#c8d5ed;font-size:13px;margin:14px 0;cursor:pointer}.option-line input{accent-color:#8199ff;width:17px;height:17px}
.search-results,.forward-list{max-height:57dvh;overflow:auto;display:flex;flex-direction:column;gap:8px;margin-top:15px}
.v3-search-input{margin:20px 0 6px}.search-result,.forward-item{border:1px solid #3b5276;background:#21314f;text-align:left;color:#edf4ff;border-radius:11px;padding:13px;display:flex;flex-direction:column;gap:7px;overflow-wrap:anywhere}.search-result:hover,.forward-item:hover{background:#334a72}.search-result strong{display:flex;justify-content:space-between;gap:8px;font-size:13px}.search-result strong small{color:#9aafd0;font-size:11px;font-weight:400}.search-result span{color:#c9d5e9;font-size:12px;line-height:1.4}.forward-item{flex-direction:row;align-items:center;gap:14px}.forward-preview{margin:16px 0;padding:13px;border:1px solid #415775;border-radius:10px;background:#12213b;color:#d9e6ff;overflow-wrap:anywhere;font-size:13px}
.compact-chat .message-row{margin:3px 0}.compact-chat .bubble{padding:7px 10px 5px}.compact-chat .bubble-text{font-size:12px}.compact-chat .message-list{padding-top:10px;padding-bottom:10px}
.theme-ocean{--bg:#061a22;--surface:#102a32;--panel:#102e37;--line:#28505b;--accent:#3ab9ba;background:#071d27}.theme-ocean .app-shell{background:#0c2633;border-color:#2c5061}.theme-ocean .sidebar,.theme-ocean .main-pane{background:#0c2230}.theme-ocean .chat-header,.theme-ocean .my-profile{background:#123241}.theme-ocean .composer,.theme-ocean .bubble{background:#1a3c49}.theme-ocean .mine .bubble{background:linear-gradient(115deg,#207a88,#2c708b);border-color:#3c96a8}.theme-ocean .send-btn,.theme-ocean .primary{background:#198f9c}.theme-ocean .modal{background:#12303d}.theme-ocean .ambient-one{background:#1da6b1}.theme-ocean .ambient-two{background:#19758b}
@media(max-width:630px){.search-results,.forward-list{max-height:65dvh}.search-result{padding:11px}.latest-button{margin:6px auto}}

/* v0.3.1: unified chat search and clear online indicator */
.search-section-title{font-size:10px;color:#96a9d0;font-weight:800;letter-spacing:1px;padding:13px 14px 6px;margin-top:3px;border-top:1px solid #2d3b59}
.global-message-hit{display:block;width:100%;background:transparent;border:0;color:#e3eaff;text-align:left;border-radius:11px;padding:10px 13px;overflow:hidden;cursor:pointer}
.global-message-hit:hover,.global-message-hit:focus-visible{background:#2b3b5d;outline:0}
.hit-location,.hit-author,.hit-text{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hit-location{font-size:11px;color:#97a9cc;margin-bottom:5px}
.hit-author{font-size:12px;color:#cedbff;font-weight:700;margin-bottom:3px}
.hit-text{font-size:12px;color:#bac6e0;line-height:1.4}
.avatar.online::after{z-index:2;box-shadow:0 0 0 1px #131d32}

/* v0.4: device management and network state */
.v4-session-list{display:flex;flex-direction:column;gap:8px;margin:10px 0}
.v4-session-item{display:flex;gap:10px;justify-content:space-between;align-items:center;padding:11px;border:1px solid var(--border,#38465b);border-radius:12px;min-width:0}
.v4-session-content{min-width:0;display:flex;flex-direction:column;gap:4px}
.v4-session-content small{overflow-wrap:anywhere;opacity:.8}
.v4-session-item button{flex-shrink:0}
.v4-network{position:fixed;left:50%;transform:translateX(-50%);top:8px;z-index:9999;background:#453624;color:#fff5da;padding:8px 16px;border-radius:12px;box-shadow:0 6px 16px #0004;font-size:13px;max-width:95vw;text-align:center}
@media(max-width:550px){.v4-session-item{align-items:flex-start;flex-direction:column}.v4-session-item button{align-self:flex-end}}

/* v0.5: consistent emoji avatars, message readability and mobile controls */
.avatar{display:inline-flex;align-items:center;justify-content:center;font-size:22px;line-height:1;user-select:none;background:#4355a6}
.avatar-large{font-size:35px}
.avatar-me{font-size:25px}
.v5-avatar-section .avatar-large,#v5-group-avatar .avatar-large{margin:12px auto}
.v5-emoji-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(37px,1fr));gap:5px;max-height:196px;overflow:auto;padding:8px;border:1px solid #344866;border-radius:12px;margin:10px 0}
.v5-choice{border:1px solid transparent;border-radius:9px;background:#253650;color:#fff;font-size:23px;min-height:38px;cursor:pointer}
.v5-choice:hover,.v5-choice.picked{border-color:#99adff;background:#415779}
.v5-color-picker{display:flex;gap:8px;flex-wrap:wrap;margin:11px 0 16px}
.v5-swatch{width:31px;height:31px;border-radius:50%;border:2px solid #8e9fc4;cursor:pointer}
.v5-swatch.picked{outline:3px solid #e4eaff;outline-offset:2px}
.v5-draft-label{color:#d0a5ff;font-weight:700}
.v5-draft-status{font-size:11px;color:#96a9cf;padding:0 22px 6px;min-height:16px}
.v5-unread-line{margin:20px auto;max-width:fit-content;border:1px solid #718ac0;border-radius:18px;padding:6px 16px;background:#324365;color:#d9e5ff;font-size:12px;font-weight:700;text-align:center}
.v5-grouped{margin-top:-4px!important}.v5-grouped .bubble{border-top-left-radius:8px;border-top-right-radius:8px}
.message-row .bubble{overflow-wrap:anywhere}.message-row .quoted{cursor:pointer}
.search-result mark,.global-message-hit mark{background:#c1a453;color:#141827;padding:0 2px;border-radius:2px}
.message-list{overscroll-behavior:contain;scrollbar-gutter:stable}
.message-actions button:focus-visible,.v5-choice:focus-visible,.v5-swatch:focus-visible{outline:2px solid #c2cbff;outline-offset:2px}
@media(max-width:630px){
 .chat-header{min-height:70px;height:auto;padding:8px 9px;gap:5px}
 .chat-header .icon-btn{min-width:34px;min-height:40px}
 .chat-header .peer-info{min-width:0;overflow:hidden}
 .chat-header .peer-info strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .composer{padding-bottom:max(8px,env(safe-area-inset-bottom));margin:0 8px}
 .sidebar .chat-entry{min-height:66px}
 .v5-emoji-picker{grid-template-columns:repeat(auto-fill,minmax(40px,1fr));max-height:180px}
 .modal{max-height:90dvh;overflow-y:auto}
}

/* v0.5.1 — centred brand, quiet connection indicator, unobtrusive retry and new-message controls */
.sidebar-brand{justify-content:center;gap:11px;text-align:center;padding-inline:10px}
.sidebar-brand strong{font-size:16px;letter-spacing:-.35px;white-space:nowrap}
.sidebar-brand .brand-icon{width:40px;height:40px;font-size:23px}
.sidebar-top{gap:8px}
.sidebar-top h2{flex:0 1 auto}
.gp51-connection{display:inline-flex;align-items:center;gap:5px;color:#9bacc7;font-size:10px;white-space:nowrap;min-width:0;margin-left:auto}
.gp51-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#e4b15b;flex-shrink:0}
.gp51-online .gp51-dot{background:#4edba6}
.gp51-offline .gp51-dot{background:#ec7880}
.sidebar-buttons{flex-shrink:0}
.gp51-new-messages{position:absolute;right:29px;bottom:135px;z-index:4;border:1px solid #5b79b8;color:#eff5ff;background:#273d64;border-radius:18px;padding:10px 15px;font-weight:700;font-size:12px;box-shadow:0 6px 24px #0007;cursor:pointer}
.gp51-new-messages:hover{background:#355082}
.chat-panel{position:relative}
.gp51-send-error{display:flex;align-items:center;gap:9px;justify-content:space-between;margin:4px 26px 8px;padding:8px 11px;background:#422a38;border:1px solid #975263;border-radius:10px;color:#ffd6df;font-size:12px}
.gp51-send-error button{background:#64374a;border:1px solid #bd728a;color:#fff;padding:7px 10px;border-radius:8px;cursor:pointer;font-size:12px}
.gp51-send-error button:hover{background:#7b4257}
.gp51-send-error.hidden,.gp51-new-messages.hidden{display:none!important}
@media(max-width:630px){.gp51-new-messages{right:15px;bottom:129px}.gp51-send-error{margin-inline:12px}.sidebar-brand strong{font-size:15px}.gp51-connection{font-size:9px}}
