:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans CJK SC","Microsoft YaHei",sans-serif;color:#24323c;background:#f3f5f6;font-size:14px;--green:#16517b;--muted:#7b858c;--line:#e4e8eb}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer;border:0;background:none;color:inherit;min-height:44px;touch-action:manipulation}button:disabled{cursor:not-allowed;opacity:.45}input,select,textarea{width:100%;min-width:0;border:1px solid var(--line);border-radius:12px;padding:13px;background:white;color:inherit;outline:none;font-size:16px}input:focus,textarea:focus,select:focus{border-color:var(--green);box-shadow:0 0 0 3px #16517b12}textarea{resize:none}h1,h2,p{margin:0}h1{font-size:25px;letter-spacing:-.7px}h2{font-size:17px}p{line-height:1.65}label{display:block;font-size:13px;color:#626e76}label input,label select{margin-top:7px}form label+label{margin-top:16px}[hidden]{display:none!important}.muted{color:var(--muted);font-size:13px}.fine{font-size:11px;color:var(--muted);line-height:1.7}.center{text-align:center;margin-top:22px}.eyebrow{display:block;font-size:10px;letter-spacing:1.8px;color:var(--muted);font-weight:600;margin-bottom:9px}.row{display:flex;align-items:center;justify-content:space-between;gap:12px}.primary,.secondary,.danger{width:100%;border-radius:13px;padding:13px 18px;font-weight:600;min-height:47px}.primary{background:var(--green);color:white;display:flex;align-items:center;justify-content:space-between}.secondary{background:#edf1f4;color:var(--green)}.danger{background:#ffeded;color:#b14242}.panel{background:white;border:1px solid var(--line);border-radius:20px;padding:24px}.panel h2{margin-bottom:18px}.panel .primary{margin-top:24px}.panel .fine{margin-top:12px}.notice{background:#fff7e5;color:#886a2b;padding:13px 16px;border-radius:12px;font-size:12px;line-height:1.65}.compact{margin:14px 0}.login-screen{max-width:440px;margin:0 auto;padding:55px 25px 32px}.brand-mark{display:grid;place-items:center;width:52px;height:52px;border-radius:17px;background:var(--green);color:white;font-size:26px;margin-bottom:30px}.login-screen h1{font-size:34px;line-height:1.35;margin:15px 0}.login-screen>.muted{margin-bottom:28px}.login-screen>.notice{margin-top:20px}#workspace{max-width:620px;margin:auto;min-height:100dvh;background:#f7f8f9}header{padding:26px 22px 18px;display:flex;justify-content:space-between;align-items:center;background:#f7f8f9}.profile{background:#e4eaee;border:3px solid white;border-radius:50%;width:44px;height:44px;font-size:17px;color:var(--green)}main{padding:0 20px 105px}.quota-card{background:linear-gradient(120deg,#174a6e,#27638e);border-radius:21px;color:white;padding:23px 22px}.pill{border-radius:20px;padding:4px 10px;font-size:10px;background:#ffffff20;white-space:nowrap}.quota-number{display:flex;align-items:baseline;gap:10px;margin:18px 0}.quota-number strong{font-size:45px;font-weight:650;letter-spacing:-2px}.quota-number>span{font-size:13px;color:#c7d7e2}.quota-card .fine{color:#d1dee7;margin-top:11px}progress{width:100%;height:5px;border:0;border-radius:6px;overflow:hidden;background:#ffffff24}progress::-webkit-progress-bar{background:#ffffff24}progress::-webkit-progress-value{background:#b8d3e7}progress::-moz-progress-bar{background:#b8d3e7}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:24px 0 14px}.section-heading h2 .muted{margin-left:6px}.text-button{color:var(--green);font-size:13px;font-weight:600;white-space:nowrap}.search{display:flex;align-items:center;background:white;border-radius:12px;border:1px solid var(--line);padding-left:14px}.search>span{font-size:25px;color:#8b98a2}.search input{border:0;margin:0;background:transparent;box-shadow:none}.account-list{display:grid;gap:12px}.account-card,.user-card{background:white;border:1px solid var(--line);border-radius:17px;padding:17px;margin-bottom:11px}.account-top{display:flex;align-items:center;gap:12px}.avatar{width:43px;height:43px;min-width:43px;border-radius:15px;background:#edf0f3;color:#506a7c;display:grid;place-items:center;font-weight:600}.account-name{flex:1;min-width:0}.account-name strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;margin-bottom:5px}.account-name p{font-size:11px;color:var(--muted)}.offline{font-size:11px;color:#8d959b;white-space:nowrap}.status-dot{width:7px;height:7px;background:#b8c0c5;display:inline-block;border-radius:50%;margin-right:4px}.account-actions{border-top:1px solid #f0f2f3;display:flex;gap:6px;margin-top:14px;padding-top:9px}.account-actions button{flex:1;min-height:36px;font-size:12px;color:#667681}.account-actions button:first-child{background:#eff4f7;color:var(--green);border-radius:9px}.account-actions .remove{flex:0 0 42px;color:#aab0b4}.empty{padding:38px 12px;text-align:center;color:var(--muted);font-size:13px;line-height:1.8}.empty strong{color:#53636f;display:block;margin-bottom:7px}.empty-tag{font-size:11px;border:1px solid var(--line);border-radius:30px;padding:6px 12px;color:#8c959b}nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:620px;display:flex;border-top:1px solid var(--line);background:#ffffffed;backdrop-filter:blur(12px);padding:8px 10px calc(8px + env(safe-area-inset-bottom));z-index:5}nav button{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:10px;color:#949ca2}nav button span{font-size:25px;line-height:28px}nav button.active{color:var(--green);font-weight:650}.listener-banner{display:flex;align-items:center;gap:8px;border:1px solid var(--line);padding:13px;background:white;border-radius:14px}.listener-banner p{font-size:10px;color:var(--muted);margin-top:3px}.listener-banner strong{font-size:13px}.listener-banner .pill{margin-left:auto;background:#f1f3f4;color:#7b868e;font-size:9px}.chat-empty{min-height:290px;height:calc(100dvh - 445px);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:16px}.chat-empty p{font-size:12px;color:#8b959c}.chat-symbol{font-size:37px;width:70px;height:70px;display:grid;place-items:center;color:#91a6b5;background:#e9edf0;border-radius:24px}.chat-empty h2{font-size:16px;color:#60707c}.composer{background:white;border:1px solid var(--line);border-radius:16px;padding:12px;position:sticky;bottom:85px}.quick-replies{display:flex;gap:8px;overflow:auto;margin-bottom:12px}.quick-replies button{min-height:30px;font-size:11px;border-radius:30px;background:#f2f4f6;white-space:nowrap;padding:5px 12px}.identity-row{font-size:10px;display:flex;gap:8px;align-items:center;margin-bottom:10px;color:#8e969b}.identity-row strong{color:var(--green);max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.identity-row span:last-child{margin-left:auto}#messageForm{display:flex;align-items:center;gap:9px}#messageForm .avatar{border-radius:50%;width:35px;height:35px;min-width:35px;font-size:12px}#messageInput{border:0;font-size:13px;padding:10px 0;max-height:110px;box-shadow:none}.send{background:var(--green);color:white;border-radius:50%;min-width:36px;min-height:36px;font-size:23px}.composer .fine{font-size:10px;margin-top:10px}.monitor-panel{margin-top:25px}.monitor-panel .muted{margin-bottom:18px}.monitor-panel button{margin-top:14px}.quota-form{display:flex;gap:10px;margin-top:15px;align-items:center}.quota-form label{flex:1}.quota-form input{max-width:130px;padding:8px}.quota-form button{width:auto;min-height:40px;font-size:12px}dl{display:grid;grid-template-columns:1fr 1fr;row-gap:18px;font-size:12px;margin:28px 0}dt{color:var(--muted)}dd{text-align:right;margin:0}dialog{border:0;border-radius:23px 23px 0 0;padding:24px 22px calc(25px + env(safe-area-inset-bottom));width:min(100%,620px);max-width:100%;max-height:88dvh;overflow:auto;margin:auto auto 0;background:white;color:inherit}dialog::backdrop{background:#182a3766;backdrop-filter:blur(2px)}dialog .section-heading{margin:0 0 12px}dialog .muted{margin-bottom:20px}dialog .primary{margin-top:22px}.close{font-size:27px;color:#858e95;width:40px}.identity-choice{display:flex;width:100%;gap:12px;align-items:center;border-bottom:1px solid var(--line);padding:14px 0;text-align:left}.identity-choice .account-name{flex:1}.identity-choice.selected{color:var(--green)}#identityList{max-height:50dvh;overflow:auto}#confirmDialog p{margin:20px 0;overflow-wrap:anywhere}#toast{position:fixed;z-index:50;bottom:100px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 40px);padding:13px 18px;background:#20323e;color:white;border-radius:13px;font-size:12px;box-shadow:0 8px 30px #182a3722}@media(min-width:700px){#workspace{border-left:1px solid var(--line);border-right:1px solid var(--line)}.login-screen{padding-top:75px}dialog{border-radius:22px;margin:auto;max-width:430px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

