/* Mobile-only presentation for handoff popovers. Desktop remains in handoff-ui.css. */
@media (max-width:760px){
  .handoff-mobile-overlay{
    position:fixed!important;
    inset:auto 0 calc(100dvh - var(--mc-vh,100dvh)) 0!important;
    z-index:1000;
    width:100vw!important;
    max-width:none!important;
    height:var(--mc-vh,100dvh);
    max-height:none!important;
    display:flex;
    align-items:flex-end;
    padding:0!important;
    border:0;
    border-radius:0!important;
    background:rgb(20 20 20/.32);
    box-shadow:none;
    overflow:hidden;
    overscroll-behavior:contain;
  }
  .handoff-mobile-overlay .mobile-pop-surface{
    width:100%;
    min-width:0;
    max-height:calc(var(--mc-vh,100dvh) - max(24px,env(safe-area-inset-top)));
    display:flex;
    flex-direction:column;
    background:var(--surface,#fff);
    border-radius:24px 24px 0 0;
    box-shadow:0 -12px 40px rgb(0 0 0/.16);
    overflow:hidden;
  }
  .handoff-mobile-overlay .mobile-pop-header{
    position:relative;
    min-height:48px;
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 48px;
    background:var(--surface,#fff);
    border-bottom:1px solid var(--line);
  }
  .handoff-mobile-overlay .mobile-pop-title{
    min-width:0;
    margin:0;
    font:500 16px/1.25 var(--sans,system-ui,sans-serif);
    letter-spacing:0;
    color:var(--ink);
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .handoff-mobile-overlay .mobile-pop-handle{
    position:absolute;
    inset:0;
    width:100%;
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:7px 48px 0;
    border:0;
    border-radius:0;
    background:transparent;
    color:var(--ink);
    touch-action:none;
  }
  .handoff-mobile-overlay .mobile-pop-grip{
    position:absolute;
    top:6px;
    left:50%;
    width:36px;
    height:4px;
    border-radius:999px;
    background:var(--ink3,#777);
    transform:translateX(-50%);
  }
  .handoff-mobile-overlay .mobile-pop-close{
    position:absolute;
    z-index:1;
    top:0;
    right:max(0px,env(safe-area-inset-right));
    width:48px;
    height:48px;
    display:grid;
    place-items:center;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    color:var(--ink);
  }
  .handoff-mobile-overlay .mobile-pop-close:hover{background:var(--fill)}
  .handoff-mobile-overlay .mobile-pop-close svg{width:20px;height:20px}
  .handoff-mobile-overlay .mobile-pop-content{
    min-height:0;
    padding-bottom:env(safe-area-inset-bottom);
    overflow-y:auto;
    overscroll-behavior-y:contain;
  }

  /* Account and Copy for AI remain discrete, content-height action sheets. */
  .handoff-mobile-sheet .mobile-pop-surface{height:auto}
  .handoff-mobile-sheet .mobile-pop-content{max-height:calc(var(--mc-vh,100dvh) - 72px - env(safe-area-inset-top));scroll-padding-bottom:calc(16px + env(safe-area-inset-bottom))}
  .handoff-mobile-sheet .action-list{gap:0;padding:4px 8px 8px}
  .handoff-mobile-sheet .action-list button{
    min-height:48px;
    padding:12px 14px;
    border-radius:12px;
    gap:14px;
    font-size:16px;
    line-height:1.25;
  }
  .handoff-mobile-sheet .action-list button svg{width:20px;height:20px;flex:none}
  .handoff-mobile-sheet .ac-id{gap:14px;padding:16px 20px 12px}
  .handoff-mobile-sheet .ac-id>.avatar{width:44px;height:44px}
  .handoff-mobile-sheet .ac-id b{font-size:16px;line-height:1.25}
  .handoff-mobile-sheet .ac-id small{font-size:14px;line-height:1.4}

  /* The bell is still visible between 681px and 760px, so avoid a duplicate account action there. */
  .handoff-mobile-sheet .account-notifications{display:none!important}

  /* Notifications are a full-height task with a fixed header and independently scrolling list. */
  .handoff-mobile-task{background:var(--surface,#fff)}
  .handoff-mobile-task .mobile-pop-surface{
    height:var(--mc-vh,100dvh);
    max-height:none;
    border-radius:0;
    box-shadow:none;
  }
  .handoff-mobile-task .mobile-pop-header{
    min-height:calc(48px + env(safe-area-inset-top));
    padding-top:env(safe-area-inset-top);
  }
  .handoff-mobile-task .mobile-pop-close{top:env(safe-area-inset-top)}
  .handoff-mobile-task .mobile-pop-content{
    flex:1;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    padding-bottom:env(safe-area-inset-bottom);
  }
  .handoff-mobile-task .nt-h{
    flex:0 0 auto;
    justify-content:flex-end;
    min-height:48px;
    padding:0 16px;
    border-bottom:1px solid var(--line);
  }
  .handoff-mobile-task .nt-h h2{display:none}
  .handoff-mobile-task .nt-h button{min-height:48px;padding:0;font-size:14px}
  .handoff-mobile-task .nt-list{
    flex:1;
    min-height:0;
    gap:0;
    padding:0;
    overflow-y:auto;
    overscroll-behavior-y:contain;
    scroll-padding-bottom:calc(16px + env(safe-area-inset-bottom));
  }
  .handoff-mobile-task .nt-list>.muted{padding:24px 16px;font-size:14px}
  .handoff-mobile-task .nt-row{
    grid-template-columns:32px minmax(0,1fr) auto 48px;
    gap:12px;
    align-items:start;
    min-height:64px;
    width:100%;
    padding:12px 16px;
    border-radius:0;
    border-bottom:1px solid var(--line);
    text-align:left;
  }
  .handoff-mobile-task .nt-row:not(:has(.nt-th)){grid-template-columns:32px minmax(0,1fr) auto}
  .handoff-mobile-task .nt-row>.avatar{width:32px;height:32px}
  .handoff-mobile-task .nt-t{font-size:14px;line-height:1.45}
  .handoff-mobile-task .nt-q{margin-top:4px;font-size:14px;line-height:1.45;white-space:normal}
  .handoff-mobile-task .nt-w{display:block;padding-top:1px;font-size:14px;line-height:1.45}
  .handoff-mobile-task .nt-th{width:48px;height:48px;border-radius:8px}
}

@media (max-width:680px){
  .handoff-mobile-sheet .account-notifications{display:flex!important}
}

@media(max-width:760px){.handoff-mobile-overlay{background:transparent}}
