303303 background-image : url ("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%234285F4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 5.18L10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10L22 5.18zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44A9.9 9.9 0 0012 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39l-1.61 1.61z'/%3E%3C/svg%3E" );
304304 }
305305
306+ .service-tag .classroom {
307+ color : var (--g-green );
308+ background-color : var (--g-green-dim );
309+ border-color : rgba (52 , 168 , 83 , 0.2 );
310+ background-image : url ("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%2334A853' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm6.82 6L12 12.72 5.18 9 12 5.28 18.82 9zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73v3.72z'/%3E%3C/svg%3E" );
311+ }
312+
313+ .service-tag .groups {
314+ color : var (--g-blue );
315+ background-color : var (--g-blue-dim );
316+ border-color : rgba (66 , 133 , 244 , 0.2 );
317+ background-image : url ("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%234285F4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12.75c1.63 0 3.07.39 4.24.9 1.08.48 1.76 1.56 1.76 2.73V18H6v-1.61c0-1.18.68-2.26 1.76-2.73 1.17-.52 2.61-.91 4.24-.91zM4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29zM20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4 3.43c0-.81-.48-1.53-1.22-1.85A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57zM12 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3z'/%3E%3C/svg%3E" );
318+ }
319+
320+ .service-tag .docs {
321+ color : var (--g-blue );
322+ background-color : var (--g-blue-dim );
323+ border-color : rgba (66 , 133 , 244 , 0.2 );
324+ background-image : url ("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%234285F4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.727 0v6h6l-6-6zm1.364 10.636H7.91v1.91h8.181v-1.91zm0 3.273H7.91v1.91h8.181v-1.91zM20.727 6.5v15.864c0 .904-.732 1.636-1.636 1.636H4.909a1.636 1.636 0 0 1-1.636-1.636V1.636C3.273.732 4.005 0 4.909 0h9.318v6.5h6.5zM16.091 7.727H7.91v1.91h8.181v-1.91z'/%3E%3C/svg%3E" );
325+ }
326+
327+ .service-tag .keep {
328+ color : var (--g-yellow );
329+ background-color : var (--g-yellow-dim );
330+ border-color : rgba (251 , 188 , 5 , 0.2 );
331+ background-image : url ("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%23FBBC05' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2 15H10v-1h4v1zm0-2H10v-1h4v1zm-1.5-4.59V13h-1v-2.59L9.67 8.59 10.41 7.85 12 9.44l1.59-1.59.74.74-1.83 1.82z'/%3E%3C/svg%3E" );
332+ }
333+
306334 .account-actions {
307335 display : flex;
308336 align-items : center;
382410 height : 16px ;
383411 }
384412
413+ .upgrade-btn {
414+ font-size : 11px ;
415+ font-weight : 500 ;
416+ color : var (--g-green );
417+ background : var (--g-green-dim );
418+ border : 1px solid rgba (52 , 168 , 83 , 0.3 );
419+ padding : 5px 10px ;
420+ border-radius : 99px ;
421+ cursor : pointer;
422+ transition : all 0.2s ease;
423+ opacity : 0 ;
424+ font-family : inherit;
425+ display : inline-flex;
426+ align-items : center;
427+ gap : 4px ;
428+ }
429+
430+ .account-card : hover .upgrade-btn {
431+ opacity : 1 ;
432+ }
433+
434+ .upgrade-btn : hover {
435+ background : rgba (52 , 168 , 83 , 0.2 );
436+ border-color : var (--g-green );
437+ }
438+
439+ .upgrade-btn svg {
440+ width : 12px ;
441+ height : 12px ;
442+ }
443+
385444 /* Add Account Button */
386445 .add-account-btn {
387446 width : 100% ;
@@ -754,7 +813,7 @@ <h4>Use from terminal</h4>
754813 const services = acc . services || [ 'calendar' , 'gmail' , 'drive' ] ;
755814
756815 return `
757- <div class="account-card ${ isDefault ? 'default' : '' } " data-email="${ acc . email } ">
816+ <div class="account-card ${ isDefault ? 'default' : '' } " data-email="${ acc . email } " onclick="upgradePermissions(' ${ acc . email } ', event)" >
758817 <div class="account-avatar" style="background: ${ getAvatarGradient ( acc . email ) } ">
759818 ${ initial }
760819 </div>
@@ -765,6 +824,13 @@ <h4>Use from terminal</h4>
765824 </div>
766825 </div>
767826 <div class="account-actions">
827+ <button class="upgrade-btn" onclick="upgradePermissions('${ acc . email } ', event)" title="Add more permissions">
828+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
829+ <line x1="12" y1="5" x2="12" y2="19"/>
830+ <line x1="5" y1="12" x2="19" y2="12"/>
831+ </svg>
832+ Permissions
833+ </button>
768834 ${ isDefault ? `
769835 <span class="default-badge">
770836 <svg viewBox="0 0 24 24" fill="currentColor">
@@ -773,9 +839,9 @@ <h4>Use from terminal</h4>
773839 Default
774840 </span>
775841 ` : `
776- <button class="set-default-btn" onclick="setDefault('${ acc . email } ')">Set default</button>
842+ <button class="set-default-btn" onclick="event.stopPropagation(); setDefault('${ acc . email } ')">Set default</button>
777843 ` }
778- <button class="remove-btn" onclick="removeAccount('${ acc . email } ')" title="Remove account">
844+ <button class="remove-btn" onclick="event.stopPropagation(); removeAccount('${ acc . email } ')" title="Remove account">
779845 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
780846 <line x1="18" y1="6" x2="6" y2="18"/>
781847 <line x1="6" y1="6" x2="18" y2="18"/>
@@ -793,6 +859,12 @@ <h4>Use from terminal</h4>
793859 window . location . href = '/auth/start' ;
794860 }
795861
862+ function upgradePermissions ( email , event ) {
863+ event . stopPropagation ( ) ;
864+ // Redirect to OAuth flow with force consent to get all permissions
865+ window . location . href = '/auth/upgrade?email=' + encodeURIComponent ( email ) ;
866+ }
867+
796868 async function setDefault ( email ) {
797869 try {
798870 const response = await fetch ( '/set-default' , {
0 commit comments