.icon{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}.chat-symbol .icon{width:34px;height:34px}.search .icon{width:19px;height:19px}

.user-tools{display:flex;justify-content:flex-end;border-top:1px solid var(--line);margin-top:12px;padding-top:5px}.user-tools button{padding:0 4px}#passwordResetForm>.fine{margin-top:16px}#passwordResetTarget{overflow-wrap:anywhere}

.account-name-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--line);margin-top:12px;padding-top:5px}.account-name-tools button{padding:0 4px}#accountNameTarget{overflow-wrap:anywhere}

.brand-logo{object-fit:contain;padding:0;width:88px;height:88px;border-radius:22px}.header-logo{object-fit:contain;border-radius:12px;flex-shrink:0}header>div{flex:1}header{gap:12px}

.avatar{position:relative;overflow:hidden}.account-avatar-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:var(--soft)}

/* Larger, calm mobile account controls. */
.account-top>.avatar{width:56px;height:56px;min-width:56px;border-radius:17px;font-size:20px}.account-name strong{font-size:17px}.account-name p{font-size:13px;line-height:1.6}.account-remark{color:#4e616e!important}.account-status{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;min-height:36px;padding:8px 11px;border-radius:12px;font-size:13px;font-weight:650;white-space:nowrap}.account-status .status-dot{background:currentColor}.status-offline{color:#b83f48;background:#fff0f0}.status-success{color:#114a73;background:#e6eff5}.status-pending{color:#9b6519;background:#fff2da}.account-actions button{font-size:15px;min-height:46px}.account-name-tools{justify-content:flex-end}.account-name-tools button{font-size:15px;padding:0 16px;min-height:44px}.clear-name{display:flex;align-items:center;gap:8px;margin:16px 0}.clear-name input{width:18px;height:18px;margin:0}.room-list{display:flex;gap:8px;overflow-x:auto;padding:10px 0;scrollbar-width:thin}.room-choice{flex:0 0 auto;max-width:220px;padding:10px 15px;border-radius:13px;background:#edf0f2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px}.room-choice.selected{background:#16517b;color:white}.message-list{height:calc(100dvh - 475px);min-height:180px;overflow-y:auto;padding:12px 2px 24px;overscroll-behavior:contain}.chat-message{margin-bottom:14px;max-width:92%}.message-meta{display:flex;gap:12px;align-items:center;font-size:12px;color:#637480;margin:0 4px 5px}.message-meta time{color:#8b949a;font-size:11px}.chat-message p{white-space:pre-wrap;overflow-wrap:anywhere;background:white;border:1px solid #e1e6ea;border-radius:0 14px 14px 14px;padding:10px 13px;font-size:15px;line-height:1.6}.listener-banner>div{min-width:0}.listener-banner strong{overflow-wrap:anywhere}.listener-banner .pill{flex-shrink:0;font-size:12px}#accountNameHint{margin:12px 0}#accountNameForm .fine{margin:14px 0}#messageList:empty{display:none}
@media(max-width:380px){.account-status{font-size:12px;padding:7px 9px}.account-top{gap:9px}.account-name strong{font-size:16px}.account-top>.avatar{width:50px;height:50px;min-width:50px}.account-card{padding:17px!important}}

.original-identity{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:12px 0}.original-identity>.avatar{width:44px;height:44px;min-width:44px}.original-identity>span:nth-child(2){flex:1;min-width:0}.original-identity strong,.original-identity small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.original-identity strong{font-size:15px}.original-identity small{font-size:12px;color:var(--muted);margin-top:3px}.original-identity b{font-size:13px;color:var(--green)}#originalChatFrame{display:block;width:100%;height:calc(100dvh - 290px);min-height:370px;border:1px solid var(--line);border-radius:16px;background:white}#chatView:has(#originalChatShell:not([hidden])){padding-bottom:0}

/* Compact mobile sign-in brand: logo left, title and caption right. */
.login-screen{padding-top:34px}.login-brand{display:flex;align-items:center;gap:15px;margin-bottom:26px}.login-brand .brand-logo{width:76px;height:76px;min-width:76px;border-radius:20px;margin:0}.login-brand-copy{min-width:0}.login-brand .eyebrow{font-size:8px;letter-spacing:1.2px}.login-brand h1{font-size:23px;line-height:1.38;margin:8px 0 7px}.login-brand .muted{font-size:11px;line-height:1.6;margin:0;white-space:nowrap}.login-screen [data-refresh-app]{font-size:12px;min-height:34px;padding:4px 0}.login-screen [data-app-version]{float:right;font-size:10px;line-height:34px;color:#8c959c}
@media(max-width:375px){.login-screen{padding:28px 20px}.login-brand{gap:12px}.login-brand .brand-logo{width:68px;height:68px;min-width:68px}.login-brand h1{font-size:21px}.login-brand .muted{font-size:10px}.login-brand .eyebrow{font-size:7px;letter-spacing:.8px}}

.password-field{display:flex;align-items:center;position:relative}.password-field input{padding-right:60px}.password-field button{position:absolute;right:6px;min-height:44px;background:transparent;color:var(--green);padding:6px 10px;font-size:13px}.login-error{border-radius:12px;background:#fff0f0;color:#ad3846;padding:12px;font-size:13px;line-height:1.6;overflow-wrap:anywhere;margin:12px 0}

#originalChatFrame{height:calc(100dvh - 225px);min-height:420px;border-radius:14px}.quick-replies{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none}.quick-replies button{flex-shrink:0;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:34px}.quick-item{display:flex;align-items:center;gap:7px;border-bottom:1px solid var(--line);padding:9px 0}.quick-item p{flex:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}.quick-item button{font-size:13px;padding:6px;min-height:40px;flex-shrink:0}.quick-item [data-delete-quick]{color:#ac4c50}#quickReplyForm{margin-top:18px}#quickReplyForm textarea{width:100%;padding:12px;font:inherit;border:1px solid var(--line);border-radius:12px;resize:vertical;margin:8px 0 15px;box-sizing:border-box}#quickReplyList{max-height:35dvh;overflow-y:auto}

/* The original room owns its title: no duplicate workspace header/status card. */
body.chat-layout{overflow:hidden;overscroll-behavior:none}
.chat-layout #workspace{position:fixed;top:var(--app-top,0px);left:50%;transform:translateX(-50%);width:100%;height:var(--app-height,100dvh);min-height:0;display:flex;flex-direction:column;overflow:hidden}
.chat-layout #workspace>header{display:none}
.chat-layout main{flex:1;min-height:0;padding:0;overflow:hidden;display:flex;flex-direction:column}
.chat-layout #chatView{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.chat-layout .listener-banner{display:none}
.chat-layout #originalChatShell{flex:1;min-height:0;display:flex;overflow:hidden}
.chat-layout #originalChatFrame{flex:1;height:100%;min-height:0;border:0;border-radius:0;width:100%}
.chat-layout nav{position:static;transform:none;flex-shrink:0;padding:4px 10px calc(4px + env(safe-area-inset-bottom));min-height:52px}
.chat-layout .chat-empty{flex:1;height:auto;min-height:0;padding:16px}
.chat-layout .composer{position:static;flex-shrink:0;margin:8px;border-radius:14px}
.chat-layout nav{margin-bottom:calc(-1 * var(--chat-nav-loss,0px));clip-path:inset(0 0 var(--chat-nav-loss,0px) 0);transition:none}

/* Keep quota information available without a large card once identities exist. */
.quota-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 4px;color:#626e76;font-size:13px}
.quota-summary button{min-height:44px;padding:0 8px}

.quick-toggle{color:var(--green);font-size:11px;min-height:32px;padding:4px 6px;white-space:nowrap}

@media (max-width:380px){
 .chat-layout nav{min-height:52px;padding:4px 8px calc(4px + env(safe-area-inset-bottom))}
 .chat-layout nav button{flex-direction:column;justify-content:center;gap:3px;min-height:44px;font-size:11px}
 .chat-layout nav button span{display:flex;align-items:center;line-height:20px}
 .chat-layout nav .icon{width:20px;height:20px}
}

/* Compact identity management; large hit targets without a separate edit row. */
#workspace:has(#accountsView:not([hidden]))>header{padding:14px 14px 8px;gap:10px}
#workspace:has(#accountsView:not([hidden])) .header-logo{width:36px;height:36px;border-radius:10px}
#workspace:has(#accountsView:not([hidden])) header .eyebrow{font-size:8px;margin-bottom:4px;letter-spacing:1.4px}
#workspace:has(#accountsView:not([hidden])) header h1{font-size:21px}
#workspace:has(#accountsView:not([hidden]))>main{padding:0 12px 84px}
#accountsView .quota-summary{font-size:12px;padding:0 2px}
#accountsView .section-heading{margin:6px 0;min-height:44px}
#accountsView .section-heading h2{font-size:15px}
#accountsView .search{padding-left:10px;border-radius:10px;margin-bottom:10px}
#accountsView .search input{padding:10px;font-size:14px;min-height:40px}
#accountsView .compact{margin:10px 0;padding:9px 12px;line-height:1.5}
#accountsView .account-list{gap:10px;grid-template-columns:minmax(0,1fr)}
#accountsView .account-card{min-width:0;padding:12px!important;border-radius:14px;margin-bottom:0}
#accountsView .account-top{gap:8px}
#accountsView .account-top>.avatar{width:44px;height:44px;min-width:44px;border-radius:12px;font-size:17px}
#accountsView .account-name strong{font-size:16px;margin-bottom:2px}
#accountsView .account-name p{font-size:12px;line-height:1.45;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#accountsView .account-status{min-height:30px;padding:5px 7px;border-radius:9px;font-size:11px;gap:4px}
#accountsView .account-status .status-dot{width:6px;height:6px;margin:0}
#accountsView .account-actions{display:grid;grid-template-columns:minmax(40px,1fr) minmax(40px,1fr) minmax(64px,1.4fr) minmax(40px,1fr) 44px;gap:4px;margin-top:9px;padding-top:8px}
#accountsView .account-actions button{min-width:0;min-height:44px;padding:0 3px;font-size:13px;white-space:nowrap;border-radius:8px}
#accountsView .account-actions .account-edit{color:var(--green);background:#f0f3f6}
#accountsView .account-actions .remove{display:grid;place-items:center;width:44px;height:44px;padding:0;color:#b44750;background:#fff0f0}
#accountsView .account-actions .remove svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
#accountsView .account-actions .remove:focus-visible{outline:2px solid #b44750;outline-offset:2px}
#accountsView>.fine.center{margin-top:12px;font-size:10px}

/* Admin review: compact independent panels, bounded lists and mobile-friendly filters. */
.admin-tabs{display:flex;gap:6px;position:sticky;top:0;z-index:5;background:#f7f8f9;padding:8px 0}.admin-tabs button{flex:1;border-radius:12px;font-weight:600;background:#eaeef0}.admin-tabs [aria-selected=true]{background:var(--green);color:white}.admin-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.admin-filters label+label{margin-top:0}.admin-filters input,.admin-filters select{font-size:14px;padding:10px;min-height:44px}.admin-filters .filter-wide{grid-column:1/-1}.admin-summary{margin:14px 0}.admin-account-card,.audit-card{min-width:0;border:1px solid var(--line);border-radius:15px;background:white;padding:12px}.admin-account-card .avatar{flex:none;position:relative;overflow:hidden}.admin-account-card .account-name{min-width:0;flex:1}.admin-account-card .account-name p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.admin-account-card .account-name strong{font-size:15px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-account-card .account-status{font-size:11px;padding:7px;flex:none}.admin-owner{padding:8px 0 4px;font-size:12px;overflow-wrap:anywhere}.admin-account-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) 44px;gap:3px;margin-top:8px;border-top:1px solid var(--line)}.admin-account-actions button{padding:0;font-size:12px;min-width:0}.admin-account-actions .admin-remove{font-size:24px;color:#bb4545;background:#fff0f0;border-radius:10px;width:44px;height:44px}.admin-pagination{display:flex;align-items:center;gap:12px;margin:16px 0}.admin-pagination button{width:auto;flex:1;padding:10px 4px;font-size:12px}.admin-pagination span{font-size:12px;white-space:nowrap}.audit-card{margin:10px 0;overflow-wrap:anywhere}.audit-card p{font-size:12px;margin-top:5px}.audit-card .fine{font-size:11px}.user-tools{display:flex;gap:16px;flex-wrap:wrap}#adminAccountDialog p,#adminActionDialog p{overflow-wrap:anywhere}#adminActionDialog .row{margin-top:18px}

/* Compact user controls: quota + save/edit/delete share a single touch-friendly row. */
#userList .user-card{padding:14px;border-radius:18px;margin-bottom:12px;box-shadow:0 3px 12px #192f3e04}
#userList .account-top{gap:10px}#userList .account-name{min-width:0;flex:1}#userList .account-name strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}#userList .account-name p{font-size:11px;overflow-wrap:anywhere}#userList .avatar{flex-shrink:0;width:40px;height:40px;border-radius:13px}#userList .account-status{flex-shrink:0;padding:7px 9px;font-size:11px}
#userList .user-action-row{display:flex;gap:6px;margin-top:12px;padding:0;border:0;align-items:center}
#userList .user-action-row label{flex:1;min-width:0;display:flex;align-items:center;gap:5px;font-size:11px;white-space:nowrap}
#userList .user-action-row input{flex:1;width:0;min-width:40px;max-width:100px;height:40px;margin:0;padding:6px 3px 6px 7px;border-radius:10px;font-size:14px}
#userList .user-action-row button{flex:0 0 44px;width:44px;min-height:44px;padding:0;border-radius:11px;font-size:12px;font-weight:600;border:1px solid transparent}
#userList .user-save{background:#16517b;color:#fff}#userList .user-edit{background:#ecf1f5;color:#16517b;border-color:#dce5ec!important}#userList .user-delete{background:#fff0ef;color:#b74343;border-color:#f7dedb!important}
#userList .user-links{display:flex;justify-content:flex-end;gap:14px;margin-top:5px}#userList .user-links button{min-height:32px;padding:0;font-size:11px;font-weight:500}#userList .user-links span{font-size:10px;background:#eff2f4;border-radius:6px;padding:2px 5px}
#deleteUserDialog p{margin-top:12px;overflow-wrap:anywhere}#deleteUserDialog .row{margin-top:20px}
/* Join the rounded composer with the bottom navigation without adding vertical space. */
.chat-layout nav{border-radius:0 0 16px 16px;border-top-color:#edf0f2;background:#fff}
.chat-layout nav button{border-radius:10px}.chat-layout nav button.active{color:#084d7e}

/* Verified Telegram identity belongs to the workspace, never a chat identity. */
.profile{position:relative;overflow:hidden;flex-shrink:0}.profile>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.telegram-binding{border-top:1px solid var(--line,#e0e5e9);margin-top:18px;padding-top:16px}.telegram-binding h3{font-size:15px;margin:0 0 10px}.telegram-binding .muted{overflow-wrap:anywhere;font-size:12px}.telegram-binding label{font-size:12px}.telegram-bind-row{display:flex;gap:8px;align-items:center;margin-top:8px}.telegram-bind-row input{width:0;min-width:0;flex:1;margin:0}.telegram-bind-row button{width:auto;min-width:60px;margin:0;padding:10px 14px;border-radius:12px}.telegram-bound-actions{display:flex;gap:16px}.telegram-binding .fine{line-height:1.7}#telegramUnbindDialog{max-width:340px}

.profile-tools{display:flex;gap:10px}.profile-tools>.secondary{flex:1;min-width:0;width:auto;font-size:13px;padding:12px 8px}#changePasswordForm label{display:block;margin:12px 0}#changePasswordForm input{display:block;width:100%;margin-top:6px}

.profile-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0;padding:12px 0;border-block:1px solid var(--line,#e0e5e9)}.profile-summary>.secondary{width:auto;margin:0;padding:10px 14px;border-radius:12px}.profile-summary>.fine{margin:0}

.site-avatar-editor{display:flex;align-items:center;gap:16px;margin:16px 0}.site-avatar-editor img{width:72px;height:72px;object-fit:cover;border-radius:16px}.site-avatar-editor label{position:relative;display:inline-block;overflow:hidden;padding:12px 16px;width:auto}.site-avatar-editor input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}#siteProfileForm>label{display:block}#siteNickname{display:block;width:100%;margin-top:8px}#siteProfileDialog{width:min(380px,calc(100vw - 24px))}

/* Keep full-width profile actions visually separate and centered. */
.profile-session-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:0}
.profile-session-actions>.secondary{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;margin:0;line-height:1.4;text-align:center}
.telegram-bound-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch;gap:12px;margin-top:12px}
.telegram-bound-actions>button{display:flex;justify-content:center;align-items:center;width:100%;min-width:0;min-height:44px;border-radius:12px;padding:10px 12px;font-size:12px;line-height:1.4}
.telegram-bound-actions>#telegramSync{background:#edf1f4}

.telegram-bound-actions{margin-top:12px}

/* Keep the fixed viewport out of transformed containing blocks on iOS. */
html.chat-viewport,html.chat-viewport body{overflow:hidden;overscroll-behavior:none;height:100%;width:100%}
/* These are viewport shells, not scroll owners. hidden still permits focus-driven
   scrolling; clip prevents it. The iframe document keeps its own message scroll. */
html.chat-viewport body{position:fixed;inset:0}
@supports(overflow:clip){
 html.chat-viewport,html.chat-viewport body,
 .chat-layout #workspace,.chat-layout #workspace>main,
 .chat-layout #chatView,.chat-layout #originalChatShell{overflow:clip}
}
.chat-layout #workspace{left:0;right:0;margin:0 auto;transform:none;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
.chat-layout #originalChatFrame{display:block;min-width:0}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}

/* Account-wide login controls stay compact on narrow phones. */
#accountsView>.section-heading{flex-wrap:wrap;gap:8px}.account-toolbar{display:flex;align-items:center;gap:8px}.account-toolbar button{min-height:44px;width:auto;white-space:nowrap;padding:8px 10px;font-size:13px;border-radius:12px}#bulkLoginStatus{overflow-wrap:anywhere}#bulkLoginFailures p{margin-top:6px;color:#a63535}
/* Five equal navigation positions on every screen; admin tools live under My. */
nav button{flex:1 1 0;min-width:0;padding-left:0;padding-right:0;white-space:nowrap}
#profileView #adminNav{display:flex;gap:8px;align-items:center;color:var(--green);margin-bottom:16px}
.chat-layout #personalView{flex:1;min-height:0;display:flex;flex-direction:column;overflow:clip;background:#fff}
.personal-identity{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:1px solid var(--line);flex-shrink:0;background:#f5f8fa}
.personal-identity label{font-size:12px;white-space:nowrap;color:#606d76}.personal-identity select{margin:0;min-height:40px;min-width:0;flex:1;width:0;padding:6px 10px;font-size:14px;border-radius:10px}
#personalFrame{display:block;flex:1;width:100%;min-height:0;height:100%;border:0;background:#fff}
.account-organize{display:flex;align-items:center;gap:8px;border-top:1px solid var(--line);margin-top:8px;padding-top:4px}
.account-organize button{font-size:12px;min-height:44px;padding:6px 10px;border-radius:9px;color:#62727d}.account-organize .is-main{color:#114f7b;background:#e8f0f5;font-weight:650}.account-organize [aria-pressed=true]{color:#084d7e}
.account-organize .account-drag{margin-left:auto;cursor:grab;touch-action:pan-y;user-select:none;-webkit-user-select:none;color:#828d95}.account-drag-chosen{box-shadow:0 4px 18px #182a3724}.account-drag-ghost{opacity:.35}.sortable-fallback{z-index:100!important;pointer-events:none!important}

#accountList .account-card{touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}#accountList .account-card img{-webkit-user-drag:none}#accountList .account-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}#accountList .account-actions button{padding:6px 3px;font-size:12px;border-radius:10px}#accountList .account-login{color:#114f7b;background:#e8f0f5}#accountList .account-logout{color:#c54141;background:#ffeded}#accountList [aria-pressed=true]{color:#114f7b;background:#e8f0f5}#deleteEditedAccount{margin-top:18px;color:#c54141;background:#ffeded}

#saveAccountName{justify-content:center;text-align:center}#accountList .account-drag-chosen{position:relative;z-index:2;outline:2px solid #1c6faa;box-shadow:0 12px 30px #16374f40;animation:account-lift .16s ease-out both}#accountList .account-card button{-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}.account-sort-active,.account-sort-active *{cursor:grabbing!important}.sortable-fallback{box-shadow:0 14px 35px #16374f50;outline:2px solid #1c6faa;border-radius:16px}@keyframes account-lift{from{scale:1}to{scale:1.025}}
/* All five routes share identical navigation geometry; only selection color changes. */
#workspace nav{box-sizing:border-box;height:calc(60px + env(safe-area-inset-bottom,0px));min-height:calc(60px + env(safe-area-inset-bottom,0px));padding:4px 10px calc(4px + env(safe-area-inset-bottom,0px));border-radius:0;background:#fff}
#workspace nav button{height:51px;min-height:44px;flex-direction:column;justify-content:center;align-items:center;gap:3px;font-size:10px;line-height:14px;font-weight:600}
#workspace nav button span{display:flex;align-items:center;justify-content:center;font-size:25px;line-height:24px}
#workspace nav .icon{width:22px;height:22px}
@media(min-width:700px){#workspace nav{max-width:618px}}

/* Keep status in the original header; balance/recharge get a full-width row so long values never squeeze the account name. */
#accountList .account-top{align-items:flex-start}#accountList .account-top>.account-status{flex:0 0 auto;margin-left:auto}.account-finance{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0;padding:7px 8px 7px 12px;min-height:44px;border-radius:11px;background:#f5f8fa}.account-balance{display:flex;align-items:baseline;gap:8px;min-width:0;font-size:11px;color:#6e7981;white-space:nowrap}.account-balance b{display:block;color:#16517b;font-size:17px;line-height:21px;font-variant-numeric:tabular-nums;max-width:180px;overflow:hidden;text-overflow:ellipsis}.account-recharge{flex:0 0 92px;min-height:34px!important;padding:4px 15px;border-radius:9px;background:#e8f0f5;color:#114f7b;font-size:12px;font-weight:650}.account-recharge:disabled{background:#edeff1;color:#9aa2a8}
.recharge-dialog{padding:0!important;width:min(100%,620px)!important;height:100dvh;max-height:100dvh!important;border-radius:0!important;overflow:hidden!important;background:#f6f7f8}.recharge-dialog[open]{display:flex;flex-direction:column}.recharge-head{position:relative;z-index:4;height:52px;min-height:52px;display:grid;grid-template-columns:52px 1fr 52px;align-items:center;border-bottom:1px solid var(--line);background:#fff;text-align:center;pointer-events:auto}.recharge-head button{position:relative;z-index:5;width:52px;height:52px;min-height:52px;padding:0;font-size:36px;line-height:40px;color:#16517b;touch-action:manipulation;pointer-events:auto}.recharge-head strong{font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recharge-result{position:relative;z-index:2;display:flex;flex-direction:column;gap:3px;padding:10px 14px;border-bottom:1px solid #c7dbea;background:#e9f2f8;color:#12476d;font-size:12px;line-height:18px}.recharge-result[hidden]{display:none}.recharge-result strong{font-size:14px}.recharge-result.is-warning{border-color:#f1dfa8;background:#fff8df;color:#856214}.recharge-result.is-error{border-color:#f1caca;background:#fff0f0;color:#a53636}.recharge-dialog #rechargeLoading{margin:auto}.recharge-dialog iframe{display:block;width:100%;height:calc(100dvh - 52px);min-height:0;flex:1;border:0;background:#fff}
@media(max-width:380px){.account-balance b{font-size:16px}.account-recharge{flex-basis:82px;padding-inline:10px}}
@media(min-width:700px){.recharge-dialog{height:min(92dvh,900px);max-height:min(92dvh,900px)!important;border-radius:20px!important}.recharge-dialog iframe{height:auto}}

/* Betting entry visibility; keep all existing page geometry and colors. */
#profileView .bet-entry-preference{border-top:1px solid var(--line);margin-top:18px;padding-top:16px}#profileView .bet-entry-preference h3{font-size:15px;margin:0 0 6px}#profileView .bet-entry-preference label{display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer}#profileView .bet-entry-preference input{flex:0 0 20px;width:20px;height:20px;margin:0;padding:0;accent-color:var(--green)}#profileView .bet-entry-preference .fine{margin-top:6px}

/* Selected A recharge host styles: external delivery required by host style-src self. */
/* Selected A: compact snapshot, steps, original native form. Recharge dialog only. */
#rechargeDialog{--ra-bg:#f7f8f9;--ra-surface:#fff;--ra-text:#20313d;--ra-muted:#596873;--ra-line:#d7dfe4;--ra-accent:#17486b;--ra-warn:#77591e;--ra-warn-bg:#fff8e6;--ra-danger:#9a4139;--ra-danger-bg:#fff0ec;background:var(--ra-bg)!important;color:var(--ra-text)!important;box-sizing:border-box;max-width:100vw!important;margin:auto!important;border:0!important;padding:0!important;overflow:hidden!important;width:min(100%,620px)!important;height:100dvh;max-height:100dvh!important;border-radius:0!important}
html[data-ql-theme=dark] #rechargeDialog{--ra-bg:#121a20;--ra-surface:#172027;--ra-text:#e2eaef;--ra-muted:#a3b0b9;--ra-line:#394650;--ra-accent:#9ac6e5;--ra-warn:#f2d28a;--ra-warn-bg:#362e1e;--ra-danger:#ffb2a7;--ra-danger-bg:#402723}
#rechargeDialog[open]{display:flex;flex-direction:column}#rechargeDialog .recharge-head{flex-shrink:0;background:var(--ra-surface)!important;color:var(--ra-text)!important;border-color:var(--ra-line)!important;grid-template-columns:100px minmax(0,1fr) 16px;text-align:left}
#rechargeDialog #closeRecharge{width:100px;min-width:100px;height:52px;min-height:44px;font-size:14px;line-height:1.4;color:var(--ra-accent);border:0;background:transparent;padding:0 12px;white-space:nowrap}
#rechargeDialog #rechargeOverview{flex-shrink:0;padding:10px 14px 8px;background:var(--ra-surface);border-bottom:1px solid var(--ra-line)}#rechargeDialog .recharge-snapshot{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;line-height:1.4}#rechargeDialog .recharge-snapshot small{font-size:11px;color:var(--ra-muted)}#rechargeDialog #rechargeSnapshot{font-size:25px;font-weight:650;font-variant-numeric:tabular-nums;color:var(--ra-text)}#rechargeDialog #rechargeSteps{display:flex;justify-content:space-between;gap:8px;list-style:none;margin:8px 0 0;padding:0;font-size:11px;line-height:20px;color:var(--ra-muted)}#rechargeDialog #rechargeSteps [aria-current=step]{color:var(--ra-accent);font-weight:700}
#rechargeDialog #rechargeResult{flex-shrink:0;max-height:116px;overflow:auto;overflow-wrap:anywhere;background:var(--ra-warn-bg);color:var(--ra-warn);border-color:var(--ra-line);font-size:12px;line-height:18px}#rechargeDialog #rechargeResult.is-error{background:var(--ra-danger-bg);color:var(--ra-danger)}#rechargeDialog #rechargeResultText{white-space:normal}#rechargeDialog #rechargeLoading{color:var(--ra-muted);font-size:14px;line-height:1.6;text-align:center;padding:14px}
#rechargeDialog #rechargeFrame{flex:1;width:100%;height:auto;min-height:0;border:0;background:var(--ra-bg)!important}#rechargeDialog #rechargeFrame[hidden],#rechargeDialog #rechargeResult[hidden]{display:none!important}#rechargeDialog button:focus-visible{outline:3px solid var(--ra-accent);outline-offset:-4px}
@media(max-height:550px){#rechargeDialog #rechargeOverview{padding:4px 12px}#rechargeDialog .recharge-snapshot{display:none}#rechargeDialog #rechargeSteps{margin:0}#rechargeDialog #rechargeResult{max-height:92px;padding:6px 12px}}

html[data-ql-theme=dark] #rechargeDialog .recharge-head{background:var(--ra-surface)!important;color:var(--ra-text)!important;border-color:var(--ra-line)!important}#rechargeDialog #rechargeSnapshot{max-width:100%;overflow-wrap:anywhere}

/* Recovery-only shell: independent of retired chat layout and strict CSP-safe. */
#ql-workspace-recovery{position:fixed;inset:0;z-index:2147483646;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:18px;overflow:auto;padding:calc(28px + env(safe-area-inset-top,0px)) max(22px,calc((100vw - 520px)/2)) calc(28px + env(safe-area-inset-bottom,0px));background:#f3f5f6;color:#24323c;min-height:100%;box-sizing:border-box;overflow-wrap:anywhere}
#ql-workspace-recovery h1{font-size:23px;line-height:1.5}#ql-workspace-recovery p{font-size:14px;line-height:1.8}#ql-workspace-recovery button{display:block;width:100%;min-height:48px;padding:12px 16px;background:#16517b;color:#fff;border-radius:13px;font-size:16px;font-weight:600}#ql-workspace-recovery button:focus-visible{outline:3px solid #5b8bad;outline-offset:3px}
#ql-workspace-recovery-consent{display:flex;align-items:flex-start;gap:10px;min-height:44px;line-height:1.8;font-size:13px}#ql-workspace-recovery-ack{flex:0 0 22px;width:22px;min-height:22px;height:22px;padding:0;margin:2px 0}#ql-workspace-recovery [hidden]{display:none!important}
html[data-ql-theme=dark] #ql-workspace-recovery{background:#121a20;color:#e2eaef}html[data-ql-theme=dark] #ql-workspace-recovery-consent{color:#c5d2db}

/* Native-entry host only: keep the outer account document out of iOS scroll chaining. */
html.ql-native-dialog-open{height:100%;overflow:hidden!important;overscroll-behavior:none}
html.ql-native-dialog-open>body{position:fixed!important;top:var(--ql-native-scroll-top,0px)!important;left:var(--ql-native-scroll-left,0px)!important;right:0;width:100%;overflow:hidden!important;overscroll-behavior:none}
#rechargeDialog[open]{position:fixed!important;top:var(--ql-native-dialog-top,0px)!important;left:0!important;right:0!important;bottom:auto!important;margin:0 auto!important;height:var(--ql-native-dialog-height,100dvh)!important;max-height:var(--ql-native-dialog-height,100dvh)!important;min-height:0;overscroll-behavior:none;padding-top:env(safe-area-inset-top,0px)!important;padding-bottom:env(safe-area-inset-bottom,0px)!important}
#rechargeDialog[open] #rechargeFrame{flex:1 1 0%;height:0;min-height:0;min-width:0;overscroll-behavior:contain}
@supports(overflow:clip){html.ql-native-dialog-open,html.ql-native-dialog-open>body{overflow:clip!important}}

/* Only the established native home viewer, never the payment dialog layout. */
#rechargeDialog[data-native-home] .recharge-head{grid-template-columns:100px minmax(0,1fr) 58px}
#rechargeDialog[data-native-home] #rechargeTitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#rechargeDialog[data-native-home] #refreshNativeHome{min-width:44px;min-height:44px;width:50px;height:44px;font-size:14px;line-height:1.2}
#refreshNativeHome[hidden],#nativeHomeFrame[hidden]{display:none!important}
#rechargeDialog[open] #nativeHomeFrame{width:100%;flex:1 1 0%;height:0;min-height:0;min-width:0;border:0;overscroll-behavior:contain;background:var(--ra-bg)}

/* Native viewer chrome; the original child owns its single navigation bar. */
#rechargeDialog[data-native-home] .recharge-head{grid-template-columns:max-content minmax(0,1fr) 52px;min-height:52px;gap:4px;padding:0 6px;box-sizing:border-box}
#rechargeDialog[data-native-home] .recharge-head>span{display:flex;justify-content:flex-end;min-width:0}
#rechargeDialog[data-native-home] #closeRecharge{min-width:44px;width:auto;padding:0 6px;font-size:13px}
#rechargeDialog[data-native-home] #rechargeTitle{text-align:center;min-width:0;font-size:14px}
@media(max-width:360px){#rechargeDialog[data-native-home] .recharge-head{grid-template-columns:max-content minmax(0,1fr) 46px;gap:2px;padding:0 4px}#rechargeDialog[data-native-home] #refreshNativeHome{width:44px}}

/* Only the native viewer; keep the iframe as the sole page scroller. */
@media(max-width:699px){
 #rechargeDialog[data-native-home][open]{width:100%!important;max-width:100vw!important;border:0;box-sizing:border-box}
 #rechargeDialog[data-native-home] .recharge-head{height:auto;min-height:52px;padding-top:env(safe-area-inset-top,0px);padding-left:max(4px,env(safe-area-inset-left,0px));padding-right:max(4px,env(safe-area-inset-right,0px))}
 #rechargeDialog[data-native-home] #nativeHomeFrame{min-height:0;min-width:0}
}

/* 可聊：浅蓝品牌；Logo 等待运营方提供，当前保留安装包占位图。 */
:root{--green:#2678ad;--muted:#718799;--line:#ddebf5;color:#263e51;background:#f3f9fd}
#workspace,header{background:#f5faff}
.primary{background:#b9e1fa;color:#1a4f73}
.secondary,.profile{background:#e5f3fd;color:#2678ad}
.quota-card{background:linear-gradient(120deg,#c9e9fc,#a7d6f5);color:#214c69}
.quota-card .fine,.quota-number>span{color:#41647c}
.login-brand{background:linear-gradient(140deg,#eff9ff,#d9effe)}
