:root{font-family:'DM Sans','Noto Sans TC',sans-serif;color:#17221f;background:#f3f5f4;font-synthesis:none;text-rendering:optimizeLegibility;--green:#13a881;--green-dark:#087f64;--ink:#17221f;--muted:#85908c;--line:#edf0ee;--surface:#fff;--soft:#f6f8f7}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:not-allowed}.hidden{display:none!important}.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 15% 20%,#e3f7ef 0,transparent 34%),radial-gradient(circle at 90% 84%,#eaf0fa 0,transparent 31%),#f6f8f7}.login-card{width:min(100%,420px);padding:42px 42px 34px;background:#fff;border:1px solid #e9efeb;border-radius:24px;box-shadow:0 20px 70px #183c2a12}.brand-mark{width:50px;height:50px;border-radius:17px;display:grid;place-items:center;color:white;font-size:calc(24px * var(--ui-scale, 1));font-weight:700;background:linear-gradient(145deg,#27c69b,#07886b);box-shadow:0 8px 20px #13a88138}.brand-mark.small{width:36px;height:36px;border-radius:12px;font-size:calc(17px * var(--ui-scale, 1))}.eyebrow{margin:30px 0 8px;color:var(--green);font-size:calc(10px * var(--ui-scale, 1));font-weight:700;letter-spacing:.17em}.login-card h1{margin:0;font-size:calc(33px * var(--ui-scale, 1));letter-spacing:-.04em}.muted{color:var(--muted)}.stack-form{display:grid;gap:17px;margin-top:28px}.stack-form label,.field-label{display:grid;gap:8px;color:#53615b;font-size:calc(13px * var(--ui-scale, 1));font-weight:600}.stack-form input,.modal-input{width:100%;height:46px;border:1px solid #dfe7e2;border-radius:11px;padding:0 13px;outline:none;background:#fff;color:var(--ink)}.stack-form input:focus,.modal-input:focus,.search-wrap:focus-within{border-color:#85d8bd;box-shadow:0 0 0 3px #13a88112}.primary-button{border:0;border-radius:11px;background:var(--green);color:white;font-weight:700;height:48px;box-shadow:0 7px 15px #13a88126}.primary-button:hover{background:var(--green-dark)}.primary-button.compact{height:40px;padding:0 18px}.form-error{min-height:18px;margin:0;color:#c34e4e;font-size:calc(12px * var(--ui-scale, 1))}.login-help{margin:22px 0 0;text-align:center;color:#929d98;font-size:calc(12px * var(--ui-scale, 1))}.app-shell{height:100dvh;min-height:520px;display:grid;grid-template-columns:340px minmax(0,1fr);max-width:1600px;margin:0 auto;background:#fff;box-shadow:0 0 50px #203d2b0b}.sidebar{display:flex;flex-direction:column;border-right:1px solid var(--line);min-width:0;background:#fff}.sidebar-header{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 21px;border-bottom:1px solid var(--line)}.brand-lockup{display:flex;align-items:center;gap:10px}.brand-lockup strong,.brand-lockup span{display:block}.brand-lockup strong{font-size:calc(14px * var(--ui-scale, 1));letter-spacing:.01em}.brand-lockup span{margin-top:2px;color:var(--muted);font-size:calc(10px * var(--ui-scale, 1))}.icon-button{width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:10px;background:transparent;color:#687670;font-size:calc(20px * var(--ui-scale, 1))}.icon-button:hover{background:#f1f5f3}.profile-row{display:flex;align-items:center;gap:11px;padding:18px 20px 13px}.avatar{width:40px;height:40px;flex:none;display:grid;place-items:center;border-radius:14px;background:#e2f4ed;color:#178965;font-weight:700}.profile-copy{min-width:0;flex:1}.profile-copy strong,.profile-copy span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-copy strong{font-size:calc(13px * var(--ui-scale, 1))}.profile-copy span{margin-top:4px;color:var(--muted);font-size:calc(11px * var(--ui-scale, 1))}.role-badge{padding:4px 7px;border-radius:7px;background:#e9f8f2;color:#168a68;font-size:calc(10px * var(--ui-scale, 1))}.search-wrap{height:40px;margin:0 18px 13px;padding:0 11px;display:flex;align-items:center;gap:8px;border:1px solid #e9eeeb;border-radius:10px;background:#fafcfb;color:#85908c}.search-wrap input{width:100%;border:0;outline:0;background:transparent;font-size:calc(12px * var(--ui-scale, 1));color:var(--ink)}.search-wrap input::placeholder{color:#9aa49f}.clear-search{border:0;background:none;color:#88948e;font-size:calc(19px * var(--ui-scale, 1))}.sidebar-actions{display:flex;gap:8px;padding:0 18px 16px}.soft-button{min-height:34px;padding:0 10px;border:1px solid #dceee6;border-radius:9px;background:#f1faf6;color:#178864;font-size:calc(11px * var(--ui-scale, 1));font-weight:600}.soft-button:hover{background:#e6f6ef}.section-heading{display:flex;align-items:center;justify-content:space-between;padding:11px 21px;color:#8b9691;font-size:calc(10px * var(--ui-scale, 1));font-weight:700;letter-spacing:.08em;text-transform:uppercase;border-top:1px solid #f4f6f5}.count-pill{min-width:20px;padding:3px 6px;border-radius:8px;background:#f0f3f1;text-align:center;font-size:calc(10px * var(--ui-scale, 1))}.conversation-list{flex:1;overflow:auto;padding:4px 9px}.conversation-item{width:100%;display:flex;gap:11px;align-items:center;padding:11px 10px;border:0;border-radius:12px;background:transparent;text-align:left;color:var(--ink)}.conversation-item:hover{background:#f7f9f8}.conversation-item.selected{background:#eff8f4}.conversation-avatar{width:42px;height:42px;border-radius:14px}.conversation-copy{min-width:0;flex:1}.conversation-top{display:flex;justify-content:space-between;gap:6px}.conversation-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:calc(12px * var(--ui-scale, 1));font-weight:700}.conversation-time{flex:none;color:#a1aaa5;font-size:calc(9px * var(--ui-scale, 1))}.conversation-preview{display:flex;justify-content:space-between;gap:6px;margin-top:5px}.preview-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#909b95;font-size:calc(10px * var(--ui-scale, 1))}.unread-badge{min-width:18px;height:18px;display:grid;place-items:center;border-radius:10px;background:var(--green);color:#fff;font-size:calc(9px * var(--ui-scale, 1))}.sidebar-footer{height:42px;display:flex;align-items:center;gap:7px;padding:0 21px;border-top:1px solid var(--line);color:#9aa49f;font-size:calc(10px * var(--ui-scale, 1))}.online-dot{width:7px;height:7px;border-radius:50%;background:#25b58b}.chat-panel{position:relative;min-width:0;background:#fbfcfb}.empty-state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;text-align:center}.empty-art{position:relative;width:170px;height:138px;margin-bottom:24px;border-radius:42px;background:linear-gradient(145deg,#eff9f4,#f4f6fc);display:grid;place-items:center;color:#20ad83;font-size:calc(45px * var(--ui-scale, 1))}.empty-art span:nth-child(2){position:absolute;top:8px;right:15px;color:#8ca8fa;font-size:calc(20px * var(--ui-scale, 1))}.empty-art span:nth-child(3){position:absolute;bottom:14px;left:13px;color:#edb66b;font-size:calc(25px * var(--ui-scale, 1))}.empty-state h2{margin:0;font-size:calc(21px * var(--ui-scale, 1))}.empty-state p{margin:9px 0 20px;color:#8c9791;font-size:calc(13px * var(--ui-scale, 1))}.active-chat{height:100%;display:flex;flex-direction:column}.chat-header{height:72px;flex:none;display:flex;align-items:center;gap:12px;padding:0 25px;border-bottom:1px solid var(--line);background:#fff}.chat-avatar{width:42px;height:42px;border-radius:14px}.chat-heading{min-width:0;flex:1}.chat-heading h2{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:calc(14px * var(--ui-scale, 1))}.chat-heading span{display:block;margin-top:4px;color:#93a099;font-size:calc(10px * var(--ui-scale, 1))}.message-list{flex:1;overflow:auto;padding:25px clamp(18px,5vw,70px);background:linear-gradient(180deg,#fbfcfb,#f9fbfa)}.date-divider{text-align:center;margin:6px 0 22px;color:#9aa49f;font-size:calc(10px * var(--ui-scale, 1))}.message-row{display:flex;align-items:flex-end;gap:8px;margin:10px 0}.message-row.mine{justify-content:flex-end}.message-avatar{width:28px;height:28px;border-radius:10px;background:#e8efec;color:#6d8178;font-size:calc(10px * var(--ui-scale, 1))}.message-content{max-width:min(72%,560px)}.sender-name{margin:0 0 4px 3px;color:#87948d;font-size:calc(10px * var(--ui-scale, 1))}.bubble{padding:11px 14px;border-radius:15px 15px 15px 4px;background:#fff;border:1px solid #edf1ee;box-shadow:0 3px 10px #1c39250a;color:#25332d;font-size:calc(13px * var(--ui-scale, 1));line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}.mine .bubble{border-color:#c6efdf;border-radius:15px 15px 4px 15px;background:#dff7eb}.message-meta{margin:4px 3px 0;color:#a0aaa5;font-size:calc(9px * var(--ui-scale, 1))}.mine .message-meta{text-align:right}.composer{display:flex;align-items:flex-end;gap:12px;padding:13px 22px 18px;border-top:1px solid var(--line);background:#fff}.composer textarea{flex:1;min-height:43px;max-height:120px;resize:none;padding:12px 14px;border:1px solid #e6ece8;border-radius:12px;outline:none;background:#fafcfb;font-size:calc(12px * var(--ui-scale, 1));line-height:1.45}.composer textarea:focus{border-color:#98ddc5}.send-button{width:43px;height:43px;border:0;border-radius:13px;background:var(--green);color:#fff;font-size:calc(17px * var(--ui-scale, 1))}.send-button:hover{background:var(--green-dark)}.mobile-back{display:none}.search-results{position:absolute;z-index:5;top:176px;left:14px;right:14px;max-height:55vh;overflow:auto;padding:6px;border:1px solid #e7eeea;border-radius:13px;background:#fff;box-shadow:0 16px 35px #193f2915}.search-result{width:100%;display:flex;align-items:center;gap:10px;padding:9px;border:0;border-radius:9px;background:#fff;text-align:left}.search-result:hover{background:#f1f8f4}.search-result span:last-child{display:grid;gap:4px}.search-result small{color:#96a19b}.modal-layer{position:fixed;z-index:20;inset:0;display:grid;place-items:center;padding:18px;background:#16231f66;backdrop-filter:blur(3px)}.modal-card{width:min(100%,520px);max-height:min(85vh,760px);display:flex;flex-direction:column;overflow:hidden;border:1px solid #edf1ee;border-radius:18px;background:#fff;box-shadow:0 24px 80px #10221a33}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:15px 19px;border-bottom:1px solid var(--line)}.modal-header h2{margin:0;font-size:calc(15px * var(--ui-scale, 1))}.modal-body{overflow:auto;padding:18px}.modal-form{display:grid;gap:13px}.modal-form label{display:grid;gap:7px;color:#68756f;font-size:calc(11px * var(--ui-scale, 1));font-weight:600}.modal-form input,.modal-form select{width:100%;height:40px;padding:0 11px;border:1px solid #e1e8e3;border-radius:9px;outline:0}.modal-form .primary-button{height:42px;margin-top:5px}.member-picker{display:grid;gap:4px;max-height:260px;overflow:auto;margin:4px 0}.member-option{display:flex!important;grid-template-columns:18px 1fr!important;align-items:center;gap:10px!important;padding:9px;border-radius:9px;background:#fafcfb}.member-option input{width:16px!important;height:16px!important}.member-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #f0f3f1}.member-row small{color:#98a29d}.text-button{border:0;background:transparent;color:#b34d4d;font-size:calc(11px * var(--ui-scale, 1))}.user-row{display:flex;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid #f0f3f1}.user-row-main{min-width:0;flex:1}.user-row-main strong,.user-row-main small{display:block}.user-row-main small{margin-top:3px;color:#909b95}.toast{position:fixed;z-index:30;bottom:22px;left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;padding:10px 15px;border-radius:10px;background:#20322a;color:#fff;font-size:calc(12px * var(--ui-scale, 1));transition:.2s}.toast.show{opacity:1;transform:translate(-50%,0)}.empty-list{padding:24px 15px;text-align:center;color:#a0aaa5;font-size:calc(11px * var(--ui-scale, 1))}.form-hint{margin:0;color:#9aa49f;font-size:calc(10px * var(--ui-scale, 1))}.mobile-only{display:none}
@media(max-width:760px){body{background:#fff}.app-shell{display:block;min-height:100dvh;height:100dvh}.sidebar{height:100%;border:0}.sidebar-header{height:62px}.chat-panel{position:absolute;inset:0;display:none;background:#fbfcfb}.app-shell.chat-open .sidebar{display:none}.app-shell.chat-open .chat-panel{display:block}.active-chat{height:100dvh}.chat-header{height:64px;padding:0 13px;gap:9px}.mobile-back{display:grid;width:30px;font-size:calc(27px * var(--ui-scale, 1))}.chat-avatar{width:36px;height:36px}.message-list{padding:18px 13px}.message-content{max-width:82%}.composer{padding:10px 12px calc(10px + env(safe-area-inset-bottom))}.sidebar-actions{padding-bottom:12px}.conversation-list{padding-bottom:12px}.search-results{top:165px}.login-card{padding:34px 25px 28px;border-radius:20px}.sidebar-footer{height:38px}}
.chat-tools{display:flex;align-items:center;gap:3px;margin-left:auto}.chat-tools svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.chat-header{position:relative}.chat-more-menu{position:absolute;z-index:12;top:60px;right:12px;width:196px;padding:6px;border:1px solid #e6ebe8;border-radius:10px;background:#fff;box-shadow:0 14px 35px #13261c22}.chat-more-menu button{display:block;width:100%;height:34px;padding:0 12px;border:0;border-radius:6px;background:transparent;color:#34413b;text-align:left;font-size:calc(12px * var(--ui-scale, 1))}.chat-more-menu button:hover{background:#f3f7f5}.chat-more-menu .danger-menu-item{color:#b84c4c}.menu-divider{height:1px;margin:5px 4px;background:#edf0ee}.note-editor{width:100%;min-height:280px;resize:vertical;padding:13px;border:1px solid #e0e8e3;border-radius:10px;outline:none;font:inherit;font-size:calc(13px * var(--ui-scale, 1));line-height:1.6}.note-editor:focus{border-color:#8ed8bd}.note-meta{margin:8px 0 12px;color:#929d97;font-size:calc(10px * var(--ui-scale, 1))}.chat-search-results{display:grid;gap:5px;max-height:55vh;overflow:auto;margin-top:12px}.chat-search-result{width:100%;padding:10px;border:1px solid #edf1ee;border-radius:9px;background:#fff;text-align:left}.chat-search-result:hover{background:#f5faf7}.chat-search-result strong,.chat-search-result small{display:block}.chat-search-result strong{margin-bottom:5px;color:#78857e;font-size:calc(10px * var(--ui-scale, 1))}.chat-search-result span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#28352f;font-size:calc(12px * var(--ui-scale, 1));line-height:1.45}.chat-search-result small{margin-top:5px;color:#9ba59f;font-size:calc(9px * var(--ui-scale, 1))}.message-row.search-hit .bubble{outline:2px solid #e8ba5e;outline-offset:2px}
.active-chat{position:relative}
/* LINE-inspired chat toolbar and overflow menu */
.chat-tools .icon-button{width:32px;height:34px;border-radius:7px;color:#65716c}.chat-tools .icon-button:hover{background:#edf2ef}.chat-more-menu{width:184px;padding:5px;background:#3a3b3d;border-color:#505154;border-radius:7px;box-shadow:0 10px 28px #10141035}.chat-more-menu button{height:34px;color:#f3f3f3;font-size:calc(12px * var(--ui-scale, 1))}.chat-more-menu button:hover{background:#4a4b4d}.chat-more-menu .danger-menu-item{color:#ffaaa5}.chat-more-menu .menu-divider{background:#505154}
.notes-modal .modal-card{width:min(420px,96vw);height:min(92vh,820px);max-height:92vh;background:#292a2c;border:1px solid #393a3c;color:#f0f0f0;border-radius:9px}.notes-modal .modal-header{position:relative;justify-content:center;min-height:48px;padding:12px 48px;border-bottom:0;background:#292a2c}.notes-modal .modal-header h2{flex:1;text-align:center;font-size:calc(13px * var(--ui-scale, 1));font-weight:600;color:#f4f4f4}.notes-modal .modal-header .icon-button{position:absolute;right:9px;top:7px;color:#bfc1c2}.notes-modal .modal-body{position:relative;display:flex;flex-direction:column;min-height:0;padding:0;background:#292a2c;overflow:hidden}.notes-tabs{display:flex;flex:none;height:43px;border-bottom:1px solid #414244}.notes-tabs button{position:relative;flex:1;border:0;background:transparent;color:#a8aaab;font-size:calc(12px * var(--ui-scale, 1))}.notes-tabs button.active{color:#f6f6f6;font-weight:600}.notes-tabs button.active:after{position:absolute;right:35%;bottom:0;left:35%;height:2px;background:#f0f0f0;content:''}.notes-search{height:42px;flex:none;display:flex;align-items:center;gap:8px;margin:11px 10px 8px;padding:0 11px;border-radius:7px;background:#3d3e40;color:#c7c8c9}.notes-search input{width:100%;border:0;outline:0;background:transparent;color:#f4f4f4;font-size:calc(12px * var(--ui-scale, 1))}.notes-search input::placeholder{color:#a6a7a8}.shared-notes-list{flex:1;overflow:auto;padding:0 10px 65px}.shared-note-card{position:relative;margin:0 0 8px;padding:11px 9px;border-radius:7px;background:#363739;color:#ededed}.shared-note-main{width:100%;display:grid;gap:7px;padding:0 28px 0 2px;border:0;background:transparent;color:inherit;text-align:left}.shared-note-main strong{font-size:calc(12px * var(--ui-scale, 1));font-weight:600}.shared-note-main span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3;color:#d0d1d1;font-size:calc(11px * var(--ui-scale, 1));line-height:1.45;white-space:pre-wrap}.shared-note-main small{color:#a2a4a5;font-size:calc(9px * var(--ui-scale, 1))}.note-card-menu{position:absolute;top:8px;right:6px;width:27px;height:27px;border:0;border-radius:5px;background:transparent;color:#b9bbbc;font-size:calc(18px * var(--ui-scale, 1))}.note-card-menu:hover{background:#4a4b4d}.note-card-actions{position:absolute;z-index:3;top:34px;right:8px;width:95px;padding:4px;border:1px solid #4a4b4c;border-radius:6px;background:#252628;box-shadow:0 8px 18px #1118}.note-card-actions button{width:100%;padding:7px;border:0;border-radius:4px;background:transparent;color:#eee;text-align:left;font-size:calc(11px * var(--ui-scale, 1))}.note-card-actions button:hover{background:#424345}.note-card-actions .danger-menu-item{color:#ffaaa5}.notes-empty{margin:auto;padding:28px;text-align:center;color:#a2a4a5;font-size:calc(12px * var(--ui-scale, 1))}.notes-fab{position:absolute;right:18px;bottom:18px;width:48px;height:48px;border:0;border-radius:50%;background:#06b84f;color:#fff;font-size:calc(27px * var(--ui-scale, 1));font-weight:300;box-shadow:0 3px 10px #0005}.notes-fab:hover{background:#05a947}.album-placeholder{flex:1}.shared-note-editor{flex:1;display:flex;flex-direction:column;gap:11px;padding:14px;min-height:0}.shared-note-editor label{display:grid;gap:7px;color:#c6c8c9;font-size:calc(11px * var(--ui-scale, 1))}.note-title-input{height:38px;padding:0 10px;border:1px solid #4a4b4d;border-radius:6px;background:#353638;color:#f3f3f3;outline:0}.shared-note-editor .note-editor{flex:1;min-height:140px;resize:none;border:1px solid #4a4b4d;border-radius:6px;background:#353638;color:#f3f3f3}.note-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#a4a6a7;font-size:calc(9px * var(--ui-scale, 1))}.note-editor-footer .primary-button{flex:none}.notes-modal .form-hint{color:#aaa}
@media(max-width:520px){.notes-modal .modal-layer{padding:0}.notes-modal .modal-card{width:100%;height:100dvh;max-height:100dvh;border:0;border-radius:0}.notes-modal .modal-body{padding-bottom:env(safe-area-inset-bottom)}}
@media(max-width:520px){.modal-layer.notes-modal{padding:0}}
.note-editor-modal{background:#6070698c;backdrop-filter:blur(4px)}.note-editor-modal .modal-card{width:min(520px,calc(100vw - 32px));height:min(488px,88vh);min-height:390px;max-height:88vh;border:1px solid #e8eeeb;border-radius:18px;background:#fff;color:#17221f;box-shadow:0 24px 70px #18251e30}.note-editor-modal .modal-header{position:relative;min-height:67px;justify-content:flex-start;padding:0 20px;border-bottom:1px solid #edf0ee;background:#fff}.note-editor-modal .modal-header h2{flex:1;text-align:left;color:#17221f;font-size:calc(14px * var(--ui-scale, 1));font-weight:700}.note-editor-modal .modal-header .icon-button{position:absolute;right:10px;top:14px;color:#53605a}.note-editor-modal .modal-body{display:flex;flex:1;min-height:0;overflow:auto;padding:18px;background:#fff}.note-editor-modal .shared-note-editor{width:100%;display:flex;flex-direction:column;gap:11px;padding:0}.note-share-hint{margin:0;color:#96a19b;font-size:calc(10px * var(--ui-scale, 1))}.note-editor-modal .note-editor{flex:1;min-height:180px;width:100%;padding:13px;border:1px solid #dce5df;border-radius:10px;background:#fff;color:#17221f;font:inherit;font-size:calc(13px * var(--ui-scale, 1));line-height:1.6;resize:vertical}.note-editor-modal .note-editor:focus{border-color:#87d6b9;outline:0;box-shadow:0 0 0 3px #13a88112}.note-compose-toolbar{position:relative;display:flex;align-items:center;gap:4px;min-height:34px}.note-compose-toolbar>button{width:34px;height:32px;display:grid;place-items:center;border:0;border-radius:7px;background:transparent;color:#65716c;font-size:calc(20px * var(--ui-scale, 1))}.note-compose-toolbar>button:hover{background:#f0f4f2}.note-compose-toolbar svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.note-emoji-tray{position:absolute;z-index:3;bottom:38px;left:0;display:flex;gap:3px;padding:6px;border:1px solid #e2e9e5;border-radius:9px;background:#fff;box-shadow:0 8px 22px #17271d20}.note-emoji-tray button{width:30px;height:30px;border:0;border-radius:6px;background:#fff;font-size:calc(18px * var(--ui-scale, 1))}.note-emoji-tray button:hover{background:#f1f5f3}.note-image-preview{display:flex;flex-wrap:wrap;gap:7px;max-height:88px;overflow:auto}.note-image-item{position:relative;width:64px;height:64px}.note-image-item img{width:100%;height:100%;object-fit:cover;border:1px solid #e2e8e4;border-radius:7px}.note-image-item button{position:absolute;top:-5px;right:-5px;width:19px;height:19px;border:0;border-radius:50%;background:#33413a;color:#fff;font-size:calc(15px * var(--ui-scale, 1));line-height:1}.note-editor-footer{display:flex;align-items:center;min-height:17px;color:#96a19b;font-size:calc(10px * var(--ui-scale, 1))}.note-editor-actions{display:flex;align-items:center;gap:8px}.note-editor-actions .primary-button{height:44px;padding:0 17px}.cancel-button{height:40px;padding:0 15px;border:0;border-radius:10px;background:#f0f3f1;color:#59655f;font-size:calc(12px * var(--ui-scale, 1))}.note-card-thumb{max-width:100%;max-height:120px;object-fit:cover;border-radius:6px}.note-editor-modal .form-hint{color:#96a19b}
@media(max-width:520px){.note-editor-modal .modal-card{width:calc(100vw - 32px);height:min(488px,88vh);min-height:360px;border-radius:16px}.note-editor-modal .modal-layer{padding:16px}}
@media(max-width:520px){.modal-layer.note-editor-modal{padding:16px}}
/* LINE-inspired dark desktop layout */
:root{--green:#06c755;--green-dark:#05ae4b;--ink:#e7e7e7;--muted:#a2a3a4;--line:#3e3f41;--surface:#2c2d2f;--soft:#353638}body{background:#252628;color:#e8e8e8}.app-shell{grid-template-columns:54px 303px minmax(0,1fr);max-width:none;height:100dvh;background:#2c2d2f;box-shadow:none}.icon-rail{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 0;background:#1e1f21;border-right:1px solid #3a3b3d}.rail-button{position:relative;width:42px;height:42px;display:grid;place-items:center;border:0;border-radius:9px;background:transparent;color:#858789;font-size:calc(21px * var(--ui-scale, 1))}.rail-button:hover{background:#2e2f31;color:#e7e7e7}.rail-button.active{color:#fff;background:#343537}.rail-profile{margin-bottom:8px}.rail-profile span{width:27px;height:27px;display:grid;place-items:center;border-radius:50%;background:#4e665b;color:#f4f4f4;font-size:calc(12px * var(--ui-scale, 1));font-weight:700}.rail-spacer{flex:1}.rail-more{font-size:calc(14px * var(--ui-scale, 1));letter-spacing:2px}.rail-unread{position:absolute;top:0;right:-3px;min-width:17px;height:17px;padding:0 4px;display:grid;place-items:center;border:2px solid #1e1f21;border-radius:10px;background:#f04c4c;color:#fff;font-size:calc(8px * var(--ui-scale, 1));font-style:normal}.sidebar{background:#292a2c;border-right:1px solid #414244}.sidebar-header{height:47px;min-height:47px;padding:0 12px;border-bottom:1px solid #3d3e40}.brand-mark.small{width:29px;height:29px;border-radius:9px;font-size:calc(14px * var(--ui-scale, 1))}.brand-lockup{gap:8px}.brand-lockup strong{color:#f0f0f0;font-size:calc(12px * var(--ui-scale, 1))}.brand-lockup span{color:#a0a2a3;font-size:calc(9px * var(--ui-scale, 1))}.sidebar-tabs{height:42px;display:flex;align-items:stretch;padding:0 11px;border-bottom:1px solid #3d3e40}.sidebar-tabs>button{position:relative;padding:0 12px;border:0;background:transparent;color:#a8aaab;font-size:calc(12px * var(--ui-scale, 1))}.sidebar-tabs>button.active{color:#f1f1f1;font-weight:600}.sidebar-tabs>button.active:after{position:absolute;right:12px;bottom:0;left:12px;height:2px;background:#f5f5f5;content:''}.sidebar-tabs .sidebar-filter{margin-left:auto;padding:0 8px;font-size:calc(17px * var(--ui-scale, 1))}.sidebar-tabs .sidebar-filter.active{color:#72d896}.profile-row{padding:12px 14px 8px}.profile-copy strong{color:#f1f1f1}.profile-copy span{color:#a2a4a5}.role-badge{background:#294a39;color:#8de1a7}.search-wrap{height:36px;margin:0 9px 9px;border-color:#404143;background:#3b3c3e;color:#b9bbbc}.search-wrap input{color:#f2f2f2}.search-wrap input::placeholder{color:#a7a8a9}.sidebar-actions{gap:5px;padding:0 9px 10px}.soft-button{min-height:30px;padding:0 8px;border-color:#46524a;background:#303b34;color:#91d6a5;font-size:calc(10px * var(--ui-scale, 1))}.soft-button:hover{background:#39483e}.section-heading{padding:9px 13px;border-top-color:#3c3d3f;color:#a1a3a4}.count-pill{background:#3c3d3f;color:#c1c2c3}.conversation-list{padding:4px 5px}.conversation-item{padding:9px 8px;color:#ededed}.conversation-item:hover{background:#343537}.conversation-item.selected{background:#3a3b3d}.conversation-avatar{background:#414345;color:#d0d2d3}.conversation-title{color:#f0f0f0}.conversation-time,.preview-text{color:#a6a8a9}.unread-badge{background:#06c755;color:#102015}.sidebar-footer{border-top-color:#3e3f41;color:#a2a4a5}.online-dot{background:#06c755}.chat-panel{background:#2c2d2f}.empty-state{background:#2c2d2f}.empty-art{background:linear-gradient(145deg,#333639,#303237);color:#7be397}.empty-state h2{color:#f1f1f1}.empty-state p{color:#a5a6a7}.chat-header{height:58px;padding:0 18px;border-bottom:1px solid #414244;background:#2c2d2f}.chat-avatar{background:#3d4541;color:#a9e6bc}.chat-heading h2{color:#f0f0f0}.chat-heading span{color:#a5a7a8}.chat-tools .icon-button{color:#c4c5c6}.chat-tools .icon-button:hover{background:#404143}.message-list{background:#2c2d2f}.date-divider{width:max-content;margin:5px auto 20px;padding:5px 11px;border-radius:14px;background:#262729;color:#b2b3b4}.message-avatar{background:#414345;color:#d7d8d9}.sender-name{color:#b3b5b6}.bubble{border-color:#414244;background:#3a3b3d;color:#ededed;box-shadow:none}.mine .bubble{border-color:#06c755;background:#06c755;color:#102015}.message-meta{color:#a3a5a6}.composer{position:relative;display:block;padding:12px 19px 14px;border-top:1px solid #414244;background:#2c2d2f}.composer textarea{display:block;width:100%;min-height:38px;max-height:110px;padding:8px 3px;border:0;border-radius:0;background:transparent;color:#eee;font-size:calc(12px * var(--ui-scale, 1))}.composer textarea::placeholder{color:#a0a2a3}.composer textarea:focus{border:0;box-shadow:none}.send-button{position:absolute;right:15px;bottom:13px;width:36px;height:34px;background:transparent;color:#aeb0b1}.send-button:hover{background:#3b3c3e;color:#fff}.icon-button{color:#c3c5c6}.search-results{border-color:#464749;background:#303133;box-shadow:0 14px 35px #0006}.search-result{background:#303133;color:#eee}.search-result:hover{background:#3c3d3f}.search-result small{color:#aaa}.empty-list{color:#a3a5a6}.modal-layer{background:#08090a9c}.toast{background:#3b3c3e;color:#f5f5f5}
@media(max-width:760px){.app-shell{display:block}.icon-rail{display:none}.sidebar-header{height:48px}.chat-header{height:58px}.composer{padding-bottom:calc(12px + env(safe-area-inset-bottom))}}
@media(min-width:761px){.sidebar-header{height:0;min-height:0;padding:0;border:0;overflow:hidden}.profile-row{display:none}.sidebar-tabs{height:46px}}
@media(max-width:760px){.sidebar-header{height:48px;min-height:48px;padding:0 12px;border-bottom:1px solid #3d3e40}.profile-row{display:flex}}
.note-compose-toolbar[hidden]{display:none}.note-image-item{width:132px;height:88px}.note-image-item img,.note-image-item video{width:100%;height:100%;object-fit:cover;border:1px solid #e2e8e4;border-radius:7px;background:#111}
.rail-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
/* User-adjustable themes, color schemes and page scale */
:root{--ui-scale:1}
:root[data-color-scheme="green"]{--green:#06c755;--green-dark:#05ae4b}
:root[data-color-scheme="blue"]{--green:#3985e8;--green-dark:#286fc9}
:root[data-color-scheme="purple"]{--green:#8b63dc;--green-dark:#724bc3}
:root[data-color-scheme="orange"]{--green:#e9943b;--green-dark:#cf7825}
:root[data-color-scheme="rose"]{--green:#e66b87;--green-dark:#cc526e}
:root[data-color-scheme="custom"]{--green:var(--custom-accent,#06c755);--green-dark:var(--custom-accent-dark,#05ae4b)}
body{width:100vw;min-height:100dvh}.app-shell{height:100dvh}.login-shell{min-height:100dvh}
:root[data-color-scheme] .mine .bubble{border-color:var(--green);background:var(--green)}
:root[data-color-scheme] .send-button{color:var(--green)}:root[data-color-scheme] .send-button:hover{color:var(--green-dark)}
:root[data-color-scheme] .online-dot{background:var(--green)}:root[data-color-scheme] .unread-badge{background:var(--green)}
:root[data-color-scheme] .notes-fab{background:var(--green)}
:root[data-theme="light"] body{background:#f3f5f4;color:#17221f}
:root[data-theme="light"] .app-shell{background:#fff}
:root[data-theme="light"] .icon-rail{background:#f0f2f1;border-color:#e1e6e3}
:root[data-theme="light"] .rail-button{color:#7c8781}:root[data-theme="light"] .rail-button:hover{background:#e4eae7;color:#29342e}:root[data-theme="light"] .rail-button.active{background:#dce6e1;color:#26342d}
:root[data-theme="light"] .sidebar{background:#fff;border-color:#e4e9e6}
:root[data-theme="light"] .sidebar-header,:root[data-theme="light"] .sidebar-tabs{border-color:#edf0ee}
:root[data-theme="light"] .brand-lockup strong,:root[data-theme="light"] .profile-copy strong,:root[data-theme="light"] .conversation-title,:root[data-theme="light"] .chat-heading h2{color:#17221f}
:root[data-theme="light"] .brand-lockup span,:root[data-theme="light"] .profile-copy span,:root[data-theme="light"] .conversation-time,:root[data-theme="light"] .preview-text,:root[data-theme="light"] .chat-heading span{color:#87928c}
:root[data-theme="light"] .sidebar-tabs>button{color:#7f8984}:root[data-theme="light"] .sidebar-tabs>button.active{color:#202a25}:root[data-theme="light"] .sidebar-tabs>button.active:after{background:#202a25}
:root[data-theme="light"] .search-wrap{border-color:#e5ebe7;background:#f7f9f8;color:#7d8882}:root[data-theme="light"] .search-wrap input{color:#17221f}:root[data-theme="light"] .search-wrap input::placeholder{color:#99a39d}
:root[data-theme="light"] .soft-button{border-color:#dceee6;background:#f1faf6;color:var(--green-dark)}:root[data-theme="light"] .soft-button:hover{background:#e6f6ef}
:root[data-theme="light"] .section-heading{border-color:#f0f3f1;color:#87928c}:root[data-theme="light"] .count-pill{background:#f0f3f1;color:#68756f}
:root[data-theme="light"] .conversation-item{color:#17221f}:root[data-theme="light"] .conversation-item:hover{background:#f7f9f8}:root[data-theme="light"] .conversation-item.selected{background:#eff8f4}:root[data-theme="light"] .conversation-avatar{background:#e2f4ed;color:var(--green-dark)}
:root[data-theme="light"] .unread-badge{color:#fff}:root[data-theme="light"] .sidebar-footer{border-color:#edf0ee;color:#9aa49f}
:root[data-theme="light"] .chat-panel,:root[data-theme="light"] .empty-state,:root[data-theme="light"] .message-list{background:#fbfcfb}
:root[data-theme="light"] .empty-state h2{color:#17221f}:root[data-theme="light"] .empty-state p{color:#8c9791}
:root[data-theme="light"] .chat-header{border-color:#edf0ee;background:#fff}:root[data-theme="light"] .chat-avatar{background:#e2f4ed;color:var(--green-dark)}:root[data-theme="light"] .chat-tools .icon-button{color:#65716c}:root[data-theme="light"] .chat-tools .icon-button:hover{background:#edf2ef}
:root[data-theme="light"] .date-divider{background:#f1f3f2;color:#87928c}:root[data-theme="light"] .message-avatar{background:#e8efec;color:#6d8178}:root[data-theme="light"] .sender-name{color:#87948d}
:root[data-theme="light"] .bubble{border-color:#edf1ee;background:#fff;color:#25332d;box-shadow:0 3px 10px #1c39250a}:root[data-theme="light"] .mine .bubble{color:#102015}
:root[data-theme="light"] .message-meta{color:#a0aaa5}:root[data-theme="light"] .composer{border-color:#edf0ee;background:#fff}:root[data-theme="light"] .composer textarea{background:transparent;color:#17221f}:root[data-theme="light"] .composer textarea::placeholder{color:#9aa49f}
:root[data-theme="light"] .chat-more-menu{border-color:#e6ebe8;background:#fff;box-shadow:0 10px 28px #13261c22}:root[data-theme="light"] .chat-more-menu button{color:#34413b}:root[data-theme="light"] .chat-more-menu button:hover{background:#f3f7f5}:root[data-theme="light"] .chat-more-menu .menu-divider{background:#edf0ee}
:root[data-theme="light"] .search-results{border-color:#e7eeea;background:#fff;box-shadow:0 16px 35px #193f2915}:root[data-theme="light"] .search-result{background:#fff;color:#17221f}:root[data-theme="light"] .search-result:hover{background:#f1f8f4}:root[data-theme="light"] .search-result small{color:#96a19b}
:root[data-theme="light"] .modal-layer{background:#16231f66}:root[data-theme="light"] .toast{background:#20322a;color:#fff}
:root[data-theme="light"] .notes-modal .modal-card{border-color:#e8eeeb;background:#fff;color:#17221f}:root[data-theme="light"] .notes-modal .modal-header,:root[data-theme="light"] .notes-modal .modal-body{background:#fff}:root[data-theme="light"] .notes-modal .modal-header h2{color:#17221f}:root[data-theme="light"] .notes-tabs{border-color:#e7ece9}:root[data-theme="light"] .notes-tabs button{color:#7e8983}:root[data-theme="light"] .notes-tabs button.active{color:#17221f}:root[data-theme="light"] .notes-tabs button.active:after{background:#17221f}:root[data-theme="light"] .notes-search{background:#f1f4f2;color:#7e8983}:root[data-theme="light"] .notes-search input{color:#17221f}:root[data-theme="light"] .notes-search input::placeholder{color:#9aa49f}:root[data-theme="light"] .shared-note-card{background:#f4f6f5;color:#17221f}:root[data-theme="light"] .shared-note-main span{color:#55615b}:root[data-theme="light"] .shared-note-main small{color:#8c9791}:root[data-theme="light"] .note-card-menu{color:#65716c}:root[data-theme="light"] .note-card-menu:hover{background:#e8eeeb}:root[data-theme="light"] .note-card-actions{border-color:#e2e8e4;background:#fff;box-shadow:0 8px 18px #17271d20}:root[data-theme="light"] .note-card-actions button{color:#34413b}:root[data-theme="light"] .note-card-actions button:hover{background:#f1f5f3}:root[data-theme="light"] .notes-empty{color:#8c9791}:root[data-theme="light"] .notes-search{background:#f1f4f2}
.appearance-modal .modal-card{width:min(440px,94vw);background:#fff;color:#17221f}.appearance-modal .modal-header{background:#fff;border-color:#edf0ee}.appearance-modal .modal-header h2{color:#17221f}.appearance-settings{display:grid;gap:22px}.appearance-settings section{display:grid;gap:10px}.appearance-settings h3{display:flex;justify-content:space-between;margin:0;color:#65716c;font-size:calc(12px * var(--ui-scale, 1))}.appearance-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}.appearance-options button{height:40px;border:1px solid #e2e8e4;border-radius:9px;background:#fff;color:#45534b}.appearance-options button.selected{border-color:var(--green);background:color-mix(in srgb,var(--green) 9%,white);color:var(--green-dark)}.color-options{display:flex;flex-wrap:wrap;gap:9px}.color-options button{display:grid;justify-items:center;gap:5px;min-width:58px;padding:7px 5px;border:1px solid transparent;border-radius:9px;background:transparent;color:#67736d;font-size:calc(10px * var(--ui-scale, 1))}.color-options button.selected{border-color:#dce5df;background:#f7f9f8}.color-options i{width:24px;height:24px;border-radius:50%;background:var(--swatch);box-shadow:0 2px 5px #0002}.font-scale-range{width:100%;accent-color:var(--green)}.range-labels{display:flex;justify-content:space-between;color:#929d97;font-size:calc(10px * var(--ui-scale, 1))}.appearance-hint{margin:0;color:#9aa49f;font-size:calc(10px * var(--ui-scale, 1))}
:root[data-theme="dark"] .appearance-modal .modal-card{border-color:#424345;background:#2e2f31;color:#eee}:root[data-theme="dark"] .appearance-modal .modal-header{border-color:#424345;background:#2e2f31}:root[data-theme="dark"] .appearance-modal .modal-header h2,:root[data-theme="dark"] .appearance-settings h3{color:#eee}:root[data-theme="dark"] .appearance-options button{border-color:#4b4c4e;background:#37383a;color:#ddd}:root[data-theme="dark"] .appearance-options button.selected{border-color:var(--green);background:#343f38;color:#b8ecc5}:root[data-theme="dark"] .color-options button{color:#c2c4c5}:root[data-theme="dark"] .color-options button.selected{border-color:#555;background:#38393b}:root[data-theme="dark"] .appearance-hint,:root[data-theme="dark"] .range-labels{color:#a4a6a7}
:root[data-theme="dark"] .login-shell{background:radial-gradient(circle at 15% 20%,#273d33 0,transparent 34%),radial-gradient(circle at 90% 84%,#30303d 0,transparent 31%),#202123}:root[data-theme="dark"] .login-card{border-color:#414244;background:#2d2e30;color:#eee}:root[data-theme="dark"] .login-card .muted,:root[data-theme="dark"] .login-help{color:#a2a4a5}:root[data-theme="dark"] .stack-form label{color:#c2c4c5}:root[data-theme="dark"] .stack-form input{border-color:#4a4b4d;background:#363739;color:#eee}
@media(max-width:760px){.app-shell{height:100dvh}.active-chat{height:100dvh}}

/* LINE-like screenshot composition overlay */
.line-capture-editor{position:fixed;inset:0;width:100vw;height:100dvh;z-index:10000;display:grid;grid-template-rows:clamp(40px,6dvh,52px) minmax(0,1fr) clamp(42px,6dvh,52px) clamp(44px,7dvh,58px);overflow:hidden;background:#292a2c;color:#f2f2f2;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);font-size:calc(14px * var(--ui-scale, 1))}
.capture-caption{width:100%;min-height:0;padding:.625em 1em;border:0;outline:0;resize:none;background:#292a2c;color:#f2f2f2;font-size:.8125em;line-height:1.4}
.capture-caption::placeholder{color:#aeb0b1}
.capture-stage{position:relative;min-height:0;width:100%;display:grid;place-items:center;overflow:hidden;padding:clamp(4px,1.5dvh,12px) clamp(4px,2vw,16px);touch-action:none}
.capture-source-image{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none;pointer-events:none}
.capture-selection{position:absolute;z-index:1;border:1px solid #fff;box-shadow:0 0 0 9999px #0008;pointer-events:none}
.capture-stage.cropping{cursor:crosshair}
.capture-toolbar{position:relative;min-width:0;display:flex;align-items:center;gap:5px;padding:4px 14px;background:#292a2c}
.capture-tool{flex:0 0 clamp(32px,1.8em,48px);width:clamp(32px,1.8em,48px);height:clamp(32px,1.8em,48px);display:grid;place-items:center;position:relative;border:0;border-radius:5px;background:transparent;color:#c8cacc;font-size:1.1875em}
.capture-tool:hover,.capture-tool.active{background:#414244;color:#fff}
.capture-tool svg{width:1em;height:1em;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.capture-crop-button span{position:absolute;right:0;bottom:0;font-size:.625em}
.capture-hint{flex:1;min-width:0;margin-left:6px;overflow:hidden;color:#929496;font-size:.625em;text-overflow:ellipsis;white-space:nowrap}
.capture-emoji-tray{position:absolute;z-index:3;left:12px;bottom:calc(100% - 2px);display:flex;gap:3px;max-width:calc(100vw - 24px);overflow-x:auto;padding:6px;border:1px solid #4b4c4e;border-radius:7px;background:#38393b;box-shadow:0 8px 22px #0006}
.capture-emoji-tray button{flex:0 0 clamp(28px,1.875em,40px);width:clamp(28px,1.875em,40px);height:clamp(28px,1.875em,40px);border:0;border-radius:5px;background:transparent;color:#fff;font-size:1.125em}
.capture-emoji-tray button:hover{background:#4a4b4d}
.capture-actions{display:flex;align-items:center;justify-content:center;gap:8px;padding:0 12px 6px;background:#292a2c}
.capture-actions button{min-width:3.875em;height:2.125em;padding:0 1em;border:0;border-radius:5px;color:#fff;font-size:.75em}
.capture-paste-button{background:#32864f}
.capture-paste-button:hover{background:#3b9a5d}
.capture-cancel-button{background:#555659}
.capture-cancel-button:hover{background:#66676a}
@media(max-width:520px){.capture-toolbar{padding-inline:8px;gap:3px}.capture-hint{font-size:.5625em}.capture-actions button{min-width:3.625em}}
@media(max-height:520px){.line-capture-editor{grid-template-rows:38px minmax(0,1fr) 40px 44px}.capture-caption{padding-block:6px}.capture-stage{padding-block:3px}.capture-actions button{height:32px}}

/* Area selection and floating screenshot annotation toolbar */
.line-capture-editor{display:block;background:#858987;font-size:calc(16px * var(--ui-scale, 1))}
.capture-stage{position:absolute;inset:0;padding:0;display:grid;place-items:center;overflow:hidden;cursor:crosshair}
.capture-source-image{max-width:100vw;max-height:100dvh;width:auto;height:auto;object-fit:contain}
.capture-stage:not(.capture-selecting){cursor:default}
.capture-stage.capture-selecting{cursor:crosshair}
.capture-ink{position:absolute;z-index:1;pointer-events:none}
.capture-selection{z-index:2;border:2px solid #3478f6;box-shadow:0 0 0 9999px #0002;pointer-events:none}
.capture-toolbar{position:absolute;z-index:4;min-width:0;display:flex;align-items:center;gap:2px;padding:4px;background:#f5f6f8;color:#303642;border:1px solid #747981;box-shadow:0 2px 8px #0003}
.capture-toolbar.hidden,.capture-brush-menu.hidden{display:none}
.capture-tool{flex:0 0 clamp(30px,1.8em,42px);width:clamp(30px,1.8em,42px);height:clamp(30px,1.8em,42px);border-radius:3px;color:#3c424d;font-size:1.125em}
.capture-tool:hover,.capture-tool.active{background:#e1e5ec;color:#1d4fba}
.capture-confirm{color:#00a83b!important;font-size:1.35em;font-weight:700}
.capture-brush-menu{position:absolute;right:calc(100% + 5px);top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:2px;padding:4px;background:#f5f6f8;border:1px solid #747981;box-shadow:0 2px 8px #0003;white-space:nowrap}
.capture-brush-menu button{width:32px;height:32px;border:0;border-radius:3px;background:transparent;color:#3c424d;font-size:calc(18px * var(--ui-scale, 1))}
.capture-brush-menu button:hover,.capture-brush-menu button.active{background:#e1e5ec;color:#1d4fba}
.capture-brush-menu i{height:24px;border-left:1px solid #c7cbd1;margin:0 3px}
.capture-help{position:absolute;left:50%;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%);padding:5px 10px;border-radius:14px;background:#25282bcc;color:#f3f4f5;font-size:.6875em;white-space:nowrap;pointer-events:none}
@media(max-width:620px){.capture-toolbar{gap:0;padding:2px}.capture-tool{flex-basis:30px;width:30px;height:32px}.capture-brush-menu{right:auto;left:0;top:auto;bottom:calc(100% + 5px);transform:none}.capture-brush-menu button{width:28px;height:30px}}

/* Dark, compact note composer inspired by the supplied LINE capture */
.note-editor-modal .modal-card{width:min(720px,calc(100vw - 28px));height:min(650px,90dvh);min-height:min(420px,90dvh);max-height:90dvh;border-color:#3d3e40;border-radius:10px;background:#292a2c;color:#eceeef}
.note-editor-modal .modal-header{min-height:48px;padding:0 16px;border-bottom-color:#3e3f41;background:#292a2c}
.note-editor-modal .modal-header h2{color:#eceeef;font-size:calc(13px * var(--ui-scale, 1))}
.note-editor-modal .modal-header .icon-button{color:#c3c5c6}
.note-editor-modal .modal-body{padding:0;background:#292a2c}
.note-editor-modal .shared-note-editor{gap:0;padding:0}
.note-editor-modal .note-share-hint{display:none}
.note-editor-modal .note-editor{flex:1;min-height:125px;padding:14px 17px;border:0;border-radius:0;background:#292a2c;color:#f1f2f3;font-size:calc(13px * var(--ui-scale, 1));line-height:1.55;resize:none}
.note-editor-modal .note-editor::placeholder{color:#818385}
.note-editor-modal .note-editor:focus{border:0;box-shadow:none}
.note-editor-modal .note-image-preview{max-height:100px;padding:4px 14px 8px;background:#292a2c}
.note-compose-toolbar{min-height:46px;padding:0 12px 5px;gap:2px;background:#292a2c}
.note-compose-toolbar>button{width:30px;height:32px;border-radius:4px;color:#c4c6c8;font-size:calc(19px * var(--ui-scale, 1))}
.note-compose-toolbar>button:hover,.note-compose-toolbar>button.active{background:#3b3c3e;color:#fff}
.note-compose-toolbar>button#noteEmojiButton{margin-left:auto}
.note-compose-toolbar svg{width:19px;height:19px;stroke-width:1.65}
.note-capture-wrap{position:relative;display:flex;align-items:center;height:32px}
.note-capture-wrap>button{height:32px;display:grid;place-items:center;border:0;background:transparent;color:#c4c6c8}
.note-capture-wrap>button:first-child{width:30px;border-radius:4px 0 0 4px}
.note-capture-wrap>button:last-of-type{width:14px;margin-left:-2px;border-radius:0 4px 4px 0;font-size:calc(11px * var(--ui-scale, 1))}
.note-capture-wrap>button:hover{background:#3b3c3e;color:#fff}
.note-capture-menu{position:absolute;z-index:10;left:0;bottom:calc(100% + 7px);width:max-content;max-width:min(280px,calc(100vw - 40px));padding:11px 12px;border:1px solid #505154;border-radius:6px;background:#3a3b3d;color:#ededee;box-shadow:0 8px 24px #0007;font-size:calc(12px * var(--ui-scale, 1))}
.note-capture-menu label{display:flex;align-items:center;gap:9px;cursor:pointer}
.note-capture-menu input{position:absolute;width:1px;height:1px;opacity:0}
.toggle-track{position:relative;width:28px;height:16px;flex:none;border-radius:10px;background:#66686a;transition:background .15s}
.toggle-track:before{position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;content:'';transition:transform .15s}
.note-capture-menu input:checked+.toggle-track{background:#07c755}
.note-capture-menu input:checked+.toggle-track:before{transform:translateX(12px)}
.note-capture-menu small{display:block;margin:7px 0 0 37px;color:#b6b8b9;font-size:calc(10px * var(--ui-scale, 1));line-height:1.4}
.note-editor-modal .note-emoji-tray{bottom:41px;left:auto;right:10px;border-color:#505154;background:#3a3b3d}
.note-emoji-tray button{background:transparent;color:#fff}
.note-emoji-tray button:hover{background:#505154}
.note-editor-modal .note-editor-footer{min-height:23px;padding:0 14px;background:#292a2c;color:#a5a7a8}
.note-editor-modal .note-editor-actions{justify-content:flex-end;padding:5px 12px 10px;background:#292a2c}
.note-editor-modal .cancel-button{background:#3c3d3f;color:#d8d9da}
.note-editor-modal .note-editor-actions .primary-button{height:36px;border-radius:6px;box-shadow:none}
@media(max-width:520px){.note-editor-modal .modal-card{width:calc(100vw - 20px);height:min(90dvh,700px);min-height:min(360px,90dvh)}.note-editor-modal .modal-body{padding:0}.note-compose-toolbar{padding-inline:8px}}

/* User management follows the selected day/night appearance */
:root[data-theme="dark"] .admin-users-modal .modal-card,:root[data-theme="dark"] .admin-users-modal .modal-header,:root[data-theme="dark"] .admin-users-modal .modal-body{border-color:#424345;background:#2e2f31;color:#e8e9ea}
:root[data-theme="dark"] .admin-users-modal .modal-header h2{color:#f0f1f1}
:root[data-theme="dark"] .admin-users-modal .modal-form label,:root[data-theme="dark"] .admin-users-modal .field-label{color:#c5c7c8}
:root[data-theme="dark"] .admin-users-modal .modal-input,:root[data-theme="dark"] .admin-users-modal .modal-form input,:root[data-theme="dark"] .admin-users-modal .modal-form select{border-color:#4b4c4e;background:#393a3c;color:#ededee}
:root[data-theme="dark"] .admin-users-modal .modal-input,:root[data-theme="dark"] .admin-users-modal select{color-scheme:dark}
:root[data-theme="dark"] .admin-users-modal .modal-input::placeholder{color:#929496}
:root[data-theme="dark"] .admin-users-modal .form-hint,:root[data-theme="dark"] .admin-users-modal .user-row-main small{color:#a7a9aa}
:root[data-theme="dark"] .admin-users-modal .user-row{border-color:#454648}
:root[data-theme="dark"] .admin-users-modal .user-actions .text-button{color:#ff8181}
.delete-user-button{color:#c43d3d!important}
:root[data-theme="dark"] .delete-user-button{color:#ff7777!important}
:root[data-theme="dark"] .rail-profile span img,:root[data-theme="dark"] .profile-row .avatar img{width:100%;height:100%;border-radius:inherit;object-fit:cover}
.profile-settings-modal .modal-card{width:min(520px,calc(100vw - 28px));max-height:90dvh}
.profile-settings-form{display:grid;gap:14px}
.profile-cover-preview{position:relative;height:150px;display:grid;place-items:center;overflow:hidden;border-radius:10px;background:#e7ebe8;color:#65716c}
.profile-cover-preview>img{position:absolute;width:100%;height:100%;object-fit:cover}
.cover-picker{position:absolute;right:10px;bottom:10px;z-index:1;padding:7px 10px;border-radius:7px;background:#18211dcc;color:#fff;font-size:calc(11px * var(--ui-scale, 1));cursor:pointer}
.profile-avatar-setting{position:relative;width:76px;height:76px;margin-top:-48px;margin-left:16px;border:3px solid var(--surface,#fff);border-radius:50%;background:#dce8e1;display:grid;place-items:center;overflow:visible;color:#16865f;font-size:calc(25px * var(--ui-scale, 1));font-weight:700;z-index:2}
.profile-avatar-setting img,.rail-profile img,.profile-row .avatar img{width:100%;height:100%;border-radius:inherit;object-fit:cover}
.profile-avatar-setting img{border-radius:50%}
.avatar-picker{position:absolute;right:-12px;bottom:0;padding:5px 7px;border-radius:7px;background:#303638;color:#fff;font-size:calc(10px * var(--ui-scale, 1));white-space:nowrap;cursor:pointer}
.profile-image-clear{position:absolute;z-index:2;padding:5px 7px;border:0;border-radius:6px;background:#202322d9;color:#fff;font-size:calc(10px * var(--ui-scale, 1));cursor:pointer}
.profile-image-clear[hidden]{display:none}
.cover-clear{right:10px;bottom:10px;transform:translateX(-98px)}
.avatar-clear{right:-15px;top:-8px}
.profile-settings-form>label{display:grid;gap:7px;color:#637068;font-size:calc(12px * var(--ui-scale, 1));font-weight:600}
.profile-account-readonly{padding:10px 12px;border-radius:8px;background:#f1f4f2;color:#78837d;font-size:calc(11px * var(--ui-scale, 1))}
.profile-password-fields{display:grid;gap:10px;padding-top:10px;border-top:1px solid #e6ebe8}
.profile-password-fields summary{margin-bottom:8px;color:var(--green-dark);font-size:calc(12px * var(--ui-scale, 1));font-weight:700;cursor:pointer}
.profile-password-fields label{display:grid;gap:6px;color:#637068;font-size:calc(11px * var(--ui-scale, 1))}
.profile-password-fields small{color:#8a958e;font-weight:400}
.profile-form-actions{display:flex;justify-content:flex-end;padding-top:4px}
.profile-form-actions .primary-button{height:40px;padding:0 18px}
.profile-form-actions{justify-content:space-between;align-items:center;gap:12px}
.profile-logout-button{min-height:40px;padding:0 18px;border:1px solid #e3caca;border-radius:10px;background:transparent;color:#c43d3d;font-weight:700}
.profile-logout-button:hover{background:#fff1f1}
:root[data-theme="dark"] .profile-logout-button{border-color:#654343;color:#ff8d8d}
:root[data-theme="dark"] .profile-logout-button:hover{background:#482e30}
.member-profile-modal .modal-card{width:min(360px,calc(100vw - 30px));max-height:80dvh}
.member-profile-cover{height:150px;overflow:hidden;border-radius:9px;background:#383a3c}
.member-profile-cover img{width:100%;height:100%;object-fit:cover}
.member-profile-avatar{width:76px;height:76px;margin:-38px 0 0 18px;position:relative;display:grid;place-items:center;overflow:hidden;border:3px solid #fff;border-radius:50%;background:#dce8e1;color:#16865f;font-size:calc(24px * var(--ui-scale, 1));font-weight:700}
.member-profile-avatar img{width:100%;height:100%;object-fit:cover}
.member-profile-card h3{margin:12px 18px 4px;font-size:calc(17px * var(--ui-scale, 1))}
.member-profile-status{margin:0 18px 18px;color:#77827c;font-size:calc(12px * var(--ui-scale, 1));white-space:pre-wrap;overflow-wrap:anywhere}
.profile-message-avatar{align-self:flex-start;padding:0;border:0;border-radius:50%;background:transparent}
.profile-message-avatar:hover{filter:brightness(1.12)}
.image-crop-overlay{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:15px;background:#000a}
.image-crop-dialog{width:min(680px,calc(100vw - 30px));max-height:calc(100dvh - 30px);overflow:auto;padding:20px;border:1px solid #e2e8e4;border-radius:14px;background:#fff;color:#26312b;box-shadow:0 18px 60px #0005}
.image-crop-dialog h3{margin:0 0 14px;font-size:calc(16px * var(--ui-scale, 1))}
.image-crop-canvas{display:block;width:100%;height:auto;aspect-ratio:12/5;overflow:hidden;border:1px solid #9aa59e;border-radius:8px;background:#d6d9d7;cursor:grab;touch-action:none}
.image-crop-canvas:active{cursor:grabbing}
.image-crop-canvas.avatar-crop-canvas{width:min(100%,420px);margin-inline:auto;aspect-ratio:1;border-radius:50%}
.crop-zoom-label{display:flex;align-items:center;gap:12px;margin-top:14px;font-size:calc(12px * var(--ui-scale, 1))}
.crop-zoom{flex:1;accent-color:var(--green)}
.image-crop-dialog p{margin:10px 0;color:#7d8982;font-size:calc(11px * var(--ui-scale, 1))}
.image-crop-dialog footer{display:flex;justify-content:flex-end;gap:8px;margin-top:15px}
.image-crop-dialog footer button{min-height:36px;padding:0 14px;border:0;border-radius:7px;background:#eff3f1;color:#34413b;cursor:pointer}
.image-crop-dialog footer .crop-confirm{background:var(--green);color:white;font-weight:700}
.profile-cover-preview{height:auto;aspect-ratio:12/5}
:root[data-theme="dark"] .image-crop-dialog{border-color:#454749;background:#2e2f31;color:#e8e9ea}
:root[data-theme="dark"] .image-crop-dialog p{color:#a7aaab}
:root[data-theme="dark"] .image-crop-dialog footer button:not(.crop-confirm){background:#414244;color:#e8e9ea}
.profile-name-button{padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
.profile-name-button:hover{text-decoration:underline}
:root[data-theme="dark"] .profile-settings-modal .modal-card,:root[data-theme="dark"] .profile-settings-modal .modal-header,:root[data-theme="dark"] .profile-settings-modal .modal-body,:root[data-theme="dark"] .member-profile-modal .modal-card,:root[data-theme="dark"] .member-profile-modal .modal-header,:root[data-theme="dark"] .member-profile-modal .modal-body{border-color:#424345;background:#2e2f31;color:#e8e9ea}
:root[data-theme="dark"] .profile-settings-modal .modal-header h2,:root[data-theme="dark"] .member-profile-modal .modal-header h2{color:#f0f1f1}
:root[data-theme="dark"] .profile-settings-form>label,:root[data-theme="dark"] .profile-password-fields label{color:#c5c7c8}
:root[data-theme="dark"] .profile-settings-modal .modal-input{border-color:#4b4c4e;background:#393a3c;color:#ededee}
:root[data-theme="dark"] .profile-account-readonly{background:#393a3c;color:#b4b6b7}
:root[data-theme="dark"] .profile-password-fields{border-color:#4b4c4e}
:root[data-theme="dark"] .profile-password-fields summary{color:#8ce1aa}
:root[data-theme="dark"] .profile-password-fields small,:root[data-theme="dark"] .member-profile-status{color:#a7a9aa}
:root[data-theme="dark"] .profile-cover-preview{background:#3a3b3d;color:#b7b9ba}
:root[data-theme="dark"] .member-profile-avatar{border-color:#2e2f31;background:#3f4943;color:#a5e2b8}
@media(max-width:520px){.profile-settings-modal .modal-card{width:calc(100vw - 20px);max-height:92dvh}.profile-cover-preview{height:125px}}

/* Keep the chat canvas flush with the viewport at every UI scale. */
html,body{width:100%;height:100%;overflow:hidden}
body{min-height:100dvh}
#appView.app-shell{width:100vw;height:100dvh;min-height:0;max-width:none;margin:0}
#loginView{width:100vw;min-height:100dvh}
.capture-ink-preview{position:absolute;z-index:3;pointer-events:none}
.capture-text-input{position:absolute;z-index:3;min-width:140px;max-width:min(50vw,520px);height:auto;padding:3px 5px;border:1px dashed #ff5263;border-radius:3px;outline:0;background:#1d1e1d66;color:#ff4055;font-family:sans-serif;font-weight:600}
.capture-text-input::placeholder{color:#ff9aa5}
.capture-size-control{display:flex;align-items:center;gap:6px;padding:0 7px;color:#515760;font-size:calc(11px * var(--ui-scale, 1));white-space:nowrap}
.capture-size-slider{width:clamp(72px,9vw,120px);height:18px;accent-color:#3478f6}
.capture-size-control output{min-width:18px;text-align:right;font-variant-numeric:tabular-nums}
.capture-brush-menu{max-width:calc(100vw - 12px);overflow-x:auto}
.capture-draw-frame{position:absolute;z-index:4;border:1px dashed #3478f6;pointer-events:none}
@media(max-width:620px){.capture-brush-menu{max-width:calc(100vw - 12px);overflow-x:auto}.capture-size-slider{width:68px}.capture-size-control{padding-inline:4px}}
.chat-tools{flex:none;gap:5px}
.chat-tools .icon-button{flex:0 0 36px;width:36px;height:36px;padding:0}
#manageGroupButton svg{width:18px;height:18px}
:root{text-rendering:auto}
.confirm-modal{z-index:1000}
.confirm-modal .modal-card{width:min(440px,calc(100vw - 32px));max-height:none;border-radius:16px;box-shadow:0 24px 90px #0007}
.confirm-modal .modal-header{min-height:58px}
.confirm-dialog p{margin:4px 0 24px;line-height:1.65;color:var(--ink)}
.confirm-dialog footer{display:flex;justify-content:flex-end;gap:10px}
.confirm-dialog footer .primary-button{min-width:84px}
.confirm-modal{padding:16px}
.confirm-modal .modal-card{width:min(440px,calc(100vw - 32px));height:auto!important;min-height:0!important;max-height:calc(100dvh - 32px)!important;flex:0 1 auto;border-radius:16px}
.confirm-modal .modal-header{flex:none;min-height:56px;justify-content:space-between;gap:12px;padding:12px 18px}
.confirm-modal .modal-header h2{flex:1;min-width:0;text-align:left;font-size:clamp(15px,calc(16px * var(--ui-scale,1)),22px);line-height:1.35;overflow-wrap:anywhere}
.confirm-modal .modal-body{flex:0 1 auto!important;min-height:0!important;overflow:auto;padding:0!important}
.confirm-dialog{display:grid;gap:16px;padding:18px 20px 20px}
.confirm-dialog p{margin:0;text-align:left;font-size:calc(13px * var(--ui-scale,1));line-height:1.6;overflow-wrap:anywhere;color:var(--dialog-text)}
.confirm-dialog footer{flex-wrap:wrap;gap:9px}
.confirm-dialog footer button{min-height:40px;padding-inline:16px}
@media(max-width:520px){.confirm-modal{padding:12px}.confirm-modal .modal-card{width:calc(100vw - 24px);max-height:calc(100dvh - 24px)!important}.confirm-dialog{gap:14px;padding:16px}.confirm-modal .modal-header{min-height:52px;padding:10px 16px}}
.announcement-bar{z-index:2;display:flex;align-items:center;gap:8px;min-height:42px;padding:4px 18px;border-bottom:1px solid #414244;background:#303133;color:#e7e8e8}
.announcement-bar.hidden{display:none}
.announcement-bar>button:first-child{min-width:0;flex:1;display:flex;align-items:center;gap:8px;overflow:hidden;border:0;background:transparent;color:inherit;text-align:left;font-size:calc(12px * var(--ui-scale, 1))}
.announcement-bar strong{flex:none;color:#8ce1aa}
#announcementText{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#c9cbcc}
.announcement-unpin{width:28px;height:28px;flex:none;border:0;border-radius:6px;background:transparent;color:#b7b9ba;font-size:20px}
.announcement-unpin:hover{background:#444649}
:root[data-theme="light"] .announcement-bar{border-color:var(--line);background:#f1faf6;color:#26332d}
:root[data-theme="light"] #announcementText{color:#5f6d66}
.system-logs-modal .modal-card{width:min(760px,calc(100vw - 24px));max-height:88dvh}
.system-logs-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px;color:#a4a6a7;font-size:calc(11px * var(--ui-scale, 1))}
.system-logs-toolbar>div{display:flex;gap:6px;flex:none}
.system-logs-category{max-width:150px;min-height:32px;padding:5px 8px;border:1px solid #484a4c;border-radius:8px;background:#292a2b;color:var(--text);font:inherit}
.system-logs-list{max-height:68dvh;overflow:auto}
.system-logs-list pre{margin:0;padding:10px 12px;border-bottom:1px solid #414244;color:#dfe1e1;font:12px/1.55 Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
:root[data-theme="light"] .system-logs-toolbar{color:#68756f}
:root[data-theme="light"] .system-logs-list pre{border-color:#edf0ee;color:#34413b}
@media(max-width:760px){
  html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
  .sidebar-header{justify-content:space-between}
  .mobile-settings-button{display:grid;flex:0 0 36px;width:36px;height:36px;color:#c4c5c6}
  .sidebar-header .mobile-settings-button{color:#c4c5c6}
  .chat-tools .mobile-settings-button{display:grid}
  #appView.app-shell{position:fixed;inset:var(--app-viewport-top,0px) 0 auto;display:block;width:100vw;height:var(--app-viewport-height,100dvh);min-height:0;overflow:hidden}
  #appView .chat-panel{position:absolute;inset:0;height:100%;min-height:0;overflow:hidden}
  #appView .active-chat{height:100%;min-height:0;overflow:hidden}
  #appView .chat-header{flex:none}
  #appView .message-list{min-height:0;flex:1 1 0%;overscroll-behavior:contain}
  #appView .composer{flex:none;padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))}
  #appView .composer textarea{flex:none}
}
#manageGroupButton svg circle{fill:currentColor;stroke:none}
.composer{position:relative;display:flex;flex-direction:column;gap:5px;min-height:96px;padding:10px 18px 8px;border-top:1px solid #414244;background:#2c2d2f}
.mention-suggestions{position:absolute;z-index:12;left:18px;bottom:calc(100% - 3px);width:min(320px,calc(100% - 36px));max-height:min(42dvh,300px);overflow:hidden;padding:6px;border:1px solid #48494b;border-radius:10px;background:#333436;color:#f1f2f2;box-shadow:0 12px 30px #0005}
.mention-search-input{position:sticky;top:0;z-index:1;width:100%;height:34px;margin-bottom:5px;padding:0 9px;border:1px solid #505154;border-radius:7px;outline:none;background:#292a2c;color:inherit;font:inherit;font-size:calc(11px * var(--ui-scale,1))}
.mention-search-input:focus{border-color:var(--green)}
.mention-suggestion-list{max-height:calc(min(42dvh,300px) - 54px);overflow:auto;overscroll-behavior:contain}
.mention-no-results{padding:12px 8px;color:#aeb2b3;font-size:calc(11px * var(--ui-scale,1));text-align:center}
.chat-heading span.is-clickable{width:max-content;max-width:100%;padding:0;border:0;border-radius:3px;background:transparent;text-align:left;cursor:pointer}
.chat-heading span.is-clickable:hover{text-decoration:underline;text-underline-offset:2px}
.chat-heading span.is-clickable:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.group-member-list{max-height:min(62dvh,500px);overflow:auto;overscroll-behavior:contain}
.mention-suggestion{width:100%;display:flex;align-items:center;gap:9px;padding:7px;border:0;border-radius:7px;background:transparent;color:inherit;text-align:left}
.mention-suggestion:hover,.mention-suggestion.active{background:#454648}
.mention-suggestion-avatar{width:30px;height:30px;flex:none;border-radius:9px}
.mention-suggestion>span{min-width:0;display:grid;gap:2px}
.mention-suggestion strong,.mention-suggestion small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mention-suggestion small{color:#aeb2b3;font-size:calc(10px * var(--ui-scale, 1))}
.message-mention{display:inline;border:0;padding:0;background:transparent;color:#11a975;font:inherit;font-weight:700;cursor:pointer}
.message-mention:hover{text-decoration:underline}
.message-mention.mention-current-user{color:#db9b22}
.mine .message-mention{color:#087b55}
.mine .message-mention.mention-current-user{color:#8a4c00}
.composer textarea{flex:1;width:100%;min-height:40px;max-height:110px;padding:5px 3px;border:0;background:transparent;color:#eee;font-size:calc(12px * var(--ui-scale, 1));resize:none}
.composer-toolbar{height:34px;flex:none;display:flex;align-items:center;gap:5px}
.composer-tool{width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:5px;background:transparent;color:#c4c6c8;font-size:calc(18px * var(--ui-scale, 1))}
.composer-tool:hover{background:#3b3c3e;color:#fff}
.composer-tool svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.composer-tool-spacer{flex:1}
.composer .send-button{position:static;width:34px;height:32px;flex:none;display:grid;place-items:center;margin-left:auto;border-radius:5px;background:transparent;color:var(--green);font-size:calc(19px * var(--ui-scale, 1))}
.composer .send-button:hover{background:#3b3c3e;color:#fff}
.chat-attachment-preview{display:flex;gap:7px;max-height:72px;overflow-x:auto;padding:3px 1px}
.chat-attachment-chip{position:relative;min-width:110px;max-width:180px;height:58px;display:flex;align-items:center;gap:7px;padding:5px 24px 5px 6px;border:1px solid #48494b;border-radius:7px;background:#353638;color:#ddd}
.chat-attachment-chip img{width:44px;height:44px;flex:none;object-fit:cover;border-radius:4px}
.chat-attachment-icon{width:44px;height:44px;flex:none;display:grid;place-items:center;border-radius:4px;background:#424345;color:#c6c8c9;font-size:calc(18px * var(--ui-scale, 1))}
.chat-attachment-name{overflow:hidden;font-size:calc(10px * var(--ui-scale, 1));text-overflow:ellipsis;white-space:nowrap}
.chat-attachment-chip>button{position:absolute;top:2px;right:2px;width:18px;height:18px;padding:0;border:0;border-radius:50%;background:#222;color:#fff;font-size:calc(14px * var(--ui-scale, 1));line-height:18px}
.message-media-list{display:grid;gap:6px;margin-top:6px}
.message-media-link{display:block;max-width:min(360px,60vw)}
.message-media-image,.message-media-video{display:block;width:auto;max-width:min(360px,60vw);max-height:300px;border-radius:6px;object-fit:contain;background:#202123}
.message-file-link{min-width:220px;max-width:min(360px,60vw);display:flex;align-items:center;gap:10px;padding:10px;border:1px solid #595a5c;border-radius:7px;background:#343537;color:inherit;text-decoration:none}
.message-file-link>span:first-child{font-size:calc(23px * var(--ui-scale, 1))}
.message-file-link strong,.message-file-link small{display:block;max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.message-file-link small{margin-top:3px;color:#a3a5a6;font-size:calc(10px * var(--ui-scale, 1))}
:root[data-theme="light"] .composer{border-color:#e1e6e3;background:#fff}
:root[data-theme="light"] .composer textarea{color:#17221f}
:root[data-theme="light"] .composer-tool{color:#68756f}
:root[data-theme="light"] .mention-suggestions{border-color:#dce4df;background:#fff;color:#17221f;box-shadow:0 12px 30px #0002}
:root[data-theme="light"] .mention-search-input{border-color:#dce4df;background:#f5f7f6;color:#17221f}
:root[data-theme="light"] .mention-no-results{color:#85908c}
:root[data-theme="light"] .mention-suggestion:hover,:root[data-theme="light"] .mention-suggestion.active{background:#edf4f0}
:root[data-theme="light"] .mention-suggestion small{color:#758179}
:root[data-theme="light"] .chat-attachment-chip{border-color:#e0e7e3;background:#f4f7f5;color:#34413b}
:root[data-theme="light"] .chat-attachment-icon{background:#e7eeea;color:#66736c}
:root[data-theme="light"] .message-file-link{border-color:#e1e7e3;background:#f4f7f5;color:#34413b}
:root[data-theme="light"] .message-file-link small{color:#7d8982}
@media(max-width:760px){.composer{padding:8px 12px calc(8px + env(safe-area-inset-bottom))}.message-media-link,.message-media-image,.message-media-video{max-width:min(280px,70vw)}.message-file-link{max-width:75vw}}

.chat-background-modal .modal-card{width:min(320px,calc(100vw - 24px));max-height:min(520px,88dvh);border-radius:8px}
.chat-background-modal .modal-header{position:relative;min-height:42px;justify-content:center;padding:0 42px;border-bottom:0}
.chat-background-modal .modal-header h2{font-size:calc(13px * var(--ui-scale, 1));font-weight:500}
.chat-background-modal .modal-header #closeModal{position:absolute;right:8px;top:5px;width:30px;height:30px}
.chat-background-modal .modal-body{padding:0 0 14px}
.background-tabs{height:42px;display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid #edf0ee}
.background-tabs button{position:relative;border:0;background:transparent;color:#89928d;font-size:calc(12px * var(--ui-scale, 1))}
.background-tabs button.active{color:#222b26;font-weight:600}
.background-tabs button.active:after{position:absolute;right:12px;bottom:0;left:12px;height:2px;background:#222b26;content:''}
.background-color-grid,.background-wallpaper-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:14px 18px}
.background-color-tile{height:68px;border:1px solid #e9ecea;background:var(--bg-swatch)}
.background-color-tile.selected,.background-wallpaper-tile.selected{outline:2px solid var(--green);outline-offset:1px}
.background-wallpaper-tile{height:88px;display:grid;place-items:center;border:1px solid #edf0ee;background-color:var(--wall-color);background-image:var(--wall-image);background-size:74px 74px;font-size:calc(26px * var(--ui-scale, 1))}
.background-image-picker{min-height:210px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:#9ba39e;text-align:center}
.background-image-picker>button:first-child{width:60px;height:104px;border:1px solid #dfe4e1;background:transparent;color:#78837d;font-size:calc(24px * var(--ui-scale, 1))}
.background-image-picker p{margin:0;font-size:calc(12px * var(--ui-scale, 1))}
:root[data-theme="dark"] .chat-background-modal .modal-card,:root[data-theme="dark"] .chat-background-modal .modal-header,:root[data-theme="dark"] .chat-background-modal .modal-body{border-color:#424345;background:#2e2f31;color:#e8e9ea}
:root[data-theme="dark"] .background-tabs{border-color:#424345}
:root[data-theme="dark"] .background-tabs button.active{color:#f1f1f1}
:root[data-theme="dark"] .background-tabs button.active:after{background:#f1f1f1}
:root[data-theme="dark"] .background-color-tile,:root[data-theme="dark"] .background-wallpaper-tile{border-color:#55575a}
:root[data-theme="dark"] .background-image-picker{color:#a7aaab}
:root[data-theme="dark"] .background-image-picker>button:first-child{border-color:#55575a;color:#c5c7c8}
.icon-rail{position:relative}
.rail-more-menu{position:absolute;z-index:30;left:48px;bottom:10px;width:154px;padding:5px;border:1px solid #505154;border-radius:7px;background:#3a3b3d;box-shadow:0 10px 28px #10141055}
.rail-more-menu button{display:block;width:100%;height:34px;padding:0 12px;border:0;border-radius:5px;background:transparent;color:#f3f3f3;text-align:left;font-size:calc(12px * var(--ui-scale, 1))}
.rail-more-menu button:hover{background:#4a4b4d}
.rail-more-menu .danger-menu-item{color:#ffaaa5}
:root[data-theme="light"] .rail-more-menu{border-color:#e6ebe8;background:#fff;box-shadow:0 10px 28px #13261c22}
:root[data-theme="light"] .rail-more-menu button{color:#34413b}
:root[data-theme="light"] .rail-more-menu button:hover{background:#f3f7f5}
:root[data-theme="light"] .rail-more-menu .danger-menu-item{color:#b84c4c}
.direct-chat-settings{display:grid;gap:10px}
.calendar-hub{display:grid;gap:12px;min-width:0}
.calendar-hub>p{margin:0;font-size:calc(12px * var(--ui-scale, 1))}
.calendar-event-list{display:grid;gap:10px;max-height:min(58dvh,560px);overflow:auto;padding:1px 4px 2px 1px}
.calendar-event-card{min-width:0;padding:13px;border:1px solid var(--dialog-border,#dce4df);border-radius:11px;background:var(--dialog-surface-raised,#f7f9f8);color:var(--dialog-text,#26312b)}
.calendar-event-date{color:var(--green);font-size:calc(11px * var(--ui-scale, 1));font-weight:700}
.calendar-event-card h3{margin:6px 0;font-size:calc(15px * var(--ui-scale, 1));overflow-wrap:anywhere}
.calendar-event-card p{margin:5px 0;font-size:calc(12px * var(--ui-scale, 1));overflow-wrap:anywhere;white-space:pre-wrap}
.calendar-event-footer{display:flex;flex-wrap:wrap;justify-content:space-between;gap:5px;margin-top:9px;color:var(--dialog-muted,#84918a);font-size:calc(10px * var(--ui-scale, 1))}
.calendar-event-actions{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin-top:10px}
.calendar-event-actions .soft-button.selected{border-color:var(--green);background:var(--green);color:#fff}
.calendar-event-delete{margin-left:auto;color:#d94c4c}
.calendar-empty{padding:28px 12px;color:var(--dialog-muted,#84918a);text-align:center}
.calendar-event-form{display:grid;gap:12px;max-height:min(72dvh,700px);overflow:auto}
.calendar-event-form>p{margin:0;font-size:calc(12px * var(--ui-scale, 1))}
.calendar-event-form label{display:grid;gap:5px;font-size:calc(12px * var(--ui-scale, 1));font-weight:600}
.calendar-event-form .modal-input{min-height:40px}
.calendar-event-description-input{height:100px;padding:10px 12px;resize:vertical}
.calendar-event-form-actions{display:flex;justify-content:flex-end;gap:8px}
.direct-chat-settings p{margin:0 0 5px;color:#7d8982;font-size:calc(12px * var(--ui-scale, 1))}
.direct-chat-settings .soft-button{justify-content:center}
:root[data-theme="dark"] .direct-chat-settings p{color:#a7a9aa}
.rail-more{margin-top:18px;font-size:calc(16px * var(--ui-scale, 1));letter-spacing:0}
.rail-more svg{display:block;width:18px;height:18px}
.composer-toolbar{width:100%;justify-content:flex-start}
.composer-tool-spacer{display:none}
.composer .send-button{margin:0!important}
.composer{flex:none}
.chat-panel,.active-chat{min-height:0;overflow:hidden}
.chat-panel{height:100%}
.message-list{min-height:0;min-width:0;flex:1 1 0%;overflow-x:hidden;overflow-y:scroll;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#66686a transparent}
.message-list::-webkit-scrollbar{width:9px}
.message-list::-webkit-scrollbar-track{background:transparent}
.message-list::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:8px;background:#66686a;background-clip:content-box}
.bubble.bubble-media-only,.mine .bubble.bubble-media-only{padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
.bubble-media-only .message-media-list{margin-top:0}
.capture-toolbar{overflow:visible;max-width:calc(100vw - 12px);gap:4px;padding:4px}
.capture-tool-set,.capture-action-set{display:flex;align-items:center;gap:1px;flex:none}
.capture-tool-set i{height:24px;margin:0 3px;border-left:1px solid #c7cbd1}
.capture-action-set{margin-left:3px;padding-left:3px;border-left:1px solid #c7cbd1}
.capture-tool{flex-basis:32px;width:32px;height:34px}
.capture-mode-tool.active{background:#e1e5ec;color:#1d4fba}
.capture-tool-palette{position:absolute;z-index:6;display:flex;align-items:center;gap:8px;min-height:38px;padding:6px 8px;border:1px solid #a9adb4;border-radius:2px;background:#f5f6f8;color:#303642;box-shadow:0 2px 8px #0003;white-space:nowrap}
.capture-tool-palette.hidden{display:none}
.capture-shapes,.capture-palette-sizes,.capture-palette-colors{display:flex;align-items:center;gap:5px}
.capture-shapes button{width:29px;height:27px;border:0;border-radius:2px;background:transparent;color:#465061;font-size:calc(22px * var(--ui-scale, 1));line-height:1}
.capture-shapes button.selected,.capture-palette-sizes button.selected{background:#e4e9f1;color:#3478f6}
.capture-palette-sizes{gap:3px;padding:0 2px}
.capture-size-dot{width:20px;height:26px;padding:0;border:0;border-radius:3px;background:transparent;color:#9ba4b1;font-size:var(--dot-size);line-height:1}
.capture-size-dot.selected{color:#3478f6}
.capture-palette-colors{padding-left:4px;border-left:1px solid #c7cbd1}
.capture-color-swatch{width:19px;height:19px;padding:0;border:1px solid #c5c8ce;border-radius:1px;background:var(--swatch)}
.capture-color-swatch.selected{outline:2px solid #3478f6;outline-offset:1px}
.capture-custom-color{width:25px;height:23px;padding:1px;border:1px solid #c7cbd1;background:#fff;cursor:pointer}
.capture-text-size-label{display:flex;align-items:center;gap:5px;color:#566070;font-size:calc(11px * var(--ui-scale, 1))}
.capture-text-size{height:25px;min-width:82px;border:1px solid #b8bdc5;border-radius:2px;background:#fff;color:#303642;font-size:calc(12px * var(--ui-scale, 1))}
.capture-palette-hint{padding:0 5px;color:#697482;font-size:calc(10px * var(--ui-scale, 1))}
.capture-toolbar [data-tooltip]{position:relative}
.capture-toolbar [data-tooltip]::after{position:absolute;z-index:20;left:50%;bottom:calc(100% + 7px);width:max-content;max-width:180px;padding:5px 7px;transform:translateX(-50%);border-radius:3px;background:#25282e;color:#fff;content:attr(data-tooltip);font:11px/1.2 'Noto Sans TC',sans-serif;white-space:normal;pointer-events:none;opacity:0;visibility:hidden}
.capture-toolbar [data-tooltip]:hover::after,.capture-toolbar [data-tooltip]:focus-visible::after{opacity:1;visibility:visible}
@media(max-width:620px){.capture-toolbar{gap:1px;padding:2px}.capture-tool-set,.capture-action-set{gap:0}.capture-action-set{margin-left:1px;padding-left:1px}.capture-tool{flex-basis:29px;width:29px;height:31px}.capture-tool-palette{gap:5px;padding:5px}}

.pwa-install-modal .modal-card{width:min(390px,calc(100vw - 28px))}
.pwa-install-guide{display:grid;justify-items:center;gap:10px;padding:8px 2px;text-align:center}
.pwa-install-guide img{width:72px;height:72px;border-radius:20px;box-shadow:0 8px 20px #13a88130}
.pwa-install-guide p{margin:0;line-height:1.65}
.pwa-install-guide small{max-width:310px;color:#87918c;line-height:1.6}
:root[data-theme="dark"] .pwa-install-guide small{color:#a4a6a7}
.modal-card{transform:translate(var(--modal-drag-x,0px),var(--modal-drag-y,0px))}
.modal-header{cursor:grab;touch-action:none;user-select:none}
.modal-header.dragging{cursor:grabbing}
.message-media-open{position:relative;display:block;max-width:min(360px,60vw);padding:0;overflow:hidden;border:0;border-radius:6px;background:#202123;text-align:left}
.message-row{touch-action:pan-y;-webkit-touch-callout:none}
.message-media-open{-webkit-touch-callout:none;user-select:none}
.message-media-open:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.message-media-open .message-media-image,.message-media-open .message-media-video{max-width:100%}
.message-video-preview{width:max-content;max-width:min(360px,60vw)}
.message-video-play{position:absolute;left:50%;top:50%;width:48px;height:48px;display:grid;place-items:center;transform:translate(-50%,-50%);border:1px solid #ffffffaa;border-radius:50%;background:#101214aa;color:#fff;font-size:calc(18px * var(--ui-scale, 1));padding-left:3px;pointer-events:none}
.message-media-viewer{padding:12px;background:#08090bd9}
.message-media-viewer .modal-card{width:fit-content;min-width:min(300px,calc(100vw - 24px));max-width:96vw;height:fit-content;max-height:92dvh;border-color:#3b3d40;border-radius:8px;background:#17191b;color:#f0f1f2}
.message-media-viewer .modal-header{min-height:48px;flex:none;padding:7px 12px;border-color:#333639;background:#202224;color:#f0f1f2}
.message-media-viewer .modal-header h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:calc(12px * var(--ui-scale, 1))}
.message-media-viewer .modal-header .icon-button{color:#d7d9da}
.message-media-viewer .modal-body{display:flex;min-height:0;max-width:96vw;flex:none;flex-direction:column;overflow:hidden;padding:0;background:#111315}
.media-viewer-stage{position:relative;display:grid;width:fit-content;min-width:min(300px,calc(100vw - 24px));max-width:96vw;min-height:120px;max-height:calc(92dvh - 104px);flex:none;place-items:center;align-self:center;padding:16px 58px}
.media-viewer-content{display:block;width:auto;height:auto;max-width:calc(96vw - 116px);max-height:calc(92dvh - 150px);object-fit:contain}
.media-viewer-nav{position:absolute;z-index:1;top:50%;width:42px;height:54px;transform:translateY(-50%);border:0;border-radius:8px;background:#25282bbf;color:#f5f5f5;font-size:calc(38px * var(--ui-scale, 1));line-height:1}
.media-viewer-nav:hover{background:#3a3d40}
.media-viewer-nav.previous{left:10px}.media-viewer-nav.next{right:10px}
.media-viewer-footer{display:flex;min-height:48px;align-items:center;justify-content:space-between;padding:6px 14px;border-top:1px solid #303235;color:#a9adaf;font-size:calc(11px * var(--ui-scale, 1))}
.media-viewer-footer>div{display:flex;gap:8px}
.album-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start;gap:8px;flex:1;overflow:auto;padding:10px}
.album-media-card{position:relative;min-width:0;aspect-ratio:1}
.album-media-card .album-media-item{width:100%;height:100%}
.album-media-delete{position:absolute;z-index:1;top:5px;right:5px;width:26px;height:26px;border:1px solid #fff8;border-radius:50%;background:#202224d9;color:#fff;font-size:20px;line-height:1}
.album-media-delete:hover{background:#d83f45}
.album-media-item{position:relative;display:block;aspect-ratio:1;min-width:0;padding:0;overflow:hidden;border:0;border-radius:5px;background:#1d1f21;color:#fff;text-align:left}
.album-media-item>img,.album-video-thumb,.album-video-thumb video{display:block;width:100%;height:100%;object-fit:cover}
.album-video-thumb{position:relative}.album-video-thumb i{position:absolute;inset:0;display:grid;place-items:center;background:#0004;color:#fff;font-size:calc(23px * var(--ui-scale, 1));font-style:normal}
.album-media-caption{position:absolute;right:0;bottom:0;left:0;overflow:hidden;padding:16px 5px 4px;background:linear-gradient(transparent,#0009);font-size:calc(9px * var(--ui-scale, 1));text-overflow:ellipsis;white-space:nowrap}
:root[data-theme="light"] .message-media-viewer .modal-card,:root[data-theme="light"] .message-media-viewer .modal-body{background:#111315;color:#f0f1f2}
:root[data-theme="light"] .message-media-viewer .modal-header{border-color:#333639;background:#202224;color:#f0f1f2}
@media(max-width:760px){.message-media-open,.message-video-preview{max-width:min(280px,70vw)}.message-media-viewer{padding:7px}.message-media-viewer .modal-card{width:fit-content;min-width:min(300px,calc(100vw - 14px));max-width:calc(100vw - 14px);height:fit-content;max-height:calc(100dvh - 14px)}.media-viewer-stage{min-width:min(300px,calc(100vw - 14px));max-width:calc(100vw - 14px);max-height:calc(100dvh - 104px);padding:12px 42px}.media-viewer-content{max-width:calc(100vw - 98px);max-height:calc(100dvh - 140px)}.media-viewer-nav{width:34px;height:44px}.media-viewer-nav.previous{left:4px}.media-viewer-nav.next{right:4px}.album-gallery{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:7px}}
.message-video-still{width:min(280px,60vw);height:158px;display:grid;place-content:center;justify-items:center;gap:8px;background:linear-gradient(135deg,#26292b,#414447);color:#e7e8e8}
.message-video-still i{width:42px;height:42px;display:grid;place-items:center;padding-left:3px;border:1px solid #ffffffbb;border-radius:50%;background:#1118;font-size:calc(17px * var(--ui-scale, 1));font-style:normal}
.message-video-still small{color:#c0c3c4;font-size:calc(10px * var(--ui-scale, 1))}
.chat-panel{container-type:inline-size}
.message-media-open,.message-video-preview,.message-video-still{max-width:50cqi}
.message-media-open .message-media-image,.message-media-open .message-media-video{max-width:100%}
.media-viewer-stage{touch-action:pan-y}
.media-viewer-stage.is-zoomable{overflow:hidden;touch-action:none}
.media-viewer-content.is-zoomable{transform-origin:center;will-change:transform;cursor:zoom-in;user-select:none;-webkit-user-drag:none;touch-action:none}
.media-viewer-content.is-zoomable.is-zoomed{cursor:grab}
.media-viewer-stage.is-zoomed .media-viewer-content.is-zoomable{cursor:grab}
@media(max-width:760px){.message-media-open,.message-video-preview,.message-video-still{max-width:50cqi}}
.album-video-thumb{display:grid;place-content:center;justify-items:center;gap:6px;background:linear-gradient(135deg,#26292b,#414447);color:#e7e8e8}
.album-video-thumb i{position:static;width:32px;height:32px;display:grid;place-items:center;padding-left:2px;border:1px solid #ffffffaa;border-radius:50%;background:#1118;font-size:calc(13px * var(--ui-scale, 1));font-style:normal}
.album-video-thumb small{color:#c0c3c4;font-size:calc(9px * var(--ui-scale, 1))}
.chat-context-menu{position:fixed;z-index:80;width:184px;max-height:min(80vh,560px);overflow-y:auto;padding:5px;border:1px solid #505154;border-radius:6px;background:#3a3b3d;box-shadow:0 10px 28px #10141066;color:#f3f3f3}
.chat-context-menu button{display:block;width:100%;min-height:34px;padding:0 10px;border:0;border-radius:4px;background:transparent;color:inherit;text-align:left;font-size:calc(12px * var(--ui-scale, 1))}
.chat-context-menu button:hover,.chat-context-menu button:focus-visible{outline:0;background:#4a4b4d}
.chat-context-divider{height:1px;margin:4px 1px;background:#505154}
:root[data-theme="light"] .chat-context-menu{border-color:#e1e6e3;background:#fff;box-shadow:0 10px 28px #13261c33;color:#34413b}
:root[data-theme="light"] .chat-context-menu button:hover,:root[data-theme="light"] .chat-context-menu button:focus-visible{background:#f0f4f2}
:root[data-theme="light"] .chat-context-divider{background:#e6ebe8}
.message-read-status{color:#d4d6d7;font-size:calc(9px * var(--ui-scale, 1))}
:root[data-theme="light"] .message-read-status{color:#77827c}
.message-content{max-width:min(82%,720px)}
.message-media-open{max-width:min(520px,74vw)}
.message-media-open .message-media-image{max-height:min(520px,65dvh)}
@media(max-width:760px){.message-content{max-width:86%}.message-media-open{max-width:min(420px,76vw)}.message-media-open .message-media-image{max-height:min(480px,58dvh)}}
.message-media-open{width:fit-content;max-width:50cqi}
.message-media-open .message-media-image{display:block;width:auto;max-width:100%;height:auto;object-fit:contain}
.message-video-preview{max-width:50cqi}
@media(max-width:760px){.message-media-open,.message-video-preview{max-width:50cqi}}
.composer-tool.sticker-launcher{font-size:calc(20px * var(--ui-scale, 1));font-weight:600;line-height:1}
.sticker-picker-modal .modal-card{width:min(520px,calc(100vw - 24px));max-height:min(78dvh,620px)}
.sticker-picker-modal .modal-body{padding:12px}
.sticker-picker{display:grid;gap:12px}
.sticker-picker-heading{display:grid;gap:10px;font-size:calc(12px * var(--ui-scale, 1));font-weight:600}
.sticker-category-tabs{display:flex;align-items:center;gap:5px;overflow-x:auto;padding:2px 2px 6px;border-bottom:1px solid var(--dialog-border);scrollbar-width:thin}
.sticker-category-tab,.sticker-category-add,.sticker-category-edit{flex:none;min-height:32px;padding:0 10px;border:0;border-radius:7px;background:transparent;color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale, 1));white-space:nowrap}
.sticker-category-tab.active{background:var(--dialog-surface-raised);color:var(--dialog-text);font-weight:700}
.sticker-category-tab-wrap{display:inline-flex;align-items:center;gap:1px;flex:none;padding:1px;border-radius:8px}
.sticker-category-tab-wrap:has(.active){background:var(--dialog-surface-raised)}
.sticker-category-tab-wrap .sticker-category-tab{padding-right:6px}
.sticker-category-edit{min-width:23px;padding:0 4px;font-size:16px}
.sticker-category-add{width:32px;padding:0;border:1px dashed var(--dialog-border);font-size:18px}
.sticker-picker-actions{display:flex;justify-content:flex-end}
.sticker-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;max-height:min(48dvh,380px);min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding:2px}
.sticker-tile-wrap{position:relative;min-width:0;touch-action:pan-y}
.sticker-tile{width:100%;min-width:0;min-height:104px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:7px;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--ink)}
.sticker-tile:has(>img){height:104px;padding:0;overflow:hidden}
.sticker-tile:hover{border-color:var(--green);background:color-mix(in srgb,var(--green) 8%,var(--surface))}
.sticker-tile.sticker-selected{position:relative;z-index:2;transform:scale(1.35);border:2px solid var(--green);box-shadow:0 7px 18px #0003}
.sticker-tile>span{width:66px;height:66px;display:grid;place-items:center;border-radius:20px;background:var(--sticker-color);font-size:calc(39px * var(--ui-scale, 1))}
.sticker-tile img{width:100%;height:100%;min-height:0;object-fit:contain}
.sticker-tile:has(>img) small{display:none}
.sticker-tile small{width:100%;overflow:hidden;color:var(--muted);font-size:calc(9px * var(--ui-scale, 1));text-overflow:ellipsis;white-space:nowrap;text-align:center}
.sticker-tile-actions{position:absolute;z-index:3;top:-4px;right:-4px;display:flex;gap:3px}
.sticker-tile-actions button{width:22px;height:22px;padding:0;border:1px solid var(--dialog-surface);border-radius:50%;background:var(--dialog-surface-raised);color:var(--dialog-text);font-size:14px;line-height:18px}
.sticker-tile-actions .sticker-delete{position:static;background:#d84848;color:#fff;font-size:18px}
.sticker-category-menu{position:absolute;z-index:6;top:20px;left:0;min-width:116px;max-height:180px;overflow:auto;padding:4px;border:1px solid var(--dialog-border);border-radius:7px;background:var(--dialog-surface);box-shadow:0 8px 20px #0003}
.sticker-category-menu button{display:block;width:100%;padding:7px;border:0;border-radius:4px;background:transparent;color:var(--dialog-text);font-size:calc(10px * var(--ui-scale, 1));text-align:left}
.sticker-category-menu button:hover{background:var(--dialog-hover)}
.sticker-dragging{z-index:5;opacity:.62;transform:scale(.94);box-shadow:0 8px 24px #0005}
.sticker-reordering{user-select:none}
.sticker-empty{grid-column:1/-1;display:grid;min-height:100px;place-items:center;color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale, 1))}
.sticker-category-form{display:grid;gap:14px}
.sticker-category-form label{display:grid;gap:8px;color:var(--dialog-label);font-size:calc(12px * var(--ui-scale, 1))}
.sticker-category-form-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.sticker-category-form-actions .text-button{margin-right:auto}
.sticker-delete{position:absolute;top:-5px;right:-5px;width:23px;height:23px;border:1px solid var(--surface);border-radius:50%;background:#d84848;color:#fff;font-size:18px;line-height:18px}
.sticker-picker-hint{margin:0;color:var(--muted);font-size:calc(10px * var(--ui-scale, 1));line-height:1.5}
@media(max-width:520px){.sticker-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.sticker-tile{min-height:92px}.sticker-tile:has(>img){height:92px;min-height:92px}.sticker-tile>span{width:58px;height:58px}}

#appView img,#appView video,#modalLayer img,#modalLayer video{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}

/* Shared, high-contrast colors for every application dialog. */
:root{--dialog-surface:#fff;--dialog-surface-raised:#f4f7f5;--dialog-text:#17221f;--dialog-label:#46534c;--dialog-muted:#65736b;--dialog-placeholder:#77847d;--dialog-border:#dce4df;--dialog-input:#fff;--dialog-input-text:#17221f;--dialog-hover:#edf4f0}
:root[data-theme="dark"]{--dialog-surface:#2e2f31;--dialog-surface-raised:#393a3c;--dialog-text:#f0f1f2;--dialog-label:#d1d4d5;--dialog-muted:#b8bcbd;--dialog-placeholder:#a5aaab;--dialog-border:#4b4d4f;--dialog-input:#383a3c;--dialog-input-text:#f1f2f3;--dialog-hover:#414345}
:root[data-color-scheme="custom"]{--dialog-surface:var(--custom-background,#2c2d2f);--dialog-surface-raised:color-mix(in srgb,var(--custom-background,#2c2d2f) 88%,var(--custom-text,#f0f1f2));--dialog-text:var(--custom-text,#f0f1f2);--dialog-label:color-mix(in srgb,var(--custom-text,#f0f1f2) 86%,var(--custom-background,#2c2d2f));--dialog-muted:color-mix(in srgb,var(--custom-text,#f0f1f2) 68%,var(--custom-background,#2c2d2f));--dialog-placeholder:var(--dialog-muted);--dialog-border:color-mix(in srgb,var(--custom-text,#f0f1f2) 20%,var(--custom-background,#2c2d2f));--dialog-input:var(--dialog-surface-raised);--dialog-input-text:var(--dialog-text);--dialog-hover:color-mix(in srgb,var(--custom-background,#2c2d2f) 78%,var(--custom-text,#f0f1f2))}
.modal-layer:not(.message-media-viewer) .modal-card{border-color:var(--dialog-border);background:var(--dialog-surface);color:var(--dialog-text)}
.modal-layer:not(.message-media-viewer) .modal-header,.modal-layer:not(.message-media-viewer) .modal-body{border-color:var(--dialog-border);background:var(--dialog-surface);color:var(--dialog-text)}
.modal-layer:not(.message-media-viewer) .modal-header h2{color:var(--dialog-text)}
.modal-layer:not(.message-media-viewer) .modal-header .icon-button{color:var(--dialog-muted)}
.modal-layer:not(.message-media-viewer) .modal-body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),textarea,select){border-color:var(--dialog-border);background:var(--dialog-input);color:var(--dialog-input-text);color-scheme:light}
:root[data-theme="dark"] .modal-layer:not(.message-media-viewer) .modal-body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),textarea,select){color-scheme:dark}
.modal-layer:not(.message-media-viewer) .modal-body :is(input,textarea)::placeholder{color:var(--dialog-placeholder);opacity:1}
.modal-layer:not(.message-media-viewer) .modal-body :is(.field-label,.modal-form label,.profile-settings-form>label,.profile-password-fields label,.appearance-settings h3,.sticker-picker-heading){color:var(--dialog-label)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.muted,.form-hint,.notes-empty,.note-share-hint,.note-editor-footer,.profile-account-readonly,.profile-password-fields small,.appearance-hint,.range-labels,.color-options button,.member-profile-status,.shared-note-main span,.shared-note-main small,.note-save-status){color:var(--dialog-muted)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.shared-note-card,.appearance-options button,.sticker-tile){border-color:var(--dialog-border)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.shared-note-card,.appearance-options button,.sticker-tile){background:var(--dialog-surface-raised);color:var(--dialog-text)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.profile-account-readonly,.note-card-actions){background:var(--dialog-surface-raised);color:var(--dialog-text)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.user-row,.member-row,.profile-password-fields){border-color:var(--dialog-border)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.appearance-options button:hover,.sticker-tile:hover){background:var(--dialog-hover)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.background-tabs button,.notes-tabs button,.note-card-menu){color:var(--dialog-muted)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.background-tabs button.active,.notes-tabs button.active){color:var(--dialog-text)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.background-tabs button.active:after,.notes-tabs button.active:after){background:var(--dialog-text)}
.modal-layer:not(.message-media-viewer) .modal-body :is(.profile-cover-preview,.member-profile-cover){background:var(--dialog-surface-raised);color:var(--dialog-muted)}
.modal-layer:not(.message-media-viewer) .cancel-button{border-color:var(--dialog-border);background:var(--dialog-surface-raised);color:var(--dialog-text)}
.notification-settings-hero{display:grid;justify-items:center;gap:8px;padding:8px 10px 18px;text-align:center}.notification-app-icon{display:grid;width:54px;height:54px;place-items:center;border-radius:17px;background:var(--custom-accent,var(--green));color:#fff;font-size:calc(16px * var(--ui-scale,1));font-weight:800;box-shadow:0 3px 12px color-mix(in srgb,var(--custom-accent,var(--green)) 25%,transparent)}.notification-settings-hero>strong{color:var(--dialog-text);font-size:calc(18px * var(--ui-scale,1))}.notification-settings-hero p,.notification-settings-description{margin:0;color:var(--dialog-muted);font-size:calc(12px * var(--ui-scale,1));line-height:1.5}.notification-settings-panel{overflow:hidden;border:1px solid var(--dialog-border);border-radius:18px;background:var(--dialog-surface-raised)}.notification-settings-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:66px;margin:0 16px;border-bottom:1px solid var(--dialog-border);color:var(--dialog-text)}.notification-settings-row:last-child{border-bottom:0}.notification-settings-row>div{display:grid;gap:4px;min-width:0}.notification-settings-row strong{font-size:calc(14px * var(--ui-scale,1))}.notification-settings-row small{color:var(--dialog-muted);font-size:calc(10px * var(--ui-scale,1));line-height:1.45}.notification-settings-description{padding:12px 16px;border-bottom:1px solid var(--dialog-border)}.settings-switch{position:relative;flex:none;width:48px;height:28px;padding:3px;border:0;border-radius:999px;background:var(--dialog-border);cursor:pointer;transition:background .18s ease}.settings-switch i{display:block;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0003;transition:transform .18s ease}.settings-switch.is-on{background:var(--custom-accent,var(--green))}.settings-switch.is-on i{transform:translateX(20px)}.settings-switch:disabled{opacity:.6;cursor:wait}.notification-always-on{flex:none;color:var(--custom-accent-dark,var(--green-dark));font-size:calc(11px * var(--ui-scale,1));font-weight:700}
@media(max-width:560px){.notification-settings-hero{padding-bottom:10px}.notification-settings-row{min-height:58px;margin-inline:12px}.notification-settings-description{padding:10px 12px}.notification-settings-panel{border-radius:15px}}
.image-crop-dialog{border-color:var(--dialog-border);background:var(--dialog-surface);color:var(--dialog-text)}
.image-crop-dialog p{color:var(--dialog-muted)}
.image-crop-dialog footer button:not(.crop-confirm){background:var(--dialog-surface-raised);color:var(--dialog-text)}
.mobile-gallery-tool{display:none}
@media(max-width:760px){.mobile-gallery-tool{display:grid}}
@media(max-width:760px){#chatCaptureButton{display:none!important}}
.message-media-open.message-sticker{overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none}
.message-media-open.message-sticker .message-media-image{border:0;border-radius:0;background:transparent;box-shadow:none}
.message-media-open.message-sticker{width:auto;max-width:min(50cqi,50%)}
.message-media-open.message-sticker .message-media-image{display:block;width:auto;max-width:100%;max-height:50dvh;object-fit:contain}
.call-action{font-size:calc(17px * var(--ui-scale,1));font-weight:700}.call-overlay{position:fixed;z-index:120;inset:0;display:grid;place-items:center;padding:16px;background:#000a}.call-overlay.hidden{display:none}.call-card{position:relative;display:flex;width:min(540px,100%);min-height:320px;max-height:90dvh;flex-direction:column;align-items:center;justify-content:center;gap:18px;overflow:hidden;padding:24px;border:1px solid var(--dialog-border,#45474a);border-radius:22px;background:var(--dialog-surface,#242528);color:var(--dialog-text,#f5f5f5);box-shadow:0 20px 70px #0008}.call-card video{max-width:100%;max-height:56dvh;object-fit:contain;border-radius:14px;background:#111}.call-card #callRemoteVideo:not(.hidden){width:100%;flex:1}.call-card #callLocalVideo:not(.hidden){position:absolute;right:18px;top:18px;width:min(28%,140px);aspect-ratio:3/4;border:1px solid #ffffff55}.call-info{display:grid;gap:8px;justify-items:center;text-align:center}.call-info strong{font-size:calc(20px * var(--ui-scale,1))}.call-info span{color:var(--dialog-muted,#aaa)}.call-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}.call-actions.hidden{display:none}.call-actions button{min-width:88px;min-height:44px;padding:8px 16px;border:0;border-radius:999px;background:var(--dialog-surface-raised,#3a3b3d);color:var(--dialog-text,#fff)}.call-actions .call-accept{background:#16ad67;color:#fff}.call-actions .call-danger{background:#d94444;color:#fff}
.message-row .bubble.bubble-media-only,.message-row.mine .bubble.bubble-media-only{padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:inherit}
 .sound-settings-panel{overflow:hidden;border:1px solid var(--dialog-border);border-radius:14px;background:var(--dialog-surface-raised)}
.sound-settings-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,160px) auto auto auto;align-items:center;gap:8px;min-height:62px;padding:9px 12px;border-bottom:1px solid var(--dialog-border);color:var(--dialog-text)}
.sound-settings-row:last-child{border-bottom:0}
.sound-settings-row>span{display:grid;gap:4px;min-width:0}
.sound-settings-row strong{font-size:calc(12px * var(--ui-scale,1))}
.sound-settings-row small{color:var(--dialog-muted);font-size:calc(10px * var(--ui-scale,1));line-height:1.35}
.sound-settings-row select{width:100%;min-width:0;height:36px;padding:0 8px;border:1px solid var(--dialog-border);border-radius:8px;background:var(--dialog-surface);color:var(--dialog-text);font:inherit;font-size:calc(11px * var(--ui-scale,1))}
.sound-settings-row .soft-button{min-height:34px;padding-inline:9px;white-space:nowrap}
@media(max-width:560px){.sound-settings-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.sound-settings-row>span,.sound-settings-row select{grid-column:1/-1}.sound-settings-row .soft-button{grid-column:auto;grid-row:auto;padding-inline:6px}}
/* Custom accent color in the appearance settings. */
.appearance-options{grid-template-columns:repeat(3,minmax(0,1fr))}
.custom-color-control{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #e2e8e4;border-radius:9px;color:#45534b;font-size:calc(11px * var(--ui-scale, 1))}
.custom-color-control input{width:36px;height:30px;padding:2px;border:1px solid #e2e8e4;border-radius:6px;background:transparent;cursor:pointer}
.custom-color-control span{margin-left:auto;color:#7c8881;font-variant-numeric:tabular-nums}
:root[data-theme="dark"] .custom-color-control{border-color:#4b4c4e;color:#d1d4d5}
:root[data-theme="dark"] .custom-color-control input{border-color:#55575a}
:root[data-theme="dark"] .custom-color-control span{color:#a4a6a7}
@media(max-width:760px){#appView{touch-action:pan-y}}
.settings-logout-button{display:none;width:100%;min-height:42px;border:1px solid #ebdada;border-radius:9px;background:transparent;color:#c24848;font-size:calc(12px * var(--ui-scale, 1));font-weight:600}
@media(max-width:760px){.settings-logout-button{display:block}}
:root[data-theme="dark"] .settings-logout-button{border-color:#594040;color:#ff9999}
.mobile-loading-screen{display:none}
@media(max-width:760px){.mobile-loading-screen:not(.hidden){position:fixed;z-index:20000;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#252628;color:#f2f4f3}.mobile-loading-brand{width:64px;height:64px;display:grid;place-items:center;border-radius:21px;background:linear-gradient(145deg,#27c69b,#07886b);color:#fff;font-size:30px;font-weight:700;box-shadow:0 10px 30px #06c75530}.mobile-loading-screen strong{font-size:18px;letter-spacing:.04em}.mobile-loading-screen span{color:#b7bbba;font-size:13px}.mobile-loading-screen i{width:24px;height:24px;margin-top:10px;border:3px solid #ffffff38;border-top-color:#06c755;border-radius:50%;animation:mobile-loading-spin .8s linear infinite}@keyframes mobile-loading-spin{to{transform:rotate(360deg)}}}
@media(max-width:760px){.mobile-loading-progress{width:min(220px,62vw);height:5px;overflow:hidden;border-radius:9px;background:#ffffff26}.mobile-loading-progress i{display:block;width:0;height:100%;border:0;border-radius:inherit;background:#06c755;transition:width .16s ease-out}}
.system-log-entry{padding:12px 4px;border-bottom:1px solid #414244}
.system-log-entry header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.system-log-entry header>span{display:flex;align-items:center;gap:8px;min-width:0}
.system-log-entry header small{flex:none;padding:3px 7px;border-radius:999px;background:#087c4c25;color:#43d994;font-size:calc(10px * var(--ui-scale, 1));font-weight:600}
.system-log-entry header strong{color:#e6e8e8;font-size:calc(12px * var(--ui-scale, 1))}
.system-log-entry header time{flex:none;color:#a4a6a7;font-size:calc(10px * var(--ui-scale, 1))}
.system-log-entry p{margin:7px 0 0;color:#d1d3d3;font-size:calc(11px * var(--ui-scale, 1));line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
:root[data-theme="light"] .system-log-entry{border-color:#edf0ee}
:root[data-theme="light"] .system-log-entry header strong{color:#26332d}
:root[data-theme="light"] .system-log-entry header small{background:#e3f6eb;color:#087c4c}
:root[data-theme="light"] .system-logs-category{border-color:#d2d9d5;background:#fff;color:#26332d}
:root[data-theme="light"] .system-log-entry header time{color:#7c8881}
:root[data-theme="light"] .system-log-entry p{color:#46534c}
/* Keep the interface usable when the user enlarges text substantially. */
:root[data-font-scale="large"] .app-shell{grid-template-columns:54px minmax(260px,min(var(--sidebar-width,340px),35vw)) 6px minmax(0,1fr)}
:root[data-font-scale="large"] .sidebar-header,:root[data-font-scale="large"] .chat-header{height:auto;min-height:58px;padding-block:9px;flex-wrap:wrap}
:root[data-font-scale="large"] .sidebar-tabs{height:auto;min-height:42px;flex-wrap:wrap;align-items:center}
:root[data-font-scale="large"] .sidebar-tabs>button{min-height:2.4em;white-space:normal}
:root[data-font-scale="large"] .profile-row{min-height:58px;height:auto;flex-wrap:wrap;padding-block:10px}
:root[data-font-scale="large"] .search-wrap{height:auto;min-height:40px;padding-block:6px}
:root[data-font-scale="large"] .sidebar-actions{flex-wrap:wrap;align-items:stretch}
:root[data-font-scale="large"] .soft-button,:root[data-font-scale="large"] .primary-button,:root[data-font-scale="large"] .text-button{height:auto;min-height:2.4em;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
:root[data-font-scale="large"] .section-heading{min-height:2.8em;flex-wrap:wrap;gap:6px}
:root[data-font-scale="large"] .conversation-item{align-items:flex-start;min-height:64px}
:root[data-font-scale="large"] .conversation-top,:root[data-font-scale="large"] .conversation-preview{flex-wrap:wrap}
:root[data-font-scale="large"] .conversation-title{white-space:normal;overflow-wrap:anywhere}
:root[data-font-scale="large"] .conversation-time{margin-left:auto}
:root[data-font-scale="large"] .conversation-copy,:root[data-font-scale="large"] .chat-heading{overflow-wrap:anywhere}
:root[data-font-scale="large"] .chat-tools{flex-wrap:wrap;max-width:100%}
:root[data-font-scale="large"] #appView .icon-button,:root[data-font-scale="large"] .composer-tool{flex:none;width:40px;min-width:40px;height:auto;min-height:40px;font-size:clamp(18px,calc(20px * var(--ui-scale, 1)),30px);line-height:1}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer){padding:8px;align-items:center}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-card{width:min(760px,calc(100vw - 16px));height:auto;min-height:0;max-height:calc(100dvh - 16px)}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-header{min-height:2.8em;flex-wrap:wrap;gap:8px}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:clamp(12px,2vw,22px)}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),textarea,select){width:100%;height:auto;min-height:2.6em;padding-block:.45em;line-height:1.35}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-body :is(button,label,section,article,div){min-width:0;overflow-wrap:anywhere}
:root[data-font-scale="large"] .appearance-options{grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr))}
:root[data-font-scale="large"] .appearance-settings{gap:16px}
:root[data-font-scale="large"] .user-row,:root[data-font-scale="large"] .member-row{flex-wrap:wrap}
:root[data-font-scale="large"] .line-capture-editor{grid-template-rows:auto minmax(0,1fr) auto auto;overflow:auto}
:root[data-font-scale="large"] .capture-toolbar{max-width:100vw;overflow-x:auto;overscroll-behavior-x:contain}
@media(max-width:760px){
  :root[data-font-scale="large"] #appView .sidebar{overflow-y:auto;overscroll-behavior:contain}
  :root[data-font-scale="large"] #appView .conversation-list{flex:1 0 auto;min-height:24dvh;max-height:none;overflow:visible}
  :root[data-font-scale="large"] #appView .chat-header{gap:6px;padding-inline:8px}
  :root[data-font-scale="large"] #appView .chat-tools{gap:0}
  :root[data-font-scale="large"] #appView .chat-tools .icon-button{width:34px;min-width:34px;min-height:36px}
  :root[data-font-scale="large"] #appView .composer{max-height:38dvh;overflow:auto;padding-inline:8px}
  :root[data-font-scale="large"] #appView .composer-toolbar{height:auto;min-height:34px;flex-wrap:wrap}
  :root[data-font-scale="large"] #appView .message-content{max-width:92%}
  :root[data-font-scale="large"] .appearance-options{grid-template-columns:1fr}
  :root[data-font-scale="large"] .modal-layer{padding:6px!important}
  :root[data-font-scale="large"] .modal-card{width:calc(100vw - 12px)!important;max-height:calc(100dvh - 12px)!important}
}
@media(min-width:761px){#mobileLoadingScreen{display:none!important}}
:root[data-font-scale="large"] .login-shell{align-items:start;overflow:auto;padding-block:16px}
:root[data-font-scale="large"] .login-card{max-height:calc(100dvh - 32px);overflow:auto}
:root[data-font-scale="large"] .stack-form input,:root[data-font-scale="large"] .modal-input{height:auto;min-height:2.6em;padding-block:.45em;line-height:1.35}
:root[data-font-scale="large"] .brand-mark,:root[data-font-scale="large"] .avatar,:root[data-font-scale="large"] .conversation-avatar,:root[data-font-scale="large"] .chat-avatar{font-size:clamp(14px,calc(14px * var(--ui-scale, 1)),30px)}
:root[data-font-scale="large"] #modalLayer .modal-header .icon-button{width:auto;min-width:36px;height:auto;min-height:36px;font-size:clamp(20px,calc(20px * var(--ui-scale, 1)),30px);line-height:1}
/* Scale SVG controls with enlarged text while keeping each icon centered in its button. */
:root[data-font-scale="large"] .rail-button{width:48px;min-width:48px;height:48px;flex:none;display:grid;place-items:center}
:root[data-font-scale="large"] .rail-button svg{display:block;flex:none;width:min(calc(20px * var(--ui-scale, 1)),42px);height:min(calc(20px * var(--ui-scale, 1)),42px)}
:root[data-font-scale="large"] .rail-more svg{width:min(calc(18px * var(--ui-scale, 1)),38px);height:min(calc(18px * var(--ui-scale, 1)),38px)}
:root[data-font-scale="large"] #appView .icon-button{width:52px;min-width:52px;height:auto;min-height:48px;display:grid;place-items:center;font-size:clamp(20px,calc(20px * var(--ui-scale, 1)),42px);line-height:1}
:root[data-font-scale="large"] #appView .chat-tools svg{display:block;flex:none;width:min(calc(19px * var(--ui-scale, 1)),40px);height:min(calc(19px * var(--ui-scale, 1)),40px)}
:root[data-font-scale="large"] .composer-tool{width:44px;min-width:44px;height:auto;min-height:44px;display:grid;place-items:center;font-size:clamp(20px,calc(18px * var(--ui-scale, 1)),38px)}
:root[data-font-scale="large"] .composer-tool svg,:root[data-font-scale="large"] .note-compose-toolbar svg{display:block;flex:none;width:min(calc(19px * var(--ui-scale, 1)),38px);height:min(calc(19px * var(--ui-scale, 1)),38px)}
:root[data-font-scale="large"] #manageGroupButton svg{width:min(calc(18px * var(--ui-scale, 1)),38px);height:min(calc(18px * var(--ui-scale, 1)),38px)}
:root[data-font-scale="large"] .note-compose-toolbar>button{width:46px;height:auto;min-height:44px;display:grid;place-items:center}
:root[data-font-scale="large"] .chat-more-menu button,:root[data-font-scale="large"] .rail-more-menu button,:root[data-font-scale="large"] .chat-context-menu button{height:auto;min-height:2.4em;padding-block:.4em;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
:root[data-font-scale="large"] #modalLayer .modal-body button:not(.icon-button){height:auto;min-height:2.35em;padding-block:.38em;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
:root[data-font-scale="large"] .announcement-bar,:root[data-font-scale="large"] .sidebar-footer{height:auto;min-height:2.8em;flex-wrap:wrap;padding-block:8px;line-height:1.35}
:root[data-font-scale="large"] .message-meta,:root[data-font-scale="large"] .sender-name{line-height:1.4;overflow-wrap:anywhere}
@media(max-width:760px){
  :root[data-font-scale="large"] #appView .rail-button{width:48px;min-width:48px;height:48px}
  :root[data-font-scale="large"] #appView .chat-tools .icon-button{width:46px;min-width:46px;min-height:44px}
  :root[data-font-scale="large"] #appView .chat-tools svg{width:min(calc(19px * var(--ui-scale, 1)),34px);height:min(calc(19px * var(--ui-scale, 1)),34px)}
  :root[data-font-scale="large"] #appView .composer-tool{width:42px;min-width:42px;min-height:42px}
}
:root[data-font-scale="large"] .rail-profile span{width:min(calc(27px * var(--ui-scale, 1)),42px);height:min(calc(27px * var(--ui-scale, 1)),42px);font-size:clamp(16px,calc(12px * var(--ui-scale, 1)),32px)}
:root[data-font-scale="large"] .search-wrap>span{flex:none;font-size:clamp(16px,calc(16px * var(--ui-scale, 1)),32px);line-height:1}
:root[data-font-scale="large"] .composer-toolbar{height:auto;min-height:44px;flex-wrap:wrap}
:root[data-font-scale="large"] .composer .send-button{width:44px;height:auto;min-height:44px;font-size:clamp(20px,calc(19px * var(--ui-scale, 1)),38px);display:grid;place-items:center}
@media(min-width:761px){
  :root[data-font-scale="large"] #appView.app-shell{display:grid;grid-template-columns:54px minmax(260px,min(var(--sidebar-width,340px),35vw)) 6px minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
  :root[data-font-scale="large"] #appView .icon-rail{grid-column:1;grid-row:1;min-width:0}
  :root[data-font-scale="large"] #appView .sidebar{grid-column:2;grid-row:1;min-width:0}
  :root[data-font-scale="large"] #appView .sidebar-resize-handle{grid-column:3;grid-row:1;min-width:6px}
  :root[data-font-scale="large"] #appView .chat-panel{grid-column:4;grid-row:1;min-width:0;min-height:0}
}
:root[data-font-scale="large"] #modalLayer .modal-body button:not(.icon-button):not(.notes-fab){height:auto;min-height:2.35em;padding-block:.38em;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
:root[data-font-scale="large"] #modalLayer.notes-modal .modal-card{width:min(640px,calc(100vw - 24px));height:min(88dvh,850px);min-height:min(420px,88dvh);max-height:calc(100dvh - 16px)}
:root[data-font-scale="large"] #modalLayer.notes-modal .modal-header{flex:none;min-height:3em;padding:clamp(10px,1.4em,20px) 3.5em}
:root[data-font-scale="large"] #modalLayer.notes-modal .modal-body{flex:1;min-height:0;overflow:hidden}
:root[data-font-scale="large"] #modalLayer.notes-modal .notes-tabs{height:auto;min-height:2.7em;flex-wrap:wrap}
:root[data-font-scale="large"] #modalLayer.notes-modal .notes-tabs button{height:auto;min-height:2.7em;padding:.35em .5em;line-height:1.3;white-space:normal}
:root[data-font-scale="large"] #modalLayer.notes-modal .notes-search{height:auto;min-height:2.7em;padding-block:.3em;line-height:1.3}
:root[data-font-scale="large"] #modalLayer.notes-modal .notes-search input{height:auto;min-height:1.6em;min-width:0;line-height:1.35}
:root[data-font-scale="large"] #modalLayer.notes-modal .shared-notes-list{flex:1;min-height:0;overflow:auto;padding-bottom:calc(min(48px * var(--ui-scale, 1),76px) + 32px)}
:root[data-font-scale="large"] #modalLayer.notes-modal .shared-note-card{max-width:100%;overflow-wrap:anywhere;line-height:1.45}
:root[data-font-scale="large"] #modalLayer.notes-modal .shared-note-main{min-width:0;white-space:normal;overflow-wrap:anywhere}
:root[data-font-scale="large"] #modalLayer.notes-modal .note-card-menu{width:clamp(36px,calc(27px * var(--ui-scale, 1)),50px);height:clamp(36px,calc(27px * var(--ui-scale, 1)),50px);display:grid;place-items:center;font-size:clamp(20px,calc(18px * var(--ui-scale, 1)),36px)}
:root[data-font-scale="large"] #modalLayer.notes-modal .notes-fab{position:absolute;right:16px;bottom:16px;width:clamp(56px,calc(48px * var(--ui-scale, 1)),76px);height:clamp(56px,calc(48px * var(--ui-scale, 1)),76px);min-width:0;min-height:0;aspect-ratio:1;padding:0;border-radius:50%;display:grid;place-items:center;font-size:clamp(30px,calc(27px * var(--ui-scale, 1)),48px);line-height:1;white-space:nowrap;flex:none}
@media(max-width:760px){
  :root[data-font-scale="large"] #modalLayer.notes-modal .modal-card{width:calc(100vw - 12px);height:min(90dvh,850px);min-height:min(360px,90dvh);max-height:calc(100dvh - 12px)}
  :root[data-font-scale="large"] #modalLayer.notes-modal .notes-fab{right:14px;bottom:14px}
}
.message-video-still,.album-video-thumb{overflow:hidden}
.message-video-still>img,.album-video-thumb>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.message-video-still>i,.message-video-still>small,.album-video-thumb>i,.album-video-thumb>small{position:relative;z-index:1}
.message-video-still>i,.album-video-thumb>i{background:#1119}
.custom-color-controls{display:grid;gap:9px;margin-top:10px}
:root[data-color-scheme="custom"] .app-shell,:root[data-color-scheme="custom"] .sidebar,:root[data-color-scheme="custom"] .chat-panel,:root[data-color-scheme="custom"] .chat-header,:root[data-color-scheme="custom"] .composer,:root[data-color-scheme="custom"] .empty-state{background-color:var(--custom-background)!important;background-image:none!important}:root[data-color-scheme="custom"] .message-list{background-color:var(--custom-background);background-image:none}
:root[data-color-scheme="custom"] .app-shell,:root[data-color-scheme="custom"] .sidebar,:root[data-color-scheme="custom"] .chat-panel,:root[data-color-scheme="custom"] .chat-header,:root[data-color-scheme="custom"] .composer,:root[data-color-scheme="custom"] .message-list,:root[data-color-scheme="custom"] .empty-state,:root[data-color-scheme="custom"] .sidebar-tabs>button,:root[data-color-scheme="custom"] .profile-copy strong,:root[data-color-scheme="custom"] .conversation-item,:root[data-color-scheme="custom"] .conversation-title,:root[data-color-scheme="custom"] .chat-heading h2,:root[data-color-scheme="custom"] .sender-name,:root[data-color-scheme="custom"] .bubble,:root[data-color-scheme="custom"] .composer textarea,:root[data-color-scheme="custom"] .icon-button,:root[data-color-scheme="custom"] .sidebar-footer,:root[data-color-scheme="custom"] .empty-state h2{color:var(--custom-text)}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer){padding:clamp(6px,1.2vw,16px);overflow:auto;place-items:center}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-card{width:min(860px,calc(100vw - 16px));height:auto;min-width:0;min-height:0;max-height:calc(100dvh - 16px);flex:0 1 auto}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-header{position:relative;flex:none;min-width:0;min-height:2.8em;padding:clamp(8px,.8em,16px) clamp(44px,3em,62px);overflow-wrap:anywhere}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-header h2{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.3}
:root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-body{flex:1 1 auto;min-width:0;min-height:0;max-height:calc(100dvh - 5em);overflow:auto;overscroll-behavior:contain;padding:clamp(10px,1.5vw,20px)}
:root[data-font-scale="large"] #modalLayer.notes-modal .modal-card{width:min(720px,calc(100vw - 16px));height:min(88dvh,850px);min-height:min(300px,88dvh);max-height:calc(100dvh - 12px)}
:root[data-font-scale="large"] #modalLayer.notes-modal .modal-header{flex:none;min-height:2.8em;padding:clamp(8px,.8em,16px) 3.3em}
:root[data-font-scale="large"] #modalLayer.notes-modal .modal-body{flex:1 1 auto;max-height:none;overflow:hidden;padding:0}
:root[data-font-scale="large"] #modalLayer.note-editor-modal .modal-card{width:min(820px,calc(100vw - 16px));height:min(90dvh,820px);min-height:min(300px,90dvh);max-height:calc(100dvh - 12px)}
:root[data-font-scale="large"] #modalLayer.note-editor-modal .modal-body{flex:1 1 auto;max-height:none;overflow:auto;padding:0}
:root[data-font-scale="large"] #modalLayer.note-editor-modal .shared-note-editor{min-height:0}
:root[data-font-scale="large"] #modalLayer.note-editor-modal .note-editor{flex:1 1 auto;min-height:8em;max-height:42dvh;font-size:clamp(16px,calc(13px * var(--ui-scale, 1)),36px)}
:root[data-font-scale="large"] #modalLayer.note-editor-modal .note-compose-toolbar{min-height:2.8em;flex-wrap:wrap;padding-inline:clamp(8px,1.2em,18px)}
:root[data-font-scale="large"] #modalLayer.note-editor-modal .note-compose-toolbar>button,:root[data-font-scale="large"] #modalLayer.note-editor-modal .note-capture-wrap{flex:none;min-width:2.5em;width:auto;min-height:2.5em;height:auto}
:root[data-font-scale="large"] #modalLayer.note-editor-modal .note-editor-actions{flex-wrap:wrap;gap:8px;padding:8px clamp(8px,1em,16px) calc(8px + env(safe-area-inset-bottom))}
:root[data-font-scale="large"] #modalLayer.note-editor-modal .note-editor-actions>button{min-height:2.4em;height:auto;padding:.45em .8em}
:root[data-font-scale="large"] #modalLayer.message-media-viewer{padding:6px;overflow:auto}
:root[data-font-scale="large"] #modalLayer.message-media-viewer .modal-card{width:min(96vw,calc(100vw - 12px));min-width:0;max-width:96vw;max-height:calc(100dvh - 12px)}
:root[data-font-scale="large"] #modalLayer.message-media-viewer .modal-body{max-width:96vw;max-height:calc(100dvh - 4em);overflow:auto}
:root[data-font-scale="large"] #modalLayer.message-media-viewer .media-viewer-stage{width:100%;min-width:0;max-width:96vw;max-height:calc(100dvh - 7em);padding:clamp(34px,5vw,64px)}
:root[data-font-scale="large"] #modalLayer.message-media-viewer .media-viewer-content{max-width:calc(96vw - 2 * clamp(34px,5vw,64px));max-height:calc(100dvh - 10em)}
:root[data-font-scale="large"] .line-capture-editor{display:block;overflow:hidden}
:root[data-font-scale="large"] .capture-toolbar{display:flex;flex-wrap:wrap;align-content:flex-start;width:max-content;max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px);overflow:auto;overscroll-behavior:contain;padding:clamp(2px,.25em,6px);gap:clamp(1px,.1em,4px)}
:root[data-font-scale="large"] .capture-tool-set,:root[data-font-scale="large"] .capture-action-set{min-width:0;max-width:100%;flex-wrap:wrap;gap:1px}
:root[data-font-scale="large"] .capture-tool{flex:0 0 clamp(34px,calc(32px * var(--ui-scale, 1)),52px);width:clamp(34px,calc(32px * var(--ui-scale, 1)),52px);height:clamp(36px,calc(34px * var(--ui-scale, 1)),54px);font-size:clamp(18px,calc(18px * var(--ui-scale, 1)),32px);line-height:1}
:root[data-font-scale="large"] .capture-tool-palette{max-width:min(94vw,540px);max-height:40dvh;flex-wrap:wrap;overflow:auto;white-space:normal;gap:clamp(4px,.35em,10px)}
:root[data-font-scale="large"] .capture-help{max-width:calc(100vw - 20px);white-space:normal;text-align:center;line-height:1.35}
@media(max-width:760px){
  :root[data-font-scale="large"] #modalLayer:not(.message-media-viewer){padding:5px}
  :root[data-font-scale="large"] #modalLayer:not(.message-media-viewer) .modal-card{width:calc(100vw - 10px);max-height:calc(100dvh - 10px)}
  :root[data-font-scale="large"] #modalLayer.notes-modal .modal-card{width:calc(100vw - 10px);height:min(92dvh,850px);min-height:min(280px,92dvh)}
  :root[data-font-scale="large"] #modalLayer.note-editor-modal .modal-card{width:calc(100vw - 10px);height:min(92dvh,820px);min-height:min(280px,92dvh)}
  :root[data-font-scale="large"] #modalLayer.message-media-viewer .media-viewer-stage{padding:38px 32px}
  :root[data-font-scale="large"] #modalLayer.message-media-viewer .media-viewer-content{max-width:calc(96vw - 64px);max-height:calc(100dvh - 9em)}
}
.reply-preview{width:100%;min-height:52px;display:flex;align-items:center;gap:9px;position:relative;padding:5px 40px 5px 9px;border:1px solid #454648;border-radius:7px;background:#353638;color:#e9eaeb}
.reply-preview-bar{position:absolute;left:0;top:7px;bottom:7px;width:3px;border-radius:3px;background:var(--green)}
.reply-preview-copy,.message-reply-copy{min-width:0;display:grid;gap:3px;flex:1}
.reply-preview-copy strong,.message-reply-copy strong{overflow:hidden;color:var(--green);font-size:calc(10px * var(--ui-scale, 1));text-overflow:ellipsis;white-space:nowrap}
.reply-preview-copy>span,.message-reply-copy>span{overflow:hidden;color:inherit;font-size:calc(11px * var(--ui-scale, 1));text-overflow:ellipsis;white-space:nowrap}
.reply-preview>img,.reply-preview-video,.reply-preview-file{width:38px;height:38px;flex:none;display:grid;place-items:center;border-radius:4px;object-fit:cover;background:#48494b;color:#ddd}
.reply-preview-video{position:relative;overflow:hidden}.reply-preview-video>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.reply-preview-video>i{position:relative;z-index:1;font-style:normal;color:#fff;text-shadow:0 1px 4px #000}
.reply-preview>button{position:absolute;right:6px;top:50%;width:28px;height:28px;transform:translateY(-50%);border:0;border-radius:5px;background:transparent;color:#aeb0b1;font-size:calc(20px * var(--ui-scale, 1))}
.message-reply-quote{width:100%;min-width:0;display:flex;align-items:center;gap:8px;margin:0 0 7px;padding:6px 8px;border:0;border-left:3px solid var(--green);border-radius:4px;background:#0000000c;color:inherit;text-align:left}
.message-reply-quote:hover{background:#00000018}.message-reply-quote.is-deleted{opacity:.72;cursor:default}
.message-reply-thumb,.message-reply-file{width:42px;height:42px;flex:none;display:grid;place-items:center;border-radius:4px;object-fit:cover;background:#0002;color:inherit}
.message-reply-video{position:relative;overflow:hidden}.message-reply-video>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.message-reply-video>i{position:relative;z-index:1;color:#fff;text-shadow:0 1px 4px #000;font-style:normal}
.message-body-text{white-space:pre-wrap;overflow-wrap:anywhere}
:root[data-theme="dark"] .reply-preview{border-color:#4a4b4d;background:#363739;color:#e7e8e9}
:root[data-theme="light"] .reply-preview{border-color:#dce5df;background:#f3f7f5;color:#35413b}
:root[data-theme="light"] .message-reply-quote{background:#00000008}:root[data-theme="light"] .message-reply-quote:hover{background:#00000012}
.message-row.search-hit .bubble{outline:2px solid var(--green);outline-offset:3px}
.server-connection-notice{position:fixed;z-index:30000;inset:0;display:grid;place-items:center;padding:24px;pointer-events:none;color:#f5f6f6;text-align:center}
.server-connection-notice.hidden{display:none}
.connection-notice-card{max-width:min(94vw,480px);display:flex;flex-direction:column;align-items:center;gap:11px;padding:22px 26px;border:1px solid #66686a;border-radius:16px;background:#252628ed;box-shadow:0 16px 48px #0007;color:#f5f6f6;overflow-wrap:anywhere}
.connection-notice-card strong{font-size:calc(17px * var(--ui-scale, 1));font-weight:700}
.connection-notice-card>span:last-child{color:#d1d4d5;font-size:calc(13px * var(--ui-scale, 1))}
.connection-spinner{width:30px;height:30px;border:3px solid #ffffff4a;border-top-color:var(--green);border-radius:50%;animation:connection-spin .8s linear infinite}
@keyframes connection-spin{to{transform:rotate(360deg)}}
@media(max-width:760px){.reply-preview{min-height:48px;max-width:100%}.server-connection-notice{padding:16px}}
.sidebar-footer{height:auto;min-height:42px;flex-wrap:wrap;gap:6px;padding:7px 12px;line-height:1.3}
.server-status-label{white-space:nowrap}
.online-dot.is-online{background:#06c755}
.online-dot.is-offline{background:#ee5b5b;box-shadow:0 0 0 3px #ee5b5b22}
.online-dot.is-checking{background:#e6ad3c;box-shadow:0 0 0 3px #e6ad3c22}
.network-traffic{display:flex;align-items:center;gap:8px;margin-left:auto;color:inherit;font-size:calc(9px * var(--ui-scale, 1));font-variant-numeric:tabular-nums;white-space:nowrap}
.network-traffic b{font-weight:500}
.chat-cache-settings{min-width:0}
.chat-cache-settings .range-labels{align-items:center;gap:6px}
.chat-cache-settings .range-labels>span:nth-child(2){text-align:center}
@media(max-width:760px){.sidebar-footer{padding-inline:14px}}
:root[data-color-scheme="custom"]{--ink:var(--custom-text);--muted:color-mix(in srgb,var(--custom-text) 66%,var(--custom-background));--dialog-text:var(--custom-text);--dialog-label:var(--custom-text);--dialog-input-text:var(--custom-text);--dialog-muted:color-mix(in srgb,var(--custom-text) 70%,var(--custom-background));--dialog-placeholder:color-mix(in srgb,var(--custom-text) 58%,var(--custom-background))}
:root[data-color-scheme="custom"] .app-shell :is(h1,h2,h3,h4,p,span,strong,small,label,a,input,textarea,select,.avatar,button:not(.primary-button):not(.send-button):not(.text-button):not(.danger-menu-item):not(.delete-user-button):not(.sticker-delete):not(.rail-profile)){color:var(--custom-text)}
:root[data-color-scheme="custom"] .app-shell :is(input,textarea)::placeholder{color:color-mix(in srgb,var(--custom-text) 58%,var(--custom-background));opacity:1}
:root[data-color-scheme="custom"] #modalLayer:not(.message-media-viewer) .modal-card :is(h1,h2,h3,h4,p,span,strong,small,label,a,li,summary,pre,input:not([type="range"]):not([type="color"]),textarea,select,button:not(.primary-button):not(.text-button):not(.danger-menu-item):not(.delete-user-button):not(.sticker-delete)){color:var(--custom-text)}
:root[data-color-scheme="custom"] #modalLayer:not(.message-media-viewer) .modal-card :is(input,textarea)::placeholder{color:color-mix(in srgb,var(--custom-text) 58%,var(--custom-background));opacity:1}
:root[data-color-scheme="custom"] #chatContextMenu button{color:var(--custom-text)}
:root[data-color-scheme="custom"] .image-crop-dialog :is(h1,h2,h3,p,span,strong,small,label,button:not(.crop-confirm)){color:var(--custom-text)}
:root[data-font-scale] .app-shell,:root[data-font-scale] .sidebar{min-height:0}
:root[data-font-scale] .conversation-list{flex:1 1 0%;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#777 transparent}
:root[data-font-scale] .conversation-list::-webkit-scrollbar{width:8px}
:root[data-font-scale] .conversation-list::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:8px;background:#7778;background-clip:padding-box}
:root{--sidebar-width:303px}
@media(min-width:761px){#appView.app-shell{grid-template-columns:54px minmax(220px,var(--sidebar-width)) 6px minmax(0,1fr)}#appView .sidebar-resize-handle{grid-column:3;grid-row:1;z-index:5;cursor:col-resize;touch-action:none;background:linear-gradient(90deg,transparent 2px,#ffffff10 2px,#ffffff10 3px,transparent 3px)}#appView .sidebar-resize-handle:hover,#appView .sidebar-resize-handle:focus-visible{background:#06c75566;outline:0}#appView .sidebar-resize-handle:active{background:#06c755}#appView .chat-panel{grid-column:4;grid-row:1;min-width:0}}
@media(min-width:761px){:root[data-font-scale="large"] #appView.app-shell{grid-template-columns:54px minmax(220px,var(--sidebar-width)) 6px minmax(0,1fr)}:root[data-font-scale="large"] #appView .sidebar-resize-handle{grid-column:3;grid-row:1}:root[data-font-scale="large"] #appView .chat-panel{grid-column:4;grid-row:1}}
@media(max-width:760px){#appView .sidebar-resize-handle{display:none}#appView .sidebar{position:relative;z-index:1;transition:transform .24s ease,opacity .24s ease}#appView .chat-panel{z-index:2;display:block!important;visibility:hidden;transform:translateX(100%);transition:transform .24s ease,visibility 0s linear .24s}#appView.chat-open .sidebar{transform:translateX(-24%);opacity:.72;pointer-events:none}#appView.chat-open .chat-panel{visibility:visible;transform:translateX(0);transition:transform .24s ease,visibility 0s}#appView .active-chat{transition:opacity .18s ease}#appView:not(.chat-open) .active-chat{opacity:.95}}
@media(max-width:760px){:root[data-font-scale="large"] #appView .sidebar{overflow:hidden}:root[data-font-scale="large"] #appView .conversation-list{flex:1 1 0%;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto}}
:root[data-color-scheme="custom"] :is(.toast,.connection-notice-card,.message-media-viewer .modal-card,.message-media-viewer .modal-header,.message-media-viewer .media-viewer-footer){color:var(--custom-text)}
:root[data-color-scheme="custom"] :is(.toast,.connection-notice-card,.message-media-viewer) :is(h1,h2,h3,p,span,strong,small,label,button:not(.media-viewer-nav)){color:var(--custom-text)}
.avatar img{display:block;width:100%;height:100%;border-radius:inherit;object-fit:cover}
.avatar :is(img,video){display:block;width:100%;height:100%;border-radius:inherit;object-fit:cover}
.profile-avatar-setting video,.rail-profile video,.profile-row .avatar video,.chat-avatar video,.member-profile-avatar video{width:100%;height:100%;border-radius:inherit;object-fit:cover}
.profile-cover-preview>video,.member-profile-cover video{position:absolute;width:100%;height:100%;object-fit:cover}
.member-profile-cover{position:relative}
.profile-media-hint{margin:0;color:#89948e;font-size:calc(10px * var(--ui-scale, 1));line-height:1.5;overflow-wrap:anywhere}
:root[data-theme="dark"] .profile-media-hint{color:#a7aaab}
.member-profile-row{display:flex;min-width:0;align-items:center;gap:9px}
.member-list-avatar{width:34px;height:34px;flex:none;border-radius:50%;font-size:calc(11px * var(--ui-scale, 1))}
.message-avatar{border-radius:50%}
.protected-admin-hint{max-width:210px;flex:none;text-align:right}
.custom-color-picker-group{display:grid;gap:7px;min-width:0}
.custom-color-swatches{display:grid;grid-template-columns:repeat(12,minmax(14px,1fr));gap:5px;padding:3px 2px 5px}
.custom-color-swatch{width:clamp(15px,calc(17px * var(--ui-scale, 1)),24px);height:clamp(15px,calc(17px * var(--ui-scale, 1)),24px);justify-self:center;padding:0;border:1px solid #0004;border-radius:50%;background:var(--swatch);box-shadow:inset 0 0 0 1px #ffffff28}
.custom-color-swatch:hover{transform:scale(1.12)}
.custom-color-swatch.selected{outline:2px solid var(--green);outline-offset:2px}
:root[data-theme="dark"] .custom-color-swatch{border-color:#ffffff65}
:root[data-ios-standalone="true"] #messageInput{font-size:max(16px,calc(12px * var(--ui-scale, 1)))}

/* Center status messages so important feedback is visible on desktop and phones. */
.toast{z-index:25000;top:50%;bottom:auto;left:50%;width:min(520px,calc(100vw - 32px));min-height:76px;display:flex;align-items:center;justify-content:center;padding:22px 26px;border:1px solid #ffffff28;border-radius:18px;text-align:center;font-size:calc(16px * var(--ui-scale, 1));line-height:1.5;font-weight:600;box-shadow:0 18px 60px #0005;backdrop-filter:blur(14px);transform:translate(-50%,calc(-50% + 14px));opacity:0;pointer-events:none}
.toast.show{opacity:1;transform:translate(-50%,-50%)}
.toast-success{background:#087f64;color:#fff}
.toast-error{background:#a83232;color:#fff}
.toast-info{background:#30383a;color:#fff}
.toast-prominent{min-height:92px;padding:26px 30px;border-width:2px;font-size:calc(18px * var(--ui-scale, 1));}
.toast:before{width:30px;height:30px;flex:none;display:grid;place-items:center;margin-right:12px;border:2px solid currentColor;border-radius:50%;font-size:calc(18px * var(--ui-scale, 1));font-weight:800;line-height:1}
.toast-success:before{content:'✓'}
.toast-error:before{content:'!'}
.toast-info:before{content:'i'}
:root[data-theme="light"] .toast-info{background:#24322d;color:#fff}
:root[data-color-scheme="custom"] .toast.toast-success,:root[data-color-scheme="custom"] .toast.toast-error,:root[data-color-scheme="custom"] .toast.toast-info{color:#fff}
@media(max-width:760px){.toast{width:min(520px,calc(100vw - 28px));min-height:82px;padding:20px;font-size:calc(15px * var(--ui-scale, 1))}.toast-prominent{min-height:96px;padding:24px;font-size:calc(17px * var(--ui-scale, 1))}}

.image-crop-canvas.chat-background-crop-canvas{aspect-ratio:16/9}
.image-crop-dialog.chat-background-crop-dialog{width:min(1100px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:clamp(12px,2vw,24px)}
.chat-background-crop-canvas{display:block;max-width:100%;max-height:58dvh;margin-inline:auto;flex:none;aspect-ratio:auto}
@media(max-width:760px){.image-crop-dialog.chat-background-crop-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:12px}.chat-background-crop-dialog .chat-background-crop-canvas{max-height:58dvh}}

.calendar-modal .modal-card{width:min(820px,calc(100vw - 28px));height:min(900px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);overflow:hidden;border-radius:18px}
.calendar-modal .modal-header{display:none}
.calendar-modal .modal-body{height:100%;max-height:100%;padding:0;overflow:hidden}
.chat-calendar-page,.calendar-settings-page{position:relative;display:flex;height:100%;min-height:0;flex-direction:column;overflow:hidden;background:var(--dialog-surface);color:var(--dialog-text)}
.calendar-page-header{height:62px;min-height:62px;display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;gap:8px;padding:0 18px;border-bottom:1px solid var(--dialog-border)}
.calendar-page-header strong{overflow:hidden;font-size:calc(17px * var(--ui-scale, 1));font-weight:700;text-overflow:ellipsis;white-space:nowrap}
.calendar-back,.calendar-settings-button{width:40px;height:40px;border:0;border-radius:50%;background:transparent;color:var(--dialog-text);font-size:calc(27px * var(--ui-scale, 1))}
.calendar-back{font-size:calc(34px * var(--ui-scale, 1));line-height:1}
.calendar-settings-button{justify-self:end;font-size:calc(20px * var(--ui-scale, 1))}
.calendar-month-toolbar{height:58px;min-height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 18px}
.calendar-month-toolbar>button{min-width:42px;height:40px;border:0;border-radius:8px;background:transparent;color:var(--dialog-text);font-size:calc(22px * var(--ui-scale, 1))}
.calendar-month-toolbar .calendar-month-select{width:auto;font-size:calc(19px * var(--ui-scale, 1));font-weight:700}
#calendarMonthPicker{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}
.calendar-weekdays,.calendar-month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));padding:0 12px}
.calendar-weekdays{height:34px;min-height:34px;align-items:center;border-bottom:1px solid var(--dialog-border);color:var(--dialog-muted);text-align:center;font-size:calc(12px * var(--ui-scale, 1))}
.calendar-weekdays .sunday{color:#d94b5a}
.calendar-month-grid{grid-auto-rows:minmax(43px,1fr);flex:none;padding-top:5px}
.calendar-day{position:relative;min-width:0;min-height:42px;display:grid;place-items:center;align-content:center;gap:2px;border:0;border-radius:50%;background:transparent;color:var(--dialog-text);font-size:calc(13px * var(--ui-scale, 1));font-weight:600}
.calendar-day.outside{color:var(--dialog-muted);opacity:.42}
.calendar-day.today span{outline:1px solid var(--dialog-muted);outline-offset:4px;border-radius:50%}
.calendar-day.selected{background:var(--green);color:#fff}
.calendar-day.selected.today span{outline:0}
.calendar-day.has-events i{width:4px;height:4px;border-radius:50%;background:var(--green);position:absolute;bottom:3px}
.calendar-day.selected.has-events i{background:#fff}
.calendar-agenda{min-height:0;flex:1;display:flex;flex-direction:column;gap:7px;overflow:hidden;padding:12px 18px 58px;border-top:1px solid var(--dialog-border)}
.calendar-agenda h2{margin:0;font-size:calc(15px * var(--ui-scale, 1));font-weight:700}
.calendar-agenda .calendar-event-list{max-height:none;min-height:0;flex:1;align-content:start;overflow:auto}
.calendar-add-event{position:absolute;right:22px;bottom:20px;width:58px;height:58px;border:0;border-radius:50%;background:var(--green);color:#fff;font-size:calc(34px * var(--ui-scale, 1));line-height:1;box-shadow:0 5px 18px #0003}
.calendar-event-card{border-color:var(--dialog-border);background:var(--dialog-surface-raised);color:var(--dialog-text)}
.calendar-event-card h3{color:var(--dialog-text)}
.calendar-event-card p{color:var(--dialog-muted)}
.calendar-event-footer{color:var(--dialog-muted)}
.calendar-settings-page{overflow:auto}
.calendar-setting-section{padding:26px 28px;border-bottom:1px solid var(--dialog-border)}
.calendar-setting-section h2{margin:0 0 22px;font-size:calc(16px * var(--ui-scale, 1));font-weight:500}
.calendar-setting-row{min-height:58px;display:flex;align-items:center;gap:14px;font-size:calc(16px * var(--ui-scale, 1))}
.calendar-setting-row strong{min-width:0;flex:1;overflow-wrap:anywhere}
.calendar-check{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:#7069ca;color:#fff;font-size:calc(18px * var(--ui-scale, 1))}
.calendar-favorite{width:40px;height:40px;border:0;background:transparent;color:#a6aaac;font-size:calc(29px * var(--ui-scale, 1))}
.calendar-favorite.active{color:#e0ad36}
.calendar-setting-empty{margin:0;color:var(--dialog-muted);font-size:calc(14px * var(--ui-scale, 1))}
.calendar-sync-row{width:100%;min-height:54px;display:flex;align-items:center;gap:12px;border:0;background:transparent;color:var(--dialog-text);text-align:left;font-size:calc(15px * var(--ui-scale, 1))}
.calendar-sync-row b{margin-left:auto;color:var(--dialog-muted);font-size:calc(24px * var(--ui-scale, 1));font-weight:400}
.calendar-cancel-settings{margin:auto auto 18px;padding:10px 24px;border:0;background:transparent;color:var(--green);font-size:calc(16px * var(--ui-scale, 1))}
.calendar-event-editor{height:100%;max-height:100%;gap:0;overflow:auto;padding:0 clamp(18px,5vw,50px) 26px;background:var(--dialog-surface);color:var(--dialog-text)}
.calendar-event-editor .calendar-page-header{position:sticky;z-index:2;top:0;margin:0 calc(clamp(18px,5vw,50px)*-1);padding-inline:18px;background:var(--dialog-surface)}
.calendar-create-submit{justify-self:end;border:0;background:transparent;color:var(--green);font-size:calc(15px * var(--ui-scale, 1));font-weight:700}
.calendar-event-title{width:100%;height:94px;margin:6px 0 12px;border:0;outline:0;background:transparent;color:var(--dialog-text);font-size:calc(28px * var(--ui-scale, 1));font-weight:700}
.calendar-event-title::placeholder,.calendar-editor-input input::placeholder,.calendar-editor-input textarea::placeholder{color:var(--dialog-placeholder)}
.calendar-all-day{height:62px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--dialog-border);font-size:calc(16px * var(--ui-scale, 1))}
.calendar-all-day>span,.calendar-editor-row>span,.calendar-editor-input>span{width:30px;flex:none;font-size:calc(21px * var(--ui-scale, 1))}
.calendar-all-day input{position:absolute;opacity:0}
.calendar-all-day i{width:46px;height:26px;position:relative;margin-left:auto;border-radius:20px;background:#c9ccce}
.calendar-all-day i:after{position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0003;content:'';transition:transform .18s}
.calendar-all-day input:checked+i{background:var(--green)}
.calendar-all-day input:checked+i:after{transform:translateX(20px)}
.calendar-date-row{min-height:78px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding-left:42px}
.calendar-date-row>strong{font-size:calc(15px * var(--ui-scale, 1))}
.calendar-date-row>div{display:flex;gap:8px;min-width:0}
.calendar-date-input,.calendar-time-input{height:42px;min-width:0;padding:0 10px;border:0;border-radius:24px;background:var(--dialog-surface-raised);color:var(--dialog-text);font:inherit;font-size:calc(13px * var(--ui-scale, 1))}
.calendar-date-input{width:clamp(130px,28vw,220px)}
.calendar-time-input{width:clamp(92px,18vw,130px)}
.calendar-event-editor.all-day .calendar-time-input{opacity:.4}
.calendar-editor-divider{height:1px;margin:14px 0;border-top:1px solid var(--dialog-border)}
.calendar-editor-row{width:100%;min-height:68px;display:flex;align-items:center;gap:10px;border:0;border-bottom:1px solid var(--dialog-border);background:transparent;color:var(--dialog-text);text-align:left}
.calendar-editor-row strong{font-size:calc(15px * var(--ui-scale, 1))}
.calendar-editor-row small{max-width:52%;overflow:hidden;margin-left:auto;color:var(--dialog-muted);font-size:calc(13px * var(--ui-scale, 1));text-overflow:ellipsis;white-space:nowrap}
.calendar-editor-row>b{color:var(--dialog-muted);font-size:calc(21px * var(--ui-scale, 1));font-weight:400}
.calendar-editor-row select{max-width:48%;margin-left:auto;border:0;background:transparent;color:var(--dialog-muted);font-size:calc(13px * var(--ui-scale, 1));text-align:right}
.calendar-editor-input{min-height:62px;display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--dialog-border)}
.calendar-editor-input input,.calendar-editor-input textarea{width:100%;min-height:48px;border:0;outline:0;background:transparent;color:var(--dialog-text);font:inherit;font-size:calc(14px * var(--ui-scale, 1));resize:vertical}
.calendar-editor-input textarea{height:80px;padding-top:15px}
.calendar-editor-hint{margin:14px 0 0;color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale, 1))}
:root[data-color-scheme="custom"] #modalLayer.calendar-modal .modal-card,:root[data-color-scheme="custom"] #modalLayer.calendar-modal .modal-body,:root[data-color-scheme="custom"] #modalLayer.calendar-modal .calendar-event-editor{background:var(--custom-background);color:var(--custom-text)}
:root[data-color-scheme="custom"] #modalLayer.calendar-modal{--dialog-surface:var(--custom-background);--dialog-surface-raised:color-mix(in srgb,var(--custom-background) 88%,var(--custom-text));--dialog-border:color-mix(in srgb,var(--custom-text) 22%,var(--custom-background));--dialog-muted:color-mix(in srgb,var(--custom-text) 68%,var(--custom-background));--dialog-placeholder:color-mix(in srgb,var(--custom-text) 58%,var(--custom-background))}
:root[data-color-scheme="custom"] #modalLayer.calendar-modal .calendar-event-editor :is(input,textarea,select,button,strong,h2,h3,p,small){color:var(--custom-text)}
@media(max-width:760px){.calendar-modal{padding:0}.calendar-modal .modal-card{width:100vw;height:100dvh;max-height:100dvh;border-radius:18px 18px 0 0}.calendar-page-header{height:58px;min-height:58px;padding:0 14px}.calendar-month-grid{grid-auto-rows:minmax(46px,1fr);padding-inline:8px}.calendar-agenda{padding-inline:12px}.calendar-add-event{right:18px;bottom:calc(16px + env(safe-area-inset-bottom))}.calendar-setting-section{padding:22px 18px}.calendar-date-row{padding-left:0;gap:6px}.calendar-date-row>div{gap:4px}.calendar-date-input{width:clamp(118px,35vw,180px);padding-inline:7px}.calendar-time-input{width:clamp(84px,23vw,110px);padding-inline:6px}.calendar-event-editor{padding-inline:18px}.calendar-event-editor .calendar-page-header{margin-inline:-18px}.calendar-editor-row{gap:6px}.calendar-editor-row small{max-width:44%}}
.sticker-store{display:grid;gap:14px}.sticker-store-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:12px}.sticker-store-card{display:grid;justify-items:center;align-content:start;gap:9px;min-width:0;padding:12px;border:1px solid var(--dialog-border);border-radius:12px;background:var(--dialog-surface-raised);color:var(--dialog-text)}.sticker-store-preview{display:grid;width:min(100%,112px);aspect-ratio:1;place-items:center;border-radius:26%;background:var(--sticker-bg);font-size:calc(58px * var(--ui-scale,1));line-height:1}.sticker-store-card>strong{font-size:calc(12px * var(--ui-scale,1))}.sticker-store-card button{width:100%;min-height:34px}.sticker-store-card button:disabled{opacity:.7;cursor:default}.sticker-store-launcher{font-size:calc(19px * var(--ui-scale,1));font-weight:700}
.sticker-pack-section{display:grid;gap:12px;padding:14px;border:1px solid var(--dialog-border);border-radius:14px;background:var(--dialog-surface-raised)}.sticker-pack-section>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.sticker-pack-section>header>div{display:grid;gap:4px}.sticker-pack-section>header strong{font-size:calc(15px * var(--ui-scale,1))}.sticker-pack-section>header small{color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale,1))}.sticker-pack-preview{width:min(100%,112px);aspect-ratio:1;background-color:#fff;background-image:var(--pack-image);background-repeat:no-repeat;background-size:400% 400%;background-position:var(--pack-x) var(--pack-y)}.sticker-store-subheading{margin:4px 0 0;font-size:calc(14px * var(--ui-scale,1))}
.sticker-store-search{height:42px;display:flex;align-items:center;gap:8px;padding:0 12px;border:1px solid var(--dialog-border);border-radius:10px;background:var(--dialog-surface-raised);color:var(--dialog-muted)}.sticker-store-search>span{font-size:22px;line-height:1}.sticker-store-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--dialog-text);font:inherit;font-size:calc(13px * var(--ui-scale,1))}.sticker-store-search input::placeholder{color:var(--dialog-muted)}.sticker-store-search button{width:28px;height:28px;flex:none;border:0;border-radius:50%;background:transparent;color:var(--dialog-muted);font-size:20px}.sticker-pack-list-card{display:flex;align-items:center;gap:14px;padding:12px;border:1px solid var(--dialog-border);border-radius:14px;background:var(--dialog-surface-raised);color:var(--dialog-text)}.sticker-pack-list-card>.sticker-pack-preview{width:74px;flex:none}.sticker-pack-list-info{min-width:0;display:grid;justify-items:start;gap:6px}.sticker-pack-list-info strong{font-size:calc(14px * var(--ui-scale,1))}.sticker-pack-list-info small{color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale,1))}.sticker-store-heading{display:grid;justify-items:start;gap:8px}.sticker-store-heading .appearance-hint{margin:0}
.sticker-store-launcher{width:auto;min-width:48px;padding:0 8px;font-size:calc(13px * var(--ui-scale,1));white-space:nowrap}.chat-tools .icon-button.sticker-store-launcher{flex:0 0 auto;width:auto;min-width:48px;padding-inline:8px;font-size:calc(12px * var(--ui-scale,1))}
@media(max-width:560px){.sticker-store-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sticker-store-preview{width:min(100%,130px)}}

/* LINE-like, touch-friendly calling screen */
.call-overlay{z-index:20000;padding:12px;background:rgba(12,14,14,.82);backdrop-filter:blur(10px)}
.call-card{width:min(430px,calc(100vw - 24px));min-height:min(620px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);gap:20px;padding:26px 24px 22px;border:1px solid color-mix(in srgb,var(--dialog-text,#fff) 12%,transparent);border-radius:28px;background:linear-gradient(165deg,color-mix(in srgb,var(--dialog-surface,#242528) 92%,#777),var(--dialog-surface,#242528) 62%);color:var(--dialog-text,#fff)}
.call-brand{position:absolute;top:18px;left:20px;color:var(--dialog-muted,#aaa);font-size:calc(11px * var(--ui-scale,1));letter-spacing:.04em}
.call-avatar{width:clamp(96px,24vw,132px);height:clamp(96px,24vw,132px);flex:none;display:grid;place-items:center;border:1px solid #ffffff22;border-radius:50%;background:linear-gradient(145deg,#2ebc91,#087f64);color:#fff;font-size:calc(42px * var(--ui-scale,1));font-weight:700;box-shadow:0 12px 32px #0004}
.call-info{gap:9px}.call-info strong{font-size:calc(23px * var(--ui-scale,1));font-weight:700}.call-info span{font-size:calc(14px * var(--ui-scale,1))}
.call-card #callRemoteAudio{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}
.call-card #callRemoteVideo:not(.hidden){width:100%;height:min(52dvh,420px);flex:1;object-fit:cover;border-radius:20px;background:#111}
.call-card #callLocalVideo:not(.hidden){z-index:2;right:18px;top:54px;width:min(25%,120px);aspect-ratio:3/4;object-fit:cover;border:1px solid #ffffff55;border-radius:14px;box-shadow:0 8px 20px #0005}
.call-overlay.call-video-connected .call-avatar{display:none}.call-overlay.call-video-connected .call-info{width:100%;padding-top:4px}
.call-actions{width:100%;gap:clamp(10px,4vw,22px);align-items:center}.call-choice-actions{justify-content:center;gap:clamp(52px,18vw,100px);margin-top:auto;padding-top:16px}
.call-actions button{min-width:70px;min-height:70px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:9px;border:0;border-radius:50%;background:var(--dialog-surface-raised,#3a3b3d);color:var(--dialog-text,#fff);box-shadow:0 4px 14px #0003}
.call-actions button>span{font-size:calc(25px * var(--ui-scale,1));line-height:1}.call-actions button>small{font-size:calc(10px * var(--ui-scale,1));line-height:1.15;white-space:nowrap}.call-choice-actions button{width:76px;height:76px}.call-active-actions{justify-content:center;margin-top:auto;padding-top:18px}.call-progress-actions{justify-content:center;margin-top:auto;padding-top:18px}.call-progress-actions button{width:78px;height:78px}
.call-actions button>svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.call-actions .call-accept{background:#14b866;color:#fff}.call-actions .call-danger{background:#e5464b;color:#fff}.call-actions button:active{transform:scale(.94)}
@media(max-width:560px){.call-card{width:min(430px,calc(100vw - 20px));min-height:min(600px,calc(100dvh - 28px));max-height:calc(100dvh - 28px);padding:32px 20px calc(24px + env(safe-area-inset-bottom));border-radius:26px}.call-card #callLocalVideo:not(.hidden){right:12px;top:48px}.call-active-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.call-active-actions button{width:min(68px,18vw);height:min(68px,18vw);min-width:0;min-height:0;justify-self:center;padding:5px}.call-active-actions button>small{font-size:calc(9px * var(--ui-scale,1))}}

/* Keep calls active as a movable, non-modal picture-in-picture style widget. */
.call-overlay{inset:auto 14px 82px auto;z-index:90;display:block;width:auto;padding:0;transform:translate(var(--call-drag-x,0px),var(--call-drag-y,0px));pointer-events:none;background:transparent;backdrop-filter:none}
.call-overlay.hidden{display:none}
.call-card{width:min(340px,calc(100vw - 24px));min-height:0;max-height:min(72dvh,620px);gap:10px;justify-content:flex-start;overflow:auto;padding:48px 16px 14px;border-radius:20px;pointer-events:auto;box-shadow:0 12px 36px #0007}
.call-brand{position:absolute;inset:0 0 auto;min-height:38px;display:flex;align-items:center;gap:8px;padding:0 10px 0 14px;border-bottom:1px solid color-mix(in srgb,var(--dialog-text,#fff) 12%,transparent);cursor:grab;touch-action:none;user-select:none}
.call-brand.dragging{cursor:grabbing}
.call-brand>span:first-child{flex:none}
.call-brand #callMiniSummary{min-width:0;flex:1;overflow:hidden;color:var(--dialog-text,#fff);font-size:calc(11px * var(--ui-scale,1));text-overflow:ellipsis;white-space:nowrap}
.call-brand button{width:28px;height:28px;flex:none;border:0;border-radius:8px;background:transparent;color:var(--dialog-text,#fff);font-size:20px;line-height:1}
.call-brand button:hover{background:color-mix(in srgb,var(--dialog-text,#fff) 12%,transparent)}
.call-avatar{width:72px;height:72px;font-size:calc(27px * var(--ui-scale,1));box-shadow:0 6px 18px #0003}
.call-info{gap:4px}.call-info strong{font-size:calc(16px * var(--ui-scale,1))}.call-info span{font-size:calc(12px * var(--ui-scale,1))}
.call-card #callRemoteVideo:not(.hidden){height:min(30dvh,190px);max-height:min(30dvh,190px);flex:none;object-fit:contain}
.call-card #callLocalVideo:not(.hidden){top:48px;right:12px;width:min(23%,84px)}
.call-actions{gap:10px}.call-actions button{width:56px;height:56px;min-width:56px;min-height:56px;gap:3px;padding:5px}.call-actions button>svg{width:22px;height:22px}.call-actions button>span{font-size:calc(21px * var(--ui-scale,1))}.call-actions button>small{font-size:calc(9px * var(--ui-scale,1))}
.call-choice-actions{gap:clamp(28px,12vw,62px);margin-top:4px;padding-top:4px}.call-choice-actions button{width:58px;height:58px}.call-active-actions,.call-progress-actions{margin-top:4px;padding-top:4px}.call-progress-actions button{width:60px;height:60px}
.call-overlay.call-collapsed{width:min(320px,calc(100vw - 24px))}.call-collapsed .call-card{width:100%;min-height:0;max-height:none;overflow:hidden;padding:0;border-radius:13px}.call-collapsed .call-brand{position:relative;min-height:42px;border:0;border-radius:13px;background:var(--dialog-surface,#242528)}.call-collapsed .call-brand>span:first-child{display:none}.call-collapsed .call-brand #callMiniSummary{font-size:calc(12px * var(--ui-scale,1))}.call-collapsed .call-card>:not(.call-brand){display:none!important}
@media(max-width:560px){.call-overlay{right:8px;bottom:calc(82px + env(safe-area-inset-bottom))}.call-card{width:min(330px,calc(100vw - 16px));max-height:58dvh;padding:46px 12px 12px;border-radius:18px}.call-avatar{width:62px;height:62px}.call-card #callRemoteVideo:not(.hidden){height:min(24dvh,150px);max-height:min(24dvh,150px)}.call-active-actions{display:flex;grid-template-columns:none;gap:8px}.call-active-actions button{width:52px;height:52px;min-width:52px;min-height:52px}.call-overlay.call-collapsed{width:min(300px,calc(100vw - 16px))}}

/* Keep the sticker store visible and reachable in the main sidebar at every scale. */
:root{--sidebar-width:340px}
.sidebar-tabs{height:auto;min-height:46px;flex-wrap:wrap;align-items:center;gap:0}
.sidebar-tabs>button{flex:0 0 auto;min-height:40px;white-space:nowrap}
.sidebar-tabs .sticker-store-launcher{display:inline-flex;width:auto;min-width:48px;height:34px;min-height:34px;align-items:center;justify-content:center;margin:0 2px;padding:0 8px;border:1px solid var(--line);border-radius:7px;background:transparent;color:var(--ink);font-size:calc(11px * var(--ui-scale,1));font-weight:600;line-height:1}
.sidebar-tabs .sticker-store-launcher:hover{background:color-mix(in srgb,var(--ink) 8%,transparent)}
@media(min-width:761px){#appView.app-shell{grid-template-columns:54px minmax(260px,min(var(--sidebar-width),35vw)) 6px minmax(0,1fr)}}
@media(max-width:760px){.sidebar-tabs{padding-inline:8px}.sidebar-tabs>button{min-height:38px;padding-inline:9px}.sidebar-tabs .sticker-store-launcher{height:32px;min-height:32px;min-width:44px;padding-inline:7px}}
@media(max-width:390px){.sidebar-tabs{gap:0;padding-inline:4px}.sidebar-tabs>button{padding-inline:6px}.sidebar-tabs .sticker-store-launcher{min-width:40px;padding-inline:5px}.sidebar-tabs .sidebar-filter{padding-inline:5px}}

/* Keep the mobile chat title readable when the user's text scale is enlarged. */
@media(max-width:760px){
  #appView .chat-header{height:64px;min-height:64px;flex-wrap:nowrap;gap:clamp(3px,1.5vw,8px);overflow:hidden;padding-inline:6px}
  #appView .mobile-back{flex:0 0 30px;width:30px;min-width:30px;height:40px;min-height:40px;padding:0}
  #appView .chat-avatar{flex:0 0 clamp(30px,10vw,40px);width:clamp(30px,10vw,40px);height:clamp(30px,10vw,40px);overflow:hidden}
  #appView .chat-heading{flex:1 1 auto;min-width:0;max-width:100%;overflow:hidden;white-space:nowrap}
  #appView .chat-heading h2{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:clamp(12px,calc(14px * var(--ui-scale,1)),19px);line-height:1.25}
  #appView .chat-heading span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:clamp(10px,calc(10px * var(--ui-scale,1)),14px)}
  #appView .chat-tools{flex:0 1 auto;min-width:0;max-width:54%;flex-wrap:nowrap;gap:1px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain}
  #appView .chat-tools::-webkit-scrollbar{display:none}
  #appView .chat-tools .icon-button{flex:0 0 34px;width:34px;min-width:34px;height:40px;min-height:40px;padding:0;font-size:20px}
  #appView .chat-tools svg{flex:none;width:20px;height:20px}
}

/* Keep the chat overflow actions reachable on small screens and at larger text scales. */
#chatMoreMenu{max-height:min(72dvh,600px);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}

.unread-divider{display:flex;align-items:center;gap:12px;margin:18px 0 20px;color:var(--green);font-size:calc(11px * var(--ui-scale,1));font-weight:700;white-space:nowrap}
.unread-divider::before,.unread-divider::after{content:"";height:1px;flex:1;background:color-mix(in srgb,var(--green) 48%,transparent)}
:root[data-theme="dark"] .unread-divider::before,:root[data-theme="dark"] .unread-divider::after{background:color-mix(in srgb,var(--green) 62%,#424447)}
.sticker-pack-preview{background-size:calc(var(--pack-cols,4)*100%) calc(var(--pack-rows,4)*100%)}

.sticker-store-modal{display:grid;gap:12px;min-width:0}.sticker-store-tabs{display:flex;gap:8px;border-bottom:1px solid var(--dialog-border);padding:0 2px 8px}.sticker-store-tabs button{min-height:38px;padding:0 14px;border:0;border-radius:9px;background:transparent;color:var(--dialog-muted);font:inherit;font-size:calc(13px * var(--ui-scale,1));cursor:pointer}.sticker-store-tabs button.active{background:var(--dialog-surface-raised);color:var(--dialog-text);font-weight:700}.sticker-my-settings{display:grid;gap:12px;min-width:0}.sticker-my-settings>.appearance-hint{margin:0;color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale,1));line-height:1.5}.sticker-pref-list{display:grid;gap:8px;max-height:min(58dvh,620px);overflow:auto;overscroll-behavior:contain;padding:2px}.sticker-pref-row{display:flex;align-items:center;gap:10px;min-width:0;padding:10px;border:1px solid var(--dialog-border);border-radius:12px;background:var(--dialog-surface-raised);color:var(--dialog-text);cursor:grab;transition:opacity .15s,transform .18s,border-color .15s}.sticker-pref-row.is-hidden{opacity:.62}.sticker-pref-row.is-dragging{opacity:.35;border-color:var(--custom-accent,var(--green));transform:scale(.985)}.sticker-pref-grip{flex:none;color:var(--dialog-muted);font-size:20px;touch-action:none}.sticker-pref-info{display:grid;gap:3px;flex:1 1 auto;min-width:0}.sticker-pref-info strong{overflow-wrap:anywhere;font-size:calc(13px * var(--ui-scale,1))}.sticker-pref-info small{color:var(--dialog-muted);font-size:calc(10px * var(--ui-scale,1))}.sticker-pref-controls{display:flex;align-items:center;gap:4px;flex:none}.sticker-pref-move{width:34px;height:34px;border:1px solid var(--dialog-border);border-radius:8px;background:transparent;color:var(--dialog-text);font-size:16px;cursor:pointer}.sticker-pref-move:disabled{opacity:.38;cursor:default}.sticker-pref-controls .settings-switch{width:42px;height:24px}.sticker-pref-controls .settings-switch i{width:18px;height:18px}.sticker-pref-controls .settings-switch.is-on i{transform:translateX(18px)}
@media(max-width:520px){.sticker-pref-row{gap:6px;padding:8px}.sticker-pref-grip{font-size:17px}.sticker-pref-move{width:30px;height:32px}.sticker-pref-controls .settings-switch{width:38px}.sticker-pref-controls .settings-switch.is-on i{transform:translateX(14px)}}
.sticker-pref-fixed{flex:none;padding:5px 8px;border:1px solid var(--dialog-border);border-radius:999px;color:var(--dialog-muted);font-size:calc(10px * var(--ui-scale,1));white-space:nowrap}
.sticker-pref-edit{width:34px;height:34px;flex:none;border:1px solid var(--dialog-border);border-radius:8px;background:transparent;color:var(--dialog-muted);font-size:17px;line-height:1}.sticker-pref-edit:hover{background:var(--dialog-hover);color:var(--dialog-text)}
@media(max-width:520px){.sticker-pref-edit{width:30px;height:32px;font-size:15px}}
@media(max-width:760px){.toast{top:calc(env(safe-area-inset-top,0px) + 16.67dvh);right:14px;bottom:auto;left:50%;transform:translate(-50%,calc(-50% + 14px));}.toast.show{transform:translate(-50%,-50%)}}

.shared-note-media-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;max-width:100%;margin:8px 0 2px;overflow:hidden;border-radius:5px}
.shared-note-media-grid.is-single{grid-template-columns:minmax(0,1fr);max-width:min(100%,260px)}
.shared-note-media-thumb{position:relative;display:block;min-width:0;aspect-ratio:4/3;padding:0;overflow:hidden;border:0;border-radius:3px;background:#252729;cursor:pointer}
.shared-note-media-thumb img,.shared-note-media-thumb .album-video-thumb{display:block;width:100%;height:100%;object-fit:cover}
.shared-note-media-thumb .album-video-thumb img{width:100%;height:100%;object-fit:cover}
.shared-note-media-thumb .album-video-thumb{position:relative;overflow:hidden;padding:0;background:#252729}
.shared-note-media-thumb .album-video-thumb i{position:absolute;inset:0;display:grid;width:auto;height:auto;place-items:center;border:0;border-radius:0;background:#0004;color:#fff;font-size:18px}
.shared-note-media-thumb .album-video-thumb small{display:none}
.shared-note-media-more{position:absolute;inset:0;display:grid;place-items:center;background:#1119;color:#fff;font-size:calc(20px * var(--ui-scale,1));font-weight:700}
.shared-note-media-thumb:focus-visible{outline:2px solid var(--green);outline-offset:-2px}
@media(max-width:480px){.shared-note-media-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:2px}.shared-note-media-grid.is-single{max-width:min(100%,220px)}}

.message-media-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px;width:min(50cqi,520px);max-width:50cqi;overflow:hidden;border-radius:6px}
.message-media-open.message-media-grid-item{width:100%;max-width:100%!important;aspect-ratio:1;padding:0;border-radius:0}
.message-media-grid-item .message-media-image{display:block;width:100%;height:100%;max-width:100%;max-height:none;object-fit:cover}

/* Desktop QR sign-in and the mobile-only scanner entry point. */
.login-mode-switch{display:none;grid-template-columns:1fr 1fr;gap:4px;margin-top:22px;padding:4px;border-radius:11px;background:#f1f4f2}
.login-mode-switch button{min-height:38px;border:0;border-radius:8px;background:transparent;color:#69746f;font-size:calc(12px * var(--ui-scale,1));font-weight:600}
.login-mode-switch button.active{background:#fff;color:#17221f;box-shadow:0 1px 4px #00000012}
.login-qr-view{min-height:285px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;margin-top:18px;text-align:center}
.login-qr-view.hidden{display:none!important}
.login-qr-code{width:220px;height:220px;display:grid;place-items:center;padding:10px;border:1px solid #e6ece8;border-radius:13px;background:#fff}
.login-qr-code img,.login-qr-code canvas{display:block;max-width:100%;height:auto!important}
.login-qr-view strong{font-size:calc(13px * var(--ui-scale,1));color:var(--ink)}
.login-qr-view>span{font-size:calc(11px * var(--ui-scale,1));color:var(--muted)}
.login-qr-view .soft-button{margin-top:5px}
.qr-scan-button{display:none;place-items:center}
.qr-scan-button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.qr-scanner-view{display:grid;gap:12px}
.qr-scanner-video{display:block;width:100%;max-height:min(60dvh,520px);aspect-ratio:3/4;overflow:hidden;border-radius:12px;background:#111}
.qr-scanner-video video{display:block;width:100%!important;height:100%!important;object-fit:cover}
.qr-scanner-hint{margin:0;color:var(--dialog-muted);font-size:calc(12px * var(--ui-scale,1));line-height:1.55}
.qr-scan-confirm{display:grid;gap:12px;text-align:center}
.qr-scan-confirm strong{font-size:calc(16px * var(--ui-scale,1))}
.qr-scan-confirm span{color:var(--dialog-muted);font-size:calc(12px * var(--ui-scale,1))}
@media(min-width:761px){.login-mode-switch{display:grid}.login-card:has(#loginQrView:not(.hidden)) #loginForm{display:none}.login-qr-view:not(.hidden){display:flex}.sidebar-tabs .qr-scan-button{display:none!important}}
@media(max-width:760px){.login-mode-switch,#loginQrView{display:none!important}}
@media(max-width:760px) and (any-pointer:coarse){.sidebar-tabs .qr-scan-button{display:grid;flex:0 0 auto;width:34px;height:34px;min-height:34px;margin-left:auto;padding:0;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--ink)}.sidebar-tabs .qr-scan-button:hover{background:color-mix(in srgb,var(--ink) 8%,transparent)}}

/* Conversation list sorting, identity-aware context actions, and hidden chat recovery. */
.conversation-section-heading{position:relative;z-index:4}
.conversation-sort-button{display:inline-flex;align-items:center;gap:5px;padding:3px 5px;border:0;border-radius:6px;background:transparent;color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;text-transform:inherit}
.conversation-sort-button:hover,.conversation-sort-button[aria-expanded="true"]{background:#eef3f0;color:var(--ink)}
.conversation-sort-button span{font-size:1.2em;line-height:1}
.conversation-sort-menu{position:absolute;z-index:100;top:calc(100% - 2px);left:12px;width:min(210px,calc(100% - 24px));padding:5px;border:1px solid #505154;border-radius:8px;background:#3a3b3d;box-shadow:0 10px 28px #10141066;color:#f3f3f3;letter-spacing:normal;text-transform:none}
.conversation-sort-menu button{display:flex;width:100%;align-items:center;justify-content:space-between;min-height:38px;padding:0 10px;border:0;border-radius:5px;background:transparent;color:inherit;text-align:left;font-size:calc(12px * var(--ui-scale,1))}
.conversation-sort-menu button:hover,.conversation-sort-menu button.selected{background:#4a4b4d}
.conversation-sort-menu button[aria-checked="true"]::after{content:'✓';color:var(--green);font-weight:700}
.conversation-menu-target{padding:8px 10px 6px;overflow:hidden}
.conversation-menu-target strong,.conversation-menu-target small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conversation-menu-target strong{font-size:calc(12px * var(--ui-scale,1));font-weight:700}
.conversation-menu-target small{margin-top:3px;color:#b4b6b7;font-size:calc(10px * var(--ui-scale,1))}
.hidden-conversation-section{flex:none;max-height:30%;overflow:auto;padding:6px 8px 8px;border-top:1px solid #3e3f41;background:#262729}
.hidden-conversation-heading{padding:5px 7px;color:#a6a8a9;font-size:calc(10px * var(--ui-scale,1));font-weight:700}
.hidden-conversation-row{display:flex;align-items:center;gap:8px;min-height:36px;padding:4px 6px;border-radius:7px}
.hidden-conversation-row:hover{background:#343537}
.hidden-conversation-name{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#e7e7e7;font-size:calc(11px * var(--ui-scale,1))}
.hidden-conversation-name small{margin-left:6px;color:#a1a3a4;font-size:calc(9px * var(--ui-scale,1))}
.hidden-conversation-row button{flex:none;padding:4px 8px;border:1px solid #46524a;border-radius:6px;background:#303b34;color:#91d6a5;font-size:calc(10px * var(--ui-scale,1))}
:root[data-theme="light"] .conversation-sort-button:hover,:root[data-theme="light"] .conversation-sort-button[aria-expanded="true"]{background:#f0f4f2}
:root[data-theme="dark"] .conversation-sort-button:hover,:root[data-theme="dark"] .conversation-sort-button[aria-expanded="true"]{background:#414345;color:#fff}
:root[data-theme="light"] .conversation-sort-menu{border-color:#e1e6e3;background:#fff;box-shadow:0 10px 28px #13261c33;color:#34413b}
:root[data-theme="light"] .conversation-sort-menu button:hover,:root[data-theme="light"] .conversation-sort-menu button.selected{background:#f0f4f2}
:root[data-theme="light"] .conversation-menu-target small{color:#77827c}
:root[data-theme="light"] .hidden-conversation-section{border-color:#edf0ee;background:#fafcfb}
:root[data-theme="light"] .hidden-conversation-heading{color:#87928c}
:root[data-theme="light"] .hidden-conversation-name{color:#34413b}
:root[data-theme="light"] .hidden-conversation-name small{color:#87928c}
:root[data-theme="light"] .hidden-conversation-row:hover{background:#f0f4f2}
:root[data-theme="light"] .hidden-conversation-row button{border-color:#dceee6;background:#f1faf6;color:#178864}
.conversation-context-menu{touch-action:manipulation}
@media(max-width:760px){.hidden-conversation-section{max-height:24%;padding-bottom:max(8px,env(safe-area-inset-bottom))}.conversation-sort-menu{left:8px}}
:root[data-color-scheme="custom"] .conversation-section-heading{border-top-color:color-mix(in srgb,var(--custom-background) 82%,var(--custom-text))}
:root[data-color-scheme="custom"] .conversation-sort-button{color:var(--custom-text)}
:root[data-color-scheme="custom"] .conversation-sort-button:hover,:root[data-color-scheme="custom"] .conversation-sort-button[aria-expanded="true"]{background:transparent;color:var(--custom-text);box-shadow:inset 0 0 0 1px var(--green)}
:root[data-color-scheme="custom"] .conversation-sort-menu{border-color:color-mix(in srgb,var(--custom-background) 70%,var(--custom-text));background:color-mix(in srgb,var(--custom-background) 90%,var(--custom-text));color:var(--custom-text)}
:root[data-color-scheme="custom"] .conversation-sort-menu button{color:var(--custom-text)}
:root[data-color-scheme="custom"] .conversation-sort-menu button:hover,:root[data-color-scheme="custom"] .conversation-sort-menu button.selected{background:color-mix(in srgb,var(--custom-background) 80%,var(--custom-text));color:var(--custom-text)}

.community-sticker-pack-cover{width:74px;height:74px;flex:none;object-fit:contain;border-radius:10px;background:transparent}
.community-sticker-tile{display:block;width:min(100%,150px);aspect-ratio:1;object-fit:contain;border-radius:10px;background:transparent}
.community-pack-upload{display:grid;gap:14px;min-width:0}
.community-pack-upload .field-label{color:var(--dialog-label)}
.community-pack-upload .modal-input{border-color:var(--dialog-border);background:var(--dialog-input);color:var(--dialog-input-text)}
.community-pack-file-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--dialog-border);border-radius:12px;background:var(--dialog-surface-raised);color:var(--dialog-text)}
.community-pack-file-row>div{display:grid;gap:4px;min-width:0}
.community-pack-file-row small{color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale,1));line-height:1.45}
.community-pack-file-list{display:grid;gap:8px;max-height:min(42dvh,420px);overflow:auto;overscroll-behavior:contain;padding:2px}
.community-pack-file{display:grid;grid-template-columns:52px minmax(0,1fr) minmax(110px,220px);align-items:center;gap:10px;min-width:0;padding:8px;border:1px solid var(--dialog-border);border-radius:10px;background:var(--dialog-surface-raised);color:var(--dialog-text)}
.community-pack-file>img{width:52px;height:52px;object-fit:contain;border-radius:7px;background:transparent}
.community-pack-file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:calc(11px * var(--ui-scale,1))}
.community-pack-file-name small{display:block;margin-top:3px;color:var(--dialog-muted);font-size:calc(10px * var(--ui-scale,1))}
.community-pack-file .modal-input,.community-pack-file input{width:100%;min-width:0;height:36px;padding:0 9px;border:1px solid var(--dialog-border);border-radius:8px;outline:0;background:var(--dialog-input);color:var(--dialog-input-text);font-size:calc(11px * var(--ui-scale,1))}
@media(max-width:560px){.sticker-store-tabs{gap:2px;overflow-x:auto}.sticker-store-tabs button{flex:none;padding-inline:9px;font-size:calc(11px * var(--ui-scale,1))}.community-pack-file{grid-template-columns:44px minmax(0,1fr)}.community-pack-file>img{width:44px;height:44px}.community-pack-file input{grid-column:1/-1}}
:root[data-color-scheme="custom"] .count-pill{background:color-mix(in srgb,var(--custom-background) 84%,var(--custom-text));color:var(--custom-text)}

.cached-media-loading{margin-top:8px;padding:8px 10px;border-radius:8px;background:color-mix(in srgb,var(--green) 10%,transparent);color:var(--muted);font-size:calc(11px * var(--ui-scale,1));text-align:center}

/* Shared link previews for chat messages and conversation notes */
.link-preview-list{display:grid;gap:6px;margin:8px 0 2px;max-width:min(100%,430px)}
.link-preview-card{min-width:0;display:flex;align-items:stretch;gap:10px;padding:7px;border:1px solid color-mix(in srgb,var(--muted) 26%,transparent);border-radius:9px;background:color-mix(in srgb,var(--surface,#fff) 78%,var(--green) 5%);color:inherit;text-decoration:none;overflow:hidden}
.link-preview-card:hover{border-color:var(--green);background:color-mix(in srgb,var(--surface,#fff) 68%,var(--green) 10%)}
.link-preview-thumb{width:76px;height:64px;min-height:56px;max-height:72px;flex:none;display:grid;place-items:center;overflow:hidden;border-radius:6px;background:color-mix(in srgb,var(--muted) 12%,transparent)}
.link-preview-thumb.has-image{background:transparent}
.link-preview-thumb.has-image .link-preview-icon{display:none}
.link-preview-thumb img{display:block;width:100%;height:100%;min-height:56px;max-height:72px;object-fit:cover}
.link-preview-icon{width:28px;height:28px;flex:none;display:grid;place-items:center;border-radius:7px;background:color-mix(in srgb,var(--green) 14%,transparent);color:var(--green);font-size:16px}
.link-preview-copy{min-width:0;flex:1;align-content:center;display:grid;gap:3px}
.link-preview-copy strong{overflow:hidden;color:inherit;font-size:calc(11px * var(--ui-scale,1));text-overflow:ellipsis;white-space:nowrap}
.link-preview-description{display:-webkit-box;overflow:hidden;color:var(--muted);font-size:calc(10px * var(--ui-scale,1));line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.link-preview-description.is-empty{display:none}
.link-preview-copy small{overflow:hidden;color:var(--muted);font-size:calc(10px * var(--ui-scale,1));text-overflow:ellipsis;white-space:nowrap}
.message-link{color:var(--green);text-decoration:underline;text-underline-offset:2px;overflow-wrap:anywhere}
.note-link-previews{max-height:150px;overflow:auto;flex:none}
.note-link-previews:empty{display:none}
.note-editor-modal .link-preview-card,.notes-modal .link-preview-card{background:var(--dialog-surface-raised,#363739);border-color:var(--dialog-border,#494a4c);color:var(--dialog-text,#f0f0f0)}

/* Batch actions start only from the message context menu's Delete / Share actions. */
.message-selection-bar{flex:none;min-height:48px;display:flex;align-items:center;gap:10px;padding:4px 18px;border-bottom:1px solid var(--line);background:var(--surface);color:var(--ink)}
.message-selection-bar .icon-button{width:32px;height:32px;font-size:24px}
.message-selection-bar strong{font-size:calc(13px * var(--ui-scale,1))}
.message-selection-bar>span{margin-left:auto;color:var(--muted);font-size:calc(12px * var(--ui-scale,1));font-variant-numeric:tabular-nums}
.message-select-toggle{display:none;flex:none;width:24px;height:24px;place-items:center;padding:0;border:2px solid color-mix(in srgb,var(--muted) 65%,transparent);border-radius:50%;background:var(--surface);color:#fff;font-size:calc(13px * var(--ui-scale,1));line-height:1}
.message-selection-mode .message-select-toggle{display:grid}
.message-selection-mode .message-row{cursor:pointer}
.message-selection-mode .message-row.message-selected{border-radius:12px;background:color-mix(in srgb,var(--green) 10%,transparent)}
.message-selection-mode .message-row.message-selected .message-select-toggle{border-color:var(--green);background:var(--green)}
.message-selection-dock{flex:none;display:flex;justify-content:center;gap:10px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface)}
.message-selection-dock button{min-width:min(180px,44vw);min-height:42px;padding:0 18px;border:0;border-radius:10px;font-size:calc(13px * var(--ui-scale,1));font-weight:700}
.message-selection-share{background:var(--green);color:#fff}
.message-selection-share:hover{background:var(--green-dark)}
.message-selection-delete{background:#c94141;color:#fff}
.message-selection-delete:hover{background:#ad3030}
.message-share-modal{align-items:end;padding:0}
.message-share-modal .modal-card{width:min(620px,100vw);height:min(78dvh,720px);max-height:calc(100dvh - env(safe-area-inset-top));border-radius:18px 18px 0 0;border-color:var(--dialog-border);background:var(--dialog-surface);color:var(--dialog-text);animation:message-share-sheet-in .2s ease-out}
.message-share-modal .modal-header{flex:none;padding:15px 18px;border-color:var(--dialog-border);background:var(--dialog-surface);color:var(--dialog-text)}
.message-share-modal .modal-body{display:flex;flex-direction:column;min-height:0;padding:0;background:var(--dialog-surface);color:var(--dialog-text)}
.message-share-sheet{flex:1;min-height:0;display:flex;flex-direction:column;gap:12px;padding:14px 16px calc(14px + env(safe-area-inset-bottom))}
.message-share-summary{flex:none;margin:0;color:var(--dialog-muted);font-size:calc(12px * var(--ui-scale,1));line-height:1.5}
.message-share-search{height:40px;flex:none;display:flex;align-items:center;gap:8px;padding:0 11px;border:1px solid var(--dialog-border);border-radius:10px;background:var(--dialog-surface-raised);color:var(--dialog-muted)}
.message-share-search>span{font-size:21px;line-height:1}
.message-share-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--dialog-text);font:inherit;font-size:calc(12px * var(--ui-scale,1))}
.message-share-search input::placeholder{color:var(--dialog-placeholder)}
.message-share-recipients{flex:1;min-height:70px;overflow:auto;overscroll-behavior:contain;display:grid;align-content:start;gap:5px}
.message-share-recipient{width:100%;min-height:56px;display:flex;align-items:center;gap:10px;padding:7px 9px;border:1px solid transparent;border-radius:10px;background:var(--dialog-surface);color:var(--dialog-text);text-align:left}
.message-share-recipient:hover,.message-share-recipient.selected{border-color:var(--dialog-border);background:var(--dialog-surface-raised)}
.message-share-avatar{width:38px;height:38px;border-radius:12px}
.message-share-recipient-copy{min-width:0;flex:1;display:grid;gap:3px}
.message-share-recipient-copy strong{overflow:hidden;font-size:calc(12px * var(--ui-scale,1));text-overflow:ellipsis;white-space:nowrap}
.message-share-recipient-copy small{color:var(--dialog-muted);font-size:calc(10px * var(--ui-scale,1))}
.message-share-check{width:22px;height:22px;display:grid;place-items:center;border:1.5px solid var(--dialog-border);border-radius:50%;color:#fff;font-size:13px}
.message-share-recipient.selected .message-share-check{border-color:var(--green);background:var(--green)}
.message-share-actions{flex:none;display:flex;justify-content:flex-end;gap:9px;padding-top:10px;border-top:1px solid var(--dialog-border)}
.message-share-actions button{min-width:92px;min-height:40px}
@keyframes message-share-sheet-in{from{transform:translateY(24px);opacity:.7}to{transform:translateY(0);opacity:1}}
@media(max-width:760px){.message-selection-bar{min-height:46px;padding-inline:10px}.message-selection-dock{gap:8px;padding-inline:10px}.message-selection-dock button{flex:1;min-width:0}.message-share-modal{padding:0}.message-share-modal .modal-card{width:100vw;height:min(78dvh,760px);max-height:calc(100dvh - env(safe-area-inset-top));border-radius:18px 18px 0 0}.message-share-sheet{padding-inline:13px}}

/* Share recipient picker: recent grid, then a full recipient list on More. */
.message-share-modal{align-items:end;padding:0;background:#101010b8;backdrop-filter:blur(3px)}
.message-share-modal .modal-card{width:min(640px,100vw);height:min(88dvh,820px);max-height:calc(100dvh - env(safe-area-inset-top));border:1px solid var(--dialog-border);border-bottom:0;border-radius:20px 20px 0 0;background:var(--dialog-surface);color:var(--dialog-text)}
.message-share-modal .modal-header{display:none}
.message-share-modal .modal-body{display:flex;flex-direction:column;min-height:0;padding:0;background:var(--dialog-surface);color:var(--dialog-text)}
.message-share-screen{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:var(--dialog-surface);color:var(--dialog-text)}
.message-share-header{flex:none;min-height:68px;display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;gap:8px;padding:6px 14px;border-bottom:1px solid var(--dialog-border)}
.message-share-header h2{margin:0;text-align:center;font-size:calc(18px * var(--ui-scale,1));font-weight:700}
.message-share-header button{width:42px;height:42px;display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:var(--dialog-text);font-size:30px;line-height:1}
.message-share-header button:hover{background:var(--dialog-hover)}
.message-share-header .message-share-search-toggle{font-size:28px}
.message-share-header.second-layer{grid-template-columns:42px minmax(0,1fr) auto}
.message-share-header.second-layer h2{text-align:left;font-size:calc(17px * var(--ui-scale,1))}
.message-share-header .message-share-back{font-size:36px}
.message-share-header .message-share-top-action{width:auto;min-width:62px;padding:0 8px;color:var(--green);font-size:calc(14px * var(--ui-scale,1));font-weight:700}
.message-share-summary{flex:none;margin:8px 18px 2px;color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale,1));line-height:1.4}
.message-share-recents{flex:1;min-height:0;overflow:auto;padding:12px 15px 16px}
.message-share-recents h3,.message-share-list h3{margin:9px 0 13px;color:var(--dialog-text);font-size:calc(14px * var(--ui-scale,1));font-weight:700}
.message-share-recipients.message-share-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-content:start;gap:12px 8px}
.message-share-recipient{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px 4px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--dialog-text);text-align:center}
.message-share-recipient:hover,.message-share-recipient.selected{border-color:var(--dialog-border);background:var(--dialog-hover)}
.message-share-avatar{width:clamp(52px,12vw,76px);height:clamp(52px,12vw,76px);border-radius:50%;font-size:calc(22px * var(--ui-scale,1))}
.message-share-recipient strong{display:block;width:100%;overflow:hidden;font-size:calc(11px * var(--ui-scale,1));font-weight:500;text-overflow:ellipsis;white-space:nowrap}
.message-share-recipient small{display:none}
.message-share-recipient .message-share-check{position:absolute;top:5px;right:calc(50% - 42px);width:20px;height:20px;border:2px solid var(--dialog-surface);background:var(--dialog-surface-raised);color:var(--dialog-text);font-size:11px}
.message-share-recipient.selected .message-share-check{border-color:var(--green);background:var(--green);color:#fff}
.message-share-more{min-height:0;display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px 4px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--dialog-text)}
.message-share-more:hover{background:var(--dialog-hover)}
.message-share-more span{width:clamp(52px,12vw,76px);height:clamp(52px,12vw,76px);display:grid;place-items:center;border-radius:50%;background:var(--dialog-surface-raised);color:var(--dialog-muted);font-size:26px;letter-spacing:3px}
.message-share-more strong{font-size:calc(11px * var(--ui-scale,1));font-weight:500}
.message-share-search{height:48px;flex:none;display:flex;align-items:center;gap:10px;margin:14px 16px 8px;padding:0 16px;border:0;border-radius:28px;background:var(--dialog-surface-raised);color:var(--dialog-muted)}
.message-share-search>span{font-size:27px;line-height:1}
.message-share-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--dialog-text);font:inherit;font-size:calc(14px * var(--ui-scale,1))}
.message-share-search input::placeholder{color:var(--dialog-placeholder)}
.message-share-tabs{flex:none;height:54px;display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--dialog-border)}
.message-share-tabs button{position:relative;border:0;background:transparent;color:var(--dialog-muted);font:inherit;font-size:calc(14px * var(--ui-scale,1));font-weight:600}
.message-share-tabs button.active{color:var(--dialog-text)}
.message-share-tabs button.active:after{position:absolute;bottom:0;left:34%;width:32%;height:3px;background:var(--dialog-text);content:''}
.message-share-list-heading{flex:none;padding:8px 18px 4px;color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale,1))}
.message-share-recipients.message-share-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:block;padding:6px 12px 18px}
.message-share-list .message-share-recipient{width:100%;min-height:68px;display:grid;grid-template-columns:48px minmax(0,1fr) 28px;grid-template-rows:auto auto;justify-items:start;align-items:center;gap:2px 12px;padding:8px 10px;border-radius:10px;text-align:left}
.message-share-list .message-share-avatar{grid-column:1;grid-row:1/3;width:46px;height:46px;font-size:calc(16px * var(--ui-scale,1))}
.message-share-list .message-share-recipient strong{grid-column:2;grid-row:1;align-self:end;text-align:left;font-size:calc(13px * var(--ui-scale,1));font-weight:600}
.message-share-list .message-share-recipient small{grid-column:2;grid-row:2;display:block;align-self:start;color:var(--dialog-muted);font-size:calc(10px * var(--ui-scale,1))}
.message-share-list .message-share-recipient .message-share-check{position:static;grid-column:3;grid-row:1/3;justify-self:end;width:22px;height:22px}
.message-share-actions{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--dialog-border);background:var(--dialog-surface)}
.message-share-actions>span{color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale,1))}
.message-share-actions button{min-width:112px;min-height:42px;border-radius:10px}
.message-share-empty{padding:28px 12px;color:var(--dialog-muted);text-align:center;font-size:calc(13px * var(--ui-scale,1))}
@media(max-width:760px){.message-share-modal{padding:0}.message-share-modal .modal-card{width:100vw;height:100dvh;max-height:100dvh;border:0;border-radius:0}.message-share-header{min-height:72px;padding-inline:12px}.message-share-header h2{font-size:calc(19px * var(--ui-scale,1))}.message-share-recents{padding-inline:12px}.message-share-recipient{padding-inline:2px}.message-share-recipient .message-share-check{right:calc(50% - 38px)}.message-share-more span{width:clamp(52px,15vw,76px);height:clamp(52px,15vw,76px)}}
@media(max-width:380px){.message-share-recipients.message-share-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Gmail lives in the normal chat workspace: list on the left, message content on the right. */
.gmail-mail-view{position:absolute;inset:0;display:flex;min-width:0;min-height:0;flex-direction:column;overflow:hidden;background:var(--surface);color:var(--ink)}
.gmail-mail-empty{width:min(100% - 32px,460px);margin:auto;padding:28px;text-align:center;color:var(--muted)}
.gmail-mail-empty h2{margin:0 0 8px;color:var(--ink);font-size:calc(21px * var(--ui-scale,1))}
.gmail-mail-empty p{margin:0;line-height:1.6;font-size:calc(13px * var(--ui-scale,1))}
.gmail-mail-icon{width:68px;height:68px;display:grid;place-items:center;margin:0 auto 18px;border-radius:22px;background:color-mix(in srgb,var(--green) 14%,var(--surface));color:var(--green);font-size:34px}
.gmail-message-detail{width:100%;min-width:0;min-height:0;max-width:100%;flex:1;display:flex;flex-direction:column;padding:clamp(16px,3vw,32px);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.gmail-message-detail>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.gmail-message-detail h1{min-width:0;margin:0;color:var(--ink);font-size:calc(22px * var(--ui-scale,1));overflow-wrap:anywhere}
.gmail-detail-meta{display:grid;gap:6px;padding:16px 0;border-bottom:1px solid var(--line);color:var(--muted);overflow-wrap:anywhere}
.gmail-detail-meta strong{color:var(--ink)}
.gmail-detail-body{width:100%;min-width:0;min-height:0;margin:0;padding:0;color:var(--ink);font:inherit;font-size:calc(14px * var(--ui-scale,1));line-height:1.7;overflow:hidden;overflow-wrap:anywhere}
.gmail-email-frame{display:block;width:100%;min-width:0;max-width:100%;min-height:300px;height:420px;flex:none;border:0;border-radius:6px;background:#fff}
.gmail-email-text-fallback{margin:0;padding:20px 0;color:var(--ink);font:inherit;font-size:calc(14px * var(--ui-scale,1));line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.gmail-link-previews{margin-top:16px}
.gmail-sidebar-item .conversation-preview,.gmail-sidebar-item .preview-text{min-width:0;overflow:hidden}
.gmail-sidebar-item .preview-text{display:block;text-overflow:ellipsis;white-space:nowrap}
.gmail-sidebar-item.unread .conversation-title,.gmail-sidebar-item.unread .preview-text strong{font-weight:700}
.gmail-sender-avatar{width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center;border-radius:50%;background:color-mix(in srgb,var(--green) 17%,var(--surface));color:var(--green);font-weight:700}
.gmail-unread-dot{width:9px;height:9px;flex:0 0 9px;border-radius:50%;background:var(--green)}
.gmail-load-more{align-self:center;margin:8px}
@media(max-width:760px){.gmail-mail-view{height:100%;min-height:0}.gmail-message-detail{padding:18px 16px calc(24px + env(safe-area-inset-bottom))}.gmail-message-detail>header{align-items:center;flex-wrap:wrap}.gmail-message-detail h1{flex:1 1 100%;font-size:calc(20px * var(--ui-scale,1))}.gmail-detail-body{font-size:calc(15px * var(--ui-scale,1))}}

.active-chat{position:relative}
.history-scroll-hint{position:sticky;z-index:2;top:8px;width:max-content;max-width:calc(100% - 24px);margin:0 auto 12px;padding:7px 12px;border:1px solid color-mix(in srgb,var(--muted) 25%,transparent);border-radius:999px;background:color-mix(in srgb,var(--surface) 90%,transparent);color:var(--muted);font-size:calc(11px * var(--ui-scale,1));line-height:1.35;text-align:center;pointer-events:none;backdrop-filter:blur(8px)}
.scroll-latest-button{position:absolute;z-index:6;right:22px;bottom:calc(88px + env(safe-area-inset-bottom));width:42px;height:42px;display:grid;place-items:center;border:1px solid var(--dialog-border);border-radius:50%;background:var(--dialog-surface);color:var(--dialog-text);box-shadow:0 3px 12px #0003;transition:opacity .16s,transform .16s}
.scroll-latest-button:hover{transform:translateY(2px);background:var(--dialog-surface-raised)}
.scroll-latest-button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:760px){.scroll-latest-button{right:14px;bottom:calc(104px + env(safe-area-inset-bottom));width:40px;height:40px}}
:root .conversation-preview{min-width:0}
.conversation-sticker-preview{width:22px;height:22px;flex:0 0 22px;object-fit:contain;border:0;border-radius:0;background:transparent}
.gmail-launcher{min-width:50px!important}.gmail-settings-panel{display:grid;gap:12px;padding:14px;border:1px solid var(--dialog-border);border-radius:12px;background:var(--dialog-surface-raised);color:var(--dialog-text);font-size:calc(12px * var(--ui-scale,1));overflow-wrap:anywhere}.gmail-settings-actions{display:flex;flex-wrap:wrap;gap:8px}.gmail-inbox{display:grid;gap:12px;min-width:0}.gmail-search{display:flex;gap:8px;min-width:0}.gmail-search input{flex:1;min-width:0;height:40px;padding:0 12px;border:1px solid var(--dialog-border);border-radius:9px;background:var(--dialog-surface-raised);color:var(--dialog-text)}.gmail-inbox-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--dialog-label);font-size:calc(11px * var(--ui-scale,1))}.gmail-message-list{display:grid;gap:8px;max-height:min(58dvh,620px);overflow:auto;overscroll-behavior:contain}.gmail-message{min-width:0;padding:12px;border:1px solid var(--dialog-border);border-radius:10px;background:var(--dialog-surface-raised);color:var(--dialog-text);overflow-wrap:anywhere}.gmail-message.unread{border-inline-start:3px solid var(--green)}.gmail-message header{display:flex;justify-content:space-between;align-items:start;gap:8px}.gmail-message header strong{min-width:0;overflow-wrap:anywhere}.gmail-message time,.gmail-message-from{color:var(--dialog-label);font-size:calc(10px * var(--ui-scale,1))}.gmail-message p{margin:8px 0 0;color:var(--dialog-label);font-size:calc(11px * var(--ui-scale,1));line-height:1.5;overflow-wrap:anywhere}.gmail-next-page{justify-self:center}
.gmail-settings-summary{display:grid;gap:4px}.gmail-settings-summary small,.gmail-account-copy small{color:var(--dialog-muted);font-size:calc(11px * var(--ui-scale,1))}.gmail-account-list{display:grid;gap:7px}.gmail-account-row{display:flex;align-items:center;gap:9px;min-width:0;padding:9px;border:1px solid var(--dialog-border);border-radius:10px;background:var(--dialog-surface)}.gmail-account-avatar{display:grid;flex:none;width:34px;height:34px;place-items:center;border-radius:50%;background:color-mix(in srgb,var(--green) 18%,var(--dialog-surface-raised));color:var(--green);font-weight:800}.gmail-account-copy{display:grid;flex:1;gap:3px;min-width:0}.gmail-account-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gmail-account-empty,.gmail-account-chooser>p{margin:0;color:var(--dialog-muted);font-size:calc(12px * var(--ui-scale,1));line-height:1.5}.gmail-account-remove{width:34px;height:34px;flex:none;border:1px solid var(--dialog-border);border-radius:9px;background:var(--dialog-surface-raised);color:var(--dialog-muted);font-size:20px}.gmail-account-remove:hover{border-color:#dc5961;color:#dc5961}.gmail-account-chooser{display:grid;gap:9px}.gmail-account-choice{display:flex;align-items:center;gap:10px;width:100%;padding:11px;border:1px solid var(--dialog-border);border-radius:11px;background:var(--dialog-surface-raised);color:var(--dialog-text);text-align:left}.gmail-account-choice:hover{border-color:var(--green);background:color-mix(in srgb,var(--green) 7%,var(--dialog-surface-raised))}.gmail-account-choice>span:nth-child(2){display:grid;flex:1;gap:3px;min-width:0}.gmail-account-choice strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gmail-account-choice small{color:var(--dialog-muted)}.gmail-account-choice>span:last-child{color:var(--dialog-muted);font-size:22px}
@media(max-width:760px){.gmail-settings-actions>*{flex:1 1 130px}.gmail-message header{display:grid;gap:4px}.gmail-search .primary-button{flex:0 0 auto}}

/* Gmail folder picker and inbox category tabs remain usable at narrow widths and high UI scales. */
.conversation-sort-menu{max-height:min(70dvh,440px);overflow-y:auto;overscroll-behavior:contain}
#conversationSortMenu button[hidden]{display:none!important}
.gmail-category-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex:0 0 auto;gap:2px;width:100%;min-width:0;max-width:100%;overflow:hidden;border-bottom:1px solid var(--line);background:var(--surface)}
.gmail-category-tabs button{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:clamp(42px,calc(42px * var(--ui-scale,1)),92px);padding:7px clamp(3px,1vw,10px);border:0;border-radius:7px 7px 0 0;background:transparent;color:var(--muted);font-size:calc(12px * var(--ui-scale,1));line-height:1.2;text-align:center;white-space:normal;overflow-wrap:anywhere}
.gmail-category-tabs button[aria-selected="true"]{color:var(--green);font-weight:700}
.gmail-category-tabs button[aria-selected="true"]::after{position:absolute;right:0;bottom:0;left:0;height:3px;border-radius:3px 3px 0 0;background:var(--green);content:""}
.gmail-category-tabs button:hover{background:color-mix(in srgb,var(--green) 8%,var(--surface));color:var(--ink)}
@media(max-width:760px){.gmail-category-tabs{gap:1px}.gmail-category-tabs button{min-height:clamp(44px,calc(44px * var(--ui-scale,1)),96px);padding-inline:3px}.conversation-sort-menu{left:8px;width:min(240px,calc(100% - 16px))}}

/* Responsive shared staff schedule. The government calendar is shown by the currently selected Gregorian year. */
.schedule-view{position:absolute;inset:0;display:flex;min-width:0;min-height:0;flex-direction:column;overflow:hidden;background:var(--surface);color:var(--ink)}
/* Keep the schedule in sync with the selected app appearance. */
:root[data-theme="light"] .schedule-view{--surface:#fff;--ink:#17221f;--muted:#85908c;--line:#edf0ee;--soft:#f6f8f7}
:root[data-theme="dark"] .schedule-view{--surface:#2c2d2f;--ink:#ededed;--muted:#a6a8a9;--line:#414244;--soft:#363739}
:root[data-color-scheme="custom"] .schedule-view{--surface:var(--custom-background,#2c2d2f);--ink:var(--custom-text,#ededed);--muted:color-mix(in srgb,var(--custom-text,#ededed) 66%,var(--custom-background,#2c2d2f));--line:color-mix(in srgb,var(--custom-text,#ededed) 20%,var(--custom-background,#2c2d2f));--soft:color-mix(in srgb,var(--custom-background,#2c2d2f) 88%,var(--custom-text,#ededed))}
.schedule-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:clamp(12px,2vw,22px);border-bottom:1px solid var(--line);background:var(--surface)}
.schedule-header h1{margin:0;color:var(--ink);font-size:calc(20px * var(--ui-scale,1));overflow-wrap:anywhere}.schedule-header p{margin:5px 0 0;color:var(--muted);font-size:calc(12px * var(--ui-scale,1));line-height:1.45}
.schedule-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px;min-width:0}.schedule-toolbar button{min-height:36px}.schedule-toolbar .schedule-month-label{min-width:110px;color:var(--ink);font-weight:700}.schedule-toolbar button:disabled{opacity:.55}
.schedule-toolbar .danger-button{color:var(--danger,#d34b56);border-color:color-mix(in srgb,var(--danger,#d34b56) 42%,var(--line))}
.schedule-duty-counts{display:grid;gap:7px;margin:0 0 11px;padding:10px;border:1px solid var(--line);border-radius:10px;background:color-mix(in srgb,var(--green) 7%,var(--surface));color:var(--ink)}.schedule-duty-counts>strong{font-size:calc(11px * var(--ui-scale,1))}.schedule-duty-counts>div{display:flex;flex-wrap:wrap;gap:6px}.schedule-duty-counts>div>span{display:inline-flex;gap:5px;align-items:center;padding:5px 8px;border-radius:999px;background:var(--surface);font-size:calc(10px * var(--ui-scale,1))}.schedule-duty-counts b{color:var(--green)}.schedule-duty-counts>small{color:var(--muted);font-size:calc(9px * var(--ui-scale,1))}
.schedule-content{display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(10px,1.7vw,20px);min-width:0;min-height:0;flex:1;padding:clamp(10px,1.7vw,20px);overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.schedule-calendar-panel{min-width:0;min-height:0;border:1px solid var(--line);border-radius:14px;background:var(--surface);overflow:hidden}.schedule-calendar-panel{align-self:start}.schedule-weekdays,.schedule-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.schedule-weekdays{padding:8px 8px 4px;color:var(--muted);text-align:center;font-size:calc(11px * var(--ui-scale,1));font-weight:700}.schedule-day{position:relative;display:flex;min-width:0;min-height:clamp(45px,7.2vw,76px);flex-direction:column;align-items:center;gap:3px;padding:5px 2px;border:0;border-top:1px solid color-mix(in srgb,var(--line) 70%,transparent);border-radius:0;background:transparent;color:var(--ink);font-size:calc(13px * var(--ui-scale,1));overflow:hidden}.schedule-day:hover{background:color-mix(in srgb,var(--green) 9%,var(--surface))}.schedule-day.outside-month{color:var(--muted);opacity:.55}.schedule-day.rest-day{background:color-mix(in srgb,#e85d65 10%,var(--surface));color:#e7797e}.schedule-day.today>span{display:grid;min-width:26px;min-height:26px;place-items:center;border-radius:50%;background:var(--green);color:#fff}.schedule-day.selected{outline:2px solid var(--green);outline-offset:-2px}.schedule-day small{display:block;width:100%;overflow:hidden;color:var(--muted);font-size:calc(8px * var(--ui-scale,1));line-height:1.15;text-overflow:ellipsis;white-space:nowrap}.schedule-calendar-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);border-top:1px solid var(--line)}.schedule-day-info{display:grid;align-content:start;gap:5px;min-width:0;min-height:100px;padding:12px;border:0;font-size:calc(11px * var(--ui-scale,1));line-height:1.45;overflow-wrap:anywhere}.schedule-day-info strong{color:var(--ink)}.schedule-day-info span{color:var(--muted)}.schedule-swap-history{min-width:0;padding:12px;border-left:1px solid var(--line)}.schedule-swap-history h3{margin:0 0 9px;color:var(--ink);font-size:calc(13px * var(--ui-scale,1))}.schedule-swap-history>p{margin:0;color:var(--muted);font-size:calc(11px * var(--ui-scale,1))}.schedule-swap-history-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px}.schedule-swap-history-item{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:7px;min-width:0}.schedule-swap-history-item time{color:var(--ink);font-size:calc(11px * var(--ui-scale,1));white-space:nowrap}.schedule-swap-history-item .schedule-person-select{width:100%;min-width:0}
.schedule-sheet-panel{display:flex;flex-direction:column}.schedule-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border-bottom:1px solid var(--line)}.schedule-sheet-heading h2{margin:0;color:var(--ink);font-size:calc(15px * var(--ui-scale,1));overflow-wrap:anywhere}.schedule-sheet-heading span{display:block;margin-top:4px;color:var(--muted);font-size:calc(10px * var(--ui-scale,1));line-height:1.4}.schedule-sheet-actions{display:flex;flex-wrap:wrap;gap:6px}.schedule-sheet-actions button{white-space:nowrap}.schedule-table-wrap{min-width:0;min-height:200px;flex:1;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.schedule-table{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0}.schedule-table td{min-width:110px;padding:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}.schedule-table input{display:block;width:100%;min-width:110px;height:40px;padding:6px 9px;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:calc(12px * var(--ui-scale,1))}.schedule-table input:focus{box-shadow:inset 0 0 0 2px var(--green);background:color-mix(in srgb,var(--green) 7%,var(--surface))}.schedule-table .schedule-heading-cell{background:color-mix(in srgb,var(--green) 13%,var(--surface));font-weight:700}.schedule-empty{display:grid;min-height:220px;place-items:center;padding:24px;color:var(--muted);font-size:calc(12px * var(--ui-scale,1));text-align:center;line-height:1.6}
@media(max-width:900px){.schedule-content{grid-template-columns:minmax(0,1fr);align-content:start}.schedule-calendar-panel{width:100%}.schedule-day{min-height:clamp(52px,9vw,76px)}}
@media(max-width:600px){.schedule-header{align-items:flex-start;flex-direction:column;gap:10px;padding:12px}.schedule-header h1{font-size:calc(18px * var(--ui-scale,1))}.schedule-toolbar{width:100%;justify-content:flex-start}.schedule-toolbar button{flex:0 0 auto;min-height:36px}.schedule-toolbar .schedule-month-label{flex:1 1 auto;min-width:90px}.schedule-content{gap:10px;padding:10px}.schedule-sheet-heading{align-items:flex-start;flex-direction:column}.schedule-sheet-actions{width:100%}.schedule-sheet-actions button{flex:1 1 auto}.schedule-day{min-height:50px}.schedule-day small{font-size:calc(7px * var(--ui-scale,1))}}
@media(max-width:390px){.schedule-toolbar{gap:4px}.schedule-toolbar button{padding-inline:6px;font-size:calc(10px * var(--ui-scale,1))}.schedule-day{min-height:44px;padding-inline:1px}.schedule-day small{font-size:7px}.schedule-table td,.schedule-table input{min-width:92px}}

/* Fit Gmail category names to the available width and keep scrollbars invisible. */
.conversation-sort-menu{scrollbar-width:none}.conversation-sort-menu::-webkit-scrollbar{display:none}
.schedule-day{border-inline-start:1px solid color-mix(in srgb,var(--line) 65%,transparent)}
.schedule-day.rest-day{background:color-mix(in srgb,var(--green) 25%,var(--surface));color:var(--ink);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 72%,var(--surface));font-weight:700}
.schedule-day.rest-day small{color:var(--ink);font-weight:700}
.schedule-day{align-items:flex-start;padding:6px;gap:3px;text-align:left}.schedule-day>span{align-self:center}.schedule-day .schedule-duty-name{max-width:100%;padding:2px 5px;border-radius:8px;background:color-mix(in srgb,var(--green) 19%,var(--surface));color:var(--ink);font-size:calc(9px * var(--ui-scale,1));font-weight:600;text-align:center}.schedule-day .schedule-duty-more{align-self:center;color:var(--muted);font-size:calc(8px * var(--ui-scale,1))}.schedule-day .schedule-holiday-label{max-width:100%;color:var(--danger,#d34b56);font-size:calc(8px * var(--ui-scale,1));font-weight:700}.schedule-sheet-panel{gap:0}.schedule-roster-summary{min-height:0;flex:1;padding:14px;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.schedule-roster-summary h3{margin:0 0 10px;color:var(--ink);font-size:calc(14px * var(--ui-scale,1))}.schedule-roster-list{display:grid;gap:7px}.schedule-roster-item{display:grid;grid-template-columns:48px 28px minmax(0,1fr);align-items:center;gap:8px;width:100%;padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);text-align:left}.schedule-roster-item:hover{background:color-mix(in srgb,var(--green) 8%,var(--surface))}.schedule-roster-item time{font-weight:700}.schedule-roster-item>span{color:var(--muted)}.schedule-roster-item>div,.schedule-assignee-list{display:flex;flex-wrap:wrap;gap:5px;min-width:0}.schedule-assignee-chip{display:inline-flex;max-width:100%;padding:4px 8px;border-radius:999px;background:color-mix(in srgb,var(--green) 16%,var(--surface));color:var(--ink);font-size:calc(11px * var(--ui-scale,1));font-style:normal;overflow-wrap:anywhere}.schedule-day-info{align-content:start}.schedule-holiday-detail{color:var(--muted)}.schedule-source-details{flex:0 0 auto;max-height:42%;border-top:1px solid var(--line);background:var(--surface)}.schedule-source-details>summary{padding:11px 14px;color:var(--ink);font-size:calc(11px * var(--ui-scale,1));font-weight:700;cursor:pointer}.schedule-source-details>p{margin:0;padding:0 14px 8px;color:var(--muted);font-size:calc(10px * var(--ui-scale,1));line-height:1.5}.schedule-source-details[open]{display:flex;flex-direction:column;min-height:0}.schedule-source-details .schedule-table-wrap{min-height:140px;max-height:300px;flex:none;border-top:1px solid var(--line)}
@media(max-width:900px){.schedule-roster-summary{max-height:42vh}.schedule-source-details{max-height:45%}}
@media(max-width:600px){.schedule-day{min-height:62px;padding:4px 2px;align-items:center}.schedule-day .schedule-duty-name{padding:2px 3px;font-size:calc(7px * var(--ui-scale,1))}.schedule-day .schedule-holiday-label{font-size:6px}.schedule-roster-item{grid-template-columns:42px 20px minmax(0,1fr);gap:5px;padding:8px 6px}.schedule-assignee-chip{font-size:calc(10px * var(--ui-scale,1))}.schedule-source-details .schedule-table-wrap{max-height:240px}}
.schedule-calendar-footer{grid-template-columns:minmax(0,1fr) minmax(0,1.25fr)}
@media(max-width:700px){.schedule-calendar-footer{grid-template-columns:minmax(0,1fr)}.schedule-swap-history{border-left:0;border-top:1px solid var(--line)}.schedule-swap-history-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.schedule-swap-history-grid{grid-template-columns:minmax(0,1fr)}}
.schedule-roster-item{grid-template-columns:78px minmax(0,1fr);align-items:start}.schedule-roster-date{display:flex;align-items:center;gap:7px;padding:3px 0;border:0;background:transparent;color:var(--ink);text-align:left;cursor:pointer}.schedule-roster-date time{font-weight:700;white-space:nowrap}.schedule-roster-date span{color:var(--muted)}.schedule-roster-assignees{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}.schedule-roster-label{display:inline-flex;align-items:center;min-height:30px;padding:4px 9px;border-radius:9px;background:color-mix(in srgb,var(--green) 13%,var(--surface));color:var(--ink);font-size:calc(11px * var(--ui-scale,1))}.schedule-person-select{max-width:100%;min-width:94px;min-height:32px;padding:4px 24px 4px 9px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);font:inherit;font-size:calc(11px * var(--ui-scale,1));cursor:pointer}.schedule-duty-detail{display:grid;gap:9px}.schedule-duty-detail>div{display:grid;gap:5px}.schedule-duty-detail>div>strong{font-size:calc(10px * var(--ui-scale,1));color:var(--muted)}.schedule-roster-control,.schedule-swap-person{display:inline-flex;align-items:center;gap:5px;max-width:100%;color:var(--muted);font-size:calc(10px * var(--ui-scale,1))}.schedule-swap-person{flex-wrap:wrap;padding:5px 7px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}.schedule-swap-person small{white-space:nowrap}.schedule-swap-person .schedule-person-select{min-width:76px;max-width:130px}.schedule-swap-person small:last-child{color:var(--muted)}
@media(max-width:600px){.schedule-roster-item{grid-template-columns:62px minmax(0,1fr)}.schedule-person-select{min-width:84px;flex:1 1 92px}.schedule-roster-label{font-size:calc(10px * var(--ui-scale,1))}}

/* Show every assigned person in each calendar date cell; let rows grow and the calendar area scroll. */
.schedule-day{height:auto;overflow:visible;align-self:stretch}
.schedule-day small{height:auto;overflow:visible;white-space:normal;text-overflow:clip;overflow-wrap:anywhere}
.schedule-day .schedule-duty-name{align-self:stretch;line-height:1.2}
.schedule-calendar-grid{grid-auto-rows:minmax(76px,auto)}

/* Improve default readability of the schedule calendar without bypassing user font scaling. */
.schedule-weekdays{font-size:calc(14px * var(--ui-scale,1))}
.schedule-day{font-size:calc(16px * var(--ui-scale,1))}
.schedule-day .schedule-duty-name{font-size:calc(16px * var(--ui-scale,1))}
.schedule-day .schedule-holiday-label{font-size:calc(10px * var(--ui-scale,1))}
.schedule-day-info{font-size:calc(13px * var(--ui-scale,1))}
@media(max-width:600px){.schedule-day .schedule-duty-name{font-size:calc(9px * var(--ui-scale,1))}.schedule-day .schedule-holiday-label{font-size:calc(8px * var(--ui-scale,1))}}
.schedule-weekdays,.schedule-calendar-grid{grid-template-columns:.2fr repeat(5,minmax(0,1fr)) 1fr}
.schedule-swap-history-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:7px}
.schedule-swap-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(64px,auto) minmax(0,1fr);align-items:center;gap:8px;min-width:0}
.schedule-swap-pair-label{color:var(--muted);font-size:calc(11px * var(--ui-scale,1));font-weight:700;text-align:center;white-space:nowrap}
.schedule-swap-history-empty{min-height:1px}
@media(max-width:420px){.schedule-swap-pair{grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr);gap:4px}.schedule-swap-pair-label{font-size:calc(9px * var(--ui-scale,1))}}

/* Put date editing beside the calendar and keep each spreadsheet row as one swap group. */
.schedule-content{grid-template-columns:minmax(250px,.32fr) minmax(0,1fr);align-items:stretch;overflow:hidden}
.schedule-edit-panel{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;overflow:auto;border:1px solid var(--line);border-radius:14px;background:var(--surface);scrollbar-width:thin}
.schedule-edit-panel .schedule-day-info{min-height:0;border-bottom:1px solid var(--line)}
.schedule-edit-panel .schedule-swap-history{padding:12px;border:0}
.schedule-edit-panel-header button{display:none}
.schedule-calendar-panel{display:grid;grid-template-rows:auto minmax(0,1fr);align-self:stretch;height:100%;min-height:0}
.schedule-calendar-grid{grid-template-rows:repeat(var(--schedule-weeks,6),minmax(0,1fr));grid-auto-rows:unset;min-height:0}
.schedule-swap-history-grid{gap:7px}
.schedule-swap-pair{grid-template-columns:minmax(0,1fr) 22px minmax(0,1fr);gap:5px;padding:7px;border:1px solid var(--line);border-radius:10px;background:color-mix(in srgb,var(--surface) 78%,var(--green) 4%)}
.schedule-swap-history-member{display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:4px;min-width:0}
.schedule-swap-history-member time{overflow:hidden;color:var(--muted);font-size:calc(10px * var(--ui-scale,1));text-overflow:ellipsis;white-space:nowrap}
.schedule-swap-history-member .schedule-person-select{width:100%;min-width:0;padding-inline:6px}
.schedule-swap-pair-label{color:var(--muted);font-size:calc(12px * var(--ui-scale,1))}
@media(max-width:1100px){.schedule-content{grid-template-columns:minmax(0,1fr);overflow:auto}.schedule-calendar-panel{order:1;height:auto}.schedule-edit-panel{order:2;overflow:visible}.schedule-calendar-grid{grid-template-rows:repeat(var(--schedule-weeks,6),minmax(70px,auto))}}

/* Keep the whole schedule month and the lower editing controls in view at 100%. */
@media(min-width:1101px) and (min-height:760px){
  .schedule-content{min-height:0;overflow:hidden;padding:8px}
  .schedule-calendar-panel{display:grid;grid-template-rows:auto minmax(0,1fr);align-self:stretch;height:100%;min-height:0}
  .schedule-calendar-grid{grid-template-rows:repeat(var(--schedule-weeks,6),minmax(0,1fr));grid-auto-rows:unset;min-height:0}
  .schedule-day{min-height:0;height:100%;overflow:hidden;gap:2px;padding:3px 2px}
  .schedule-day>span{font-size:clamp(18px,calc(1.8vh * var(--ui-scale,1)),22px);line-height:1.05}
  .schedule-day .schedule-duty-name{flex:0 1 auto;min-height:0;padding:1px 3px;font-size:clamp(9px,calc(1.25vh * var(--ui-scale,1)),15px);line-height:1.05;white-space:nowrap;overflow:hidden}
  .schedule-edit-panel{overflow-y:auto}
  .schedule-day-info,.schedule-swap-history{padding:8px}
  .schedule-swap-history h3{margin-bottom:5px}
  .schedule-swap-history-grid{gap:4px 8px}
  .schedule-person-select{min-height:28px;padding-block:2px}
}
.schedule-day.sheet-holiday{background:color-mix(in srgb,#ef3340 25%,var(--surface));box-shadow:inset 0 0 0 2px #ed2939;color:var(--danger,#c52232)}
.schedule-day.sheet-holiday>span{font-weight:800}
.schedule-day.sheet-holiday .schedule-holiday-label{color:var(--danger,#c52232)}
:root[data-theme="dark"] .schedule-day.sheet-holiday{color:#ffb6bc}
:root[data-theme="dark"] .schedule-day.sheet-holiday .schedule-holiday-label{color:#ffb6bc}

/* Improve calendar and selected-day readability with consistent sizing. */
.schedule-day{gap:3px}
.schedule-day>span{font-size:clamp(21px,calc(2.15vh * var(--ui-scale,1)),27px);line-height:1.05}
.schedule-day .schedule-duty-name{padding:2px 4px;font-size:clamp(14px,calc(1.55vh * var(--ui-scale,1)),18px);line-height:1.1}
.schedule-day .schedule-holiday-label{font-size:clamp(9px,calc(1.1vh * var(--ui-scale,1)),12px)}
.schedule-edit-panel .schedule-day-info{gap:8px;font-size:calc(15px * var(--ui-scale,1));line-height:1.5}
.schedule-edit-panel .schedule-day-info>strong{font-size:calc(18px * var(--ui-scale,1))}
.schedule-edit-panel .schedule-duty-detail>div>strong{font-size:calc(14px * var(--ui-scale,1))}
.schedule-edit-panel .schedule-duty-detail>div>span,.schedule-edit-panel .schedule-holiday-detail{font-size:calc(14px * var(--ui-scale,1))}
.schedule-edit-panel .schedule-person-select{min-height:36px;font-size:calc(15px * var(--ui-scale,1))}
.schedule-edit-panel .schedule-swap-history h3{font-size:calc(17px * var(--ui-scale,1))}
.schedule-swap-history-member time{font-size:calc(13px * var(--ui-scale,1))}
.schedule-swap-history-member .schedule-person-select{font-size:calc(14px * var(--ui-scale,1))}
@media(max-width:1100px){.schedule-day>span{font-size:clamp(18px,calc(2.4vw * var(--ui-scale,1)),24px)}.schedule-day .schedule-duty-name{font-size:clamp(11px,calc(2vw * var(--ui-scale,1)),15px)}.schedule-edit-panel .schedule-day-info{font-size:calc(14px * var(--ui-scale,1))}.schedule-edit-panel .schedule-day-info>strong{font-size:calc(17px * var(--ui-scale,1))}}
@media(max-width:600px){.schedule-day>span{font-size:calc(16px * var(--ui-scale,1))}.schedule-day .schedule-duty-name{padding:1px 2px;font-size:calc(9px * var(--ui-scale,1))}.schedule-day .schedule-holiday-label{font-size:calc(7px * var(--ui-scale,1))}.schedule-edit-panel .schedule-day-info{font-size:calc(13px * var(--ui-scale,1))}.schedule-edit-panel .schedule-day-info>strong{font-size:calc(15px * var(--ui-scale,1))}.schedule-edit-panel .schedule-duty-detail>div>strong,.schedule-edit-panel .schedule-duty-detail>div>span,.schedule-edit-panel .schedule-holiday-detail{font-size:calc(12px * var(--ui-scale,1))}.schedule-edit-panel .schedule-person-select{min-height:32px;font-size:calc(12px * var(--ui-scale,1))}.schedule-edit-panel .schedule-swap-history h3{font-size:calc(14px * var(--ui-scale,1))}.schedule-swap-history-member time,.schedule-swap-history-member .schedule-person-select{font-size:calc(11px * var(--ui-scale,1))}}
@media(min-width:1101px){.schedule-day .schedule-duty-name{display:flex;flex:1 1 0;align-items:center;justify-content:center;min-height:22px;padding:3px 4px;font-size:clamp(16px,calc(1.7vh * var(--ui-scale,1)),20px);line-height:1.05}.schedule-day .schedule-holiday-label{margin-top:auto}}
@media(min-width:1101px){.schedule-day{display:grid;grid-template-columns:28px minmax(0,1fr);grid-template-rows:minmax(0,1fr);align-items:stretch;gap:4px}.schedule-day>.schedule-day-number{grid-column:1;grid-row:1;align-self:start;justify-self:center}.schedule-day-content{grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:stretch;gap:3px;min-width:0;min-height:0}.schedule-day .schedule-duty-name{width:100%;max-width:none}.schedule-day .schedule-holiday-label{width:100%;margin-top:auto}}

@media(max-width:760px){
  .schedule-mobile-back{position:absolute;z-index:5;top:12px;left:10px;display:grid;width:40px;height:40px;place-items:center;padding:0;border:1px solid color-mix(in srgb,var(--green) 35%,var(--line));border-radius:12px;background:color-mix(in srgb,var(--green) 10%,var(--surface));color:var(--ink);box-shadow:0 2px 8px #0002;-webkit-tap-highlight-color:transparent}
  .schedule-mobile-back:active{background:color-mix(in srgb,var(--green) 20%,var(--surface));transform:scale(.96)}
  .schedule-mobile-back svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  .schedule-header>div:first-of-type{padding-left:42px}
  .schedule-content{position:relative;display:block;overflow:auto;padding:8px}
  .schedule-calendar-panel{order:0;width:100%;height:auto}
  .schedule-edit-panel{display:flex;position:fixed;z-index:1002;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));left:12px;width:auto;max-height:min(78dvh,720px);min-height:0;overflow:auto;border-radius:16px;box-shadow:0 18px 50px #0006;scrollbar-width:none;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(20px) scale(.985);transition:opacity .22s ease,transform .22s ease,visibility 0s linear .22s}
  .schedule-view.schedule-mobile-editor-open .schedule-edit-panel{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0) scale(1);transition:opacity .22s ease,transform .22s ease,visibility 0s}
  .schedule-mobile-editor-backdrop{position:absolute;z-index:31;inset:0;display:block;width:100%;height:100%;border:0;background:#0008;opacity:0;pointer-events:none;transition:opacity .22s ease}
  .schedule-view.schedule-mobile-editor-open .schedule-mobile-editor-backdrop{opacity:1;pointer-events:auto}
  .schedule-edit-panel-header{position:sticky;z-index:2;top:0;display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:8px 14px;border-bottom:1px solid var(--line);background:var(--surface);color:var(--ink)}
  .schedule-edit-panel-header strong{font-size:calc(15px * var(--ui-scale,1))}
  .schedule-edit-panel-header button{display:inline-grid;place-items:center;width:34px;height:34px;border:0;border-radius:50%;background:color-mix(in srgb,var(--muted) 12%,var(--surface));color:var(--ink);font-size:24px;line-height:1}
  .schedule-edit-panel .schedule-day-info{border:0;border-bottom:1px solid var(--line)}
  .schedule-edit-panel .schedule-swap-history{padding:12px}
  .schedule-day-content{display:contents}
}

@media(max-width:760px){
  #scheduleView .schedule-calendar-panel{zoom:var(--schedule-zoom,1);touch-action:pan-x pan-y}
}

/* Keep the calendar date in its original top position; put holiday names beside it. */
.schedule-day-date-line{display:flex;grid-column:1/-1;grid-row:1;align-items:center;justify-content:center;gap:5px;width:100%;min-width:0;min-height:26px;}
.schedule-day-date-line .schedule-day-number{display:inline-flex;flex:none;align-items:center;justify-content:center;font-size:clamp(21px,calc(2.15vh * var(--ui-scale,1)),27px);line-height:1.05;}
.schedule-day.today .schedule-day-date-line .schedule-day-number{min-width:26px;min-height:26px;border-radius:50%;background:var(--green);color:#fff;}
.schedule-day .schedule-day-date-line .schedule-holiday-label{display:block;flex:0 1 auto;width:auto;max-width:calc(100% - 34px);margin:0;overflow:hidden;font-size:clamp(9px,calc(1.1vh * var(--ui-scale,1)),12px);line-height:1.2;text-align:left;text-overflow:ellipsis;white-space:nowrap;}
.schedule-edit-panel .schedule-day-info>strong{width:fit-content;padding:2px 0 5px;border-bottom:2px solid var(--green);font-size:calc(22px * var(--ui-scale,1));font-weight:800;line-height:1.2;letter-spacing:.02em;}
.schedule-day-content{grid-column:1/-1;grid-row:2;min-width:0;}
.schedule-day.sheet-holiday .schedule-day-date-line .schedule-day-number{font-weight:800;}
@media(min-width:1101px){.schedule-day{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);}.schedule-day-date-line{grid-column:1;grid-row:1;}.schedule-day-content{grid-column:1;grid-row:2;}.schedule-day .schedule-duty-name{flex:1 1 0;}}
@media(max-width:600px){.schedule-day-date-line{min-height:22px;gap:2px}.schedule-day-date-line .schedule-day-number{font-size:calc(16px * var(--ui-scale,1))}.schedule-day .schedule-day-date-line .schedule-holiday-label{max-width:calc(100% - 24px);font-size:calc(7px * var(--ui-scale,1))}.schedule-edit-panel .schedule-day-info>strong{font-size:calc(18px * var(--ui-scale,1))}}